Skip to content

Deprecate array protocol fallback#953

Merged
bors[bot] merged 2 commits into
hgrecco:masterfrom
jthielen:issue-924
Dec 27, 2019
Merged

Deprecate array protocol fallback#953
bors[bot] merged 2 commits into
hgrecco:masterfrom
jthielen:issue-924

Conversation

@jthielen
Copy link
Copy Markdown
Contributor

@jthielen jthielen commented Dec 26, 2019

This PR implements the changes discussed in #924: deprecating the __array_* attribute fallback and making __array__ explicit in the Quantity API. Also, to enable the non-fallback behavior before the following minor version is released that removes the fallback, a check for a PINT_ARRAY_PROTOCOL_FALLBACK environment variable is added.

@keewis
Copy link
Copy Markdown
Contributor

keewis commented Dec 26, 2019

I think this also closes #892?

@hgrecco
Copy link
Copy Markdown
Owner

hgrecco commented Dec 26, 2019

bors r+

@bors
Copy link
Copy Markdown
Contributor

bors Bot commented Dec 26, 2019

Merge conflict

@jthielen
Copy link
Copy Markdown
Contributor Author

Merge conflict

I've just rebased and fixed the conflict after #954 was merged.

@hgrecco
Copy link
Copy Markdown
Owner

hgrecco commented Dec 27, 2019

bors r+

bors Bot added a commit that referenced this pull request Dec 27, 2019
953: Deprecate array protocol fallback r=hgrecco a=jthielen

This PR implements the changes discussed in #924: deprecating the `__array_*` attribute fallback and making `__array__` explicit in the Quantity API. Also, to enable the non-fallback behavior before the following minor version is released that removes the fallback, a check for a `PINT_ARRAY_PROTOCOL_FALLBACK` environment variable is added.

- [x] Closes #892, Closes #924
- [x] Executed ``black -t py36 . && isort -rc . && flake8`` with no errors
- [x] The change is fully covered by automated unit tests
- [x] Documented in docs/ as appropriate
- [x] Added an entry to the CHANGES file


Co-authored-by: Jon Thielen <[email protected]>
@bors
Copy link
Copy Markdown
Contributor

bors Bot commented Dec 27, 2019

Build succeeded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proper handling of __array_*__ attributes/methods setting warnings to errors changes the behaviour of np.asarray on quantities

3 participants