Change return type of from_list, from_sequence to PlainQuantity[Array[MagnitudeT]]#2258
Conversation
…[MagnitudeT]] Updated return type of from_list and from_sequence methods to support numpy arrays.
CodSpeed Performance ReportMerging this PR will not alter performanceComparing Summary
|
|
Thanks, this looks fine to merge. |
|
I did not check what was running in term of type check in the CI. I think mypy should be able to catch this but the rest of teh codebase may not be ready. Another options would be to run mypy on some select files with test assignment. As a side note, there is still a minor annoyance in the behavior of this function in that it generates a PlainQuantity which is not indexable but since the magnitude is a NDArray, it is indexable and always is. Would it be possible to return a Quantity or another appropriate facet ? |
that would be ideal, though I'm not sure how to go about it |
|
|
|
It is not ?!? Well this is sad since Numpy array is and the typing could be more explicit this way. Any idea how it would be to make Array generic ? |
Updated return type of from_list and from_sequence methods to support numpy arrays.
pre-commit run --all-filesorpixi run lint --all-fileswith no errors