-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
switch convert_unknown_ndarray_subclasses to False #1858
Conversation
Running jwst regtests as fitsrec was the motivation for this setting: https://github.com/spacetelescope/RegressionTests/actions/runs/11616650882 EDIT: these ran with only 1 unrelated failure (same as on main) |
c590673
to
d8d95af
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Left a couple comments.
@@ -40,7 +40,7 @@ the currently active config: | |||
all_array_compression: input | |||
all_array_compression_kwargs: None | |||
default_array_save_base: True | |||
convert_unknown_ndarray_subclasses: True | |||
convert_unknown_ndarray_subclasses: False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this count as an API change? I'm not sure how asdf deals with changes like this and I don't know if there are any cases in practice that will be affected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree this counts as an API change.
When this feature was introduced (3.0.0) a warning was also added:
Lines 305 to 310 in abeef0e
warnings.warn( | |
f"A ndarray subclass ({type(obj)}) was converted as a ndarray. " | |
"This behavior will be removed from a future version of ASDF. " | |
"See https://asdf.readthedocs.io/en/latest/asdf/config.html#convert-unknown-ndarray-subclasses", | |
AsdfConversionWarning, | |
) |
and a section in the linked docs:
In a future version of asdf this default will change to False, a deprecation warning will be issued and finally the conversion of instances of subclasses will be removed.
We are now in the future! This PR adds the deprecation warning and asdf 5.0.0 we can remove the setting and the behavior.
Co-authored-by: Nadia Dencheva <[email protected]>
I opened an issue to track adding this to "what's new": #1865 |
Description
Switches the default value for convert_unknown_ndarray_subclasses to False and issues an
AsdfDeprecationWarning
if this setting is enabled. We can remove it in asdf 5.0.Tasks
pre-commit
on your machinepytest
on your machineno-changelog-entry-needed
)changes/
:echo "changed something" > changes/<PR#>.<changetype>.rst
(see below for change types)docs/
pagenews fragment change types...
changes/<PR#>.feature.rst
: new featurechanges/<PR#>.bugfix.rst
: bug fixchanges/<PR#>.doc.rst
: documentation changechanges/<PR#>.removal.rst
: deprecation or removal of public APIchanges/<PR#>.general.rst
: infrastructure or miscellaneous change