Skip to content
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

support integer-1.1 and ndarray-1.1 #1250

Merged
merged 5 commits into from
Dec 13, 2022

Conversation

braingram
Copy link
Contributor

fixes an issue with integer where IntegerType instead of cls was used during class instantiation which resulted in objects being created with the incorrect version. Prior code (that only had one integer version, 1.0) did not suffer from issues because of this bug.

fixes #1245 by removing the use of super in NDArrayType and adding an exception to check for incompatible use of super in classes of type ExtensionTypeMeta.

This should be merged with asdf-standard PR asdf-format/asdf-standard#350

@WilliamJamieson
Copy link
Contributor

WilliamJamieson commented Nov 30, 2022

Now that asdf-format/asdf-standard#350 is merged can you Remove the skips added in #1251 and #1252?

Comment on lines 278 to 303
version = request.getfixturevalue("version")
if (version, tag) in [
("1.6.0", "tag:stsci.edu:asdf/core/column-1.1.0"),
("1.6.0", "tag:stsci.edu:asdf/core/integer-1.1.0"),
("1.6.0", "tag:stsci.edu:asdf/core/ndarray-1.1.0"),
("1.6.0", "tag:stsci.edu:asdf/core/table-1.1.0"),
("1.6.0", "tag:stsci.edu:asdf/fits/fits-1.1.0"),
("1.6.0", "tag:stsci.edu:asdf/time/time-1.2.0"),
("1.6.0", "tag:stsci.edu:asdf/unit/defunit-1.0.0"),
("1.6.0", "tag:stsci.edu:asdf/unit/defunit-1.1.0"),
("1.6.0", "tag:stsci.edu:asdf/unit/quantity-1.2.0"),
("1.6.0", "tag:stsci.edu:asdf/unit/unit-1.1.0"),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed some of the skips added in #1251 and #1252
Removing the remaining skips would require updates to astropy.io.misc.asdf or merging the PRs in asdf-standard that remove these tags (table, column, time, unit, etc) from the standard version maps.

@braingram
Copy link
Contributor Author

It looks like this will require either a release of asdf-standard or refactoring test_builtin_extension (and readding one of the xfails for defunit).

Comment on lines +137 to +144
raise RuntimeError(
"Subclasses of ExtensionTypeMeta that define "
"supported_versions cannot used super() to call "
"parent class functions. super() creates a "
"__classcell__ closure that cannot be duplicated "
"during creation of versioned siblings. "
"See https://github.com/asdf-format/asdf/issues/1245"
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you write a test that raises this error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing. I added one to 80d5904

fixes an issue with integer where InterType instead of cls
was used during class instantiation which resulted in objects
being created with the incorrect version. Prior code (that only
had one integer version, 1.0) did not suffer from issues because
of this bug.

fixes asdf-format#1245 by removing the use of super in NDArrayType and adding
an exception to check for incompatible use of super in classes of
type ExtensionTypeMeta.
@WilliamJamieson WilliamJamieson merged commit 73d65ec into asdf-format:master Dec 13, 2022
@braingram braingram deleted the bug/ndarray_schema branch December 13, 2022 21:35
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.

NDArrayType does not allow for supported_versions
2 participants