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

increase asdf version, switch _force_raw_types for load_yaml #288

Merged
merged 2 commits into from
Mar 21, 2024

Conversation

braingram
Copy link
Collaborator

@braingram braingram commented Mar 19, 2024

Increases minimum asdf version to 3.1.0 (inline with jwst: https://github.com/spacetelescope/jwst/blob/master/pyproject.toml#L22) and switches _force_raw_types usage to load_tree.

Also updates one test that fails with ASDF standard 1.6.0 as the default due to an incorrect assumption about the tag version:

with asdf.open(path, _force_raw_types=True) as af:
assert af.tree["model"]._tag == "tag:stsci.edu:jwst_pipeline/niriss_soss-1.0.0"

assumes the tag will be 1.0.0. With ASDF standard 1.6.0 the tag will be 1.1.0:
- tag_uri: "tag:stsci.edu:jwst_pipeline/niriss_soss-1.1.0"
schema_uri: http://stsci.edu/schemas/jwst_pipeline/niriss_soss-1.1.0

Checklist

  • added entry in CHANGES.rst (either in Bug Fixes or Changes to API)
  • updated relevant tests
  • updated relevant documentation
  • updated relevant milestone(s)
  • added relevant label(s)

Copy link

codecov bot commented Mar 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.95%. Comparing base (4d7c3a6) to head (519a2a5).
Report is 20 commits behind head on main.

❗ Current head 519a2a5 differs from pull request most recent head cb90cdd. Consider uploading reports for the commit cb90cdd to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #288      +/-   ##
==========================================
+ Coverage   64.84%   64.95%   +0.11%     
==========================================
  Files         103      104       +1     
  Lines        5694     5712      +18     
==========================================
+ Hits         3692     3710      +18     
  Misses       2002     2002              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@braingram braingram changed the title switch _force_raw_types for load_yaml increase asdf version, switch _force_raw_types for load_yaml Mar 19, 2024
@braingram braingram marked this pull request as ready for review March 19, 2024 18:30
@braingram braingram requested a review from a team as a code owner March 19, 2024 18:30
@braingram braingram force-pushed the remove_force_raw_types branch from 0c0cc5e to 519a2a5 Compare March 20, 2024 20:00
Copy link
Collaborator

@tapastro tapastro left a comment

Choose a reason for hiding this comment

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

Approve the minimum asdf bump - but I don't quite follow the change from _force_raw_types to load_yaml. Does this address a bug, improve performance, prep for a deprecation, or something else entirely?

@braingram
Copy link
Collaborator Author

Thanks for taking a look. I should have added more details.

asdf-format/asdf#1700 introduced load_yaml to try and replace the (many) uses of the private argument _force_raw_types. It was included in asdf 3.1.0 and since jwst increased the minimum version we can follow suit with this PR and swap out all the uses. So sort of dealing with a deprecation as now asdf can consider removing that private argument to clean up asdf.open.

@braingram braingram force-pushed the remove_force_raw_types branch from 519a2a5 to cb90cdd Compare March 21, 2024 12:53
@tapastro tapastro self-requested a review March 21, 2024 13:33
Copy link
Collaborator

@tapastro tapastro left a comment

Choose a reason for hiding this comment

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

Looks good, appreciate the clarification! Sorry for the accidental re-request, @zacharyburnett - misclick 😬

@braingram braingram merged commit c57c841 into spacetelescope:main Mar 21, 2024
19 checks passed
@braingram braingram deleted the remove_force_raw_types branch March 21, 2024 13:36
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.

2 participants