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

replace usages of copy_arrays with memmap #306

Merged
merged 3 commits into from
Jul 18, 2024

Conversation

zacharyburnett
Copy link
Collaborator

follow-on to asdf-format/asdf#1797

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)

@zacharyburnett zacharyburnett self-assigned this Jul 18, 2024
Copy link

codecov bot commented Jul 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.21%. Comparing base (4d7c3a6) to head (f5c46d7).
Report is 31 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #306      +/-   ##
==========================================
+ Coverage   64.84%   66.21%   +1.37%     
==========================================
  Files         103      101       -2     
  Lines        5694     5402     -292     
==========================================
- Hits         3692     3577     -115     
+ Misses       2002     1825     -177     

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

@zacharyburnett zacharyburnett marked this pull request as ready for review July 18, 2024 15:14
@zacharyburnett zacharyburnett requested a review from a team as a code owner July 18, 2024 15:14
Copy link
Collaborator

@braingram braingram left a comment

Choose a reason for hiding this comment

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

Thanks!

Based on https://github.com/spacetelescope/jwst/pull/8660/files the "copy_arrays" usage is very limited in jwst and I see no uses that pass it to DataModel.__init__. It's possible a user might be doing this and it also makes sense to me to remove "copy_arrays" as an allowed keyword argument (eventually).

Would you add a deprecation for passing "copy_arrays" to DataModel.__init__ and a test for the deprecation? I think another UserWarning is called for here since it seems likely to happen in an interactive session. We can then remove "copy_arrays" for stdatamodels 3.0.0

@zacharyburnett
Copy link
Collaborator Author

Thanks!

Based on https://github.com/spacetelescope/jwst/pull/8660/files the "copy_arrays" usage is very limited in jwst and I see no uses that pass it to DataModel.__init__. It's possible a user might be doing this and it also makes sense to me to remove "copy_arrays" as an allowed keyword argument (eventually).

Would you add a deprecation for passing "copy_arrays" to DataModel.__init__ and a test for the deprecation? I think another UserWarning is called for here since it seems likely to happen in an interactive session. We can then remove "copy_arrays" for stdatamodels 3.0.0

Alternatively, we can remove handling copy_arrays entirely and outsource that warning to the AsdfWarning that'll come up when it is passed to asdf.open(); see f5c46d7

Copy link
Collaborator

@braingram braingram left a comment

Choose a reason for hiding this comment

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

Much simpler :) Good idea!

@braingram braingram merged commit ee4756f into spacetelescope:main Jul 18, 2024
21 checks passed
@zacharyburnett zacharyburnett deleted the deprecate/copy_arrays branch July 18, 2024 18:16
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