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

JP-1645 Supress CRDS unknown reftype errors while retrieving step parameter reference files. #5375

Closed

Conversation

stscieisenhamer
Copy link
Collaborator

Resolves JP-1645
Resolves #5251

Currently, the CRDS database is sparsely populated with respect to all the possible step parameter reftypes. As such, under normal usage, it is expected to not find a requested reftype. As such, suppress CRDS errors unless debugging is in effect.

Copy link
Collaborator

@jdavies-st jdavies-st left a comment

Choose a reason for hiding this comment

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

🎉 It will be nice to not see these error messages from CRDS anymore.

Just a minor comment below.

Comment on lines 41 to 42
model = datamodels.ImageModel((10, 10))
model.save('image.fits')
Copy link
Collaborator

Choose a reason for hiding this comment

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

This needs to be done in a with context manager. You're leaving an open file here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will do, but technically no file is open, unless the below is a bug:

>>> import jwst.datamodels as dm
>>> m = dm.ImageModel((10, 10))
>>> m.save('junk.fits')
    'junk.fits'
>>> m._files_to_close
    []

Copy link
Collaborator

Choose a reason for hiding this comment

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

Interesting! I was always under the impression that once something was written, it was then tied to the file. This a nice, positive thing to discover!

Copy link
Collaborator

@hbushouse hbushouse left a comment

Choose a reason for hiding this comment

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

Other than what @jdavies-st said, looks OK to me.

@codecov
Copy link

codecov bot commented Sep 30, 2020

Codecov Report

Merging #5375 into master will decrease coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5375      +/-   ##
==========================================
- Coverage   52.88%   52.85%   -0.03%     
==========================================
  Files         409      409              
  Lines       37098    37111      +13     
  Branches     5760     5763       +3     
==========================================
- Hits        19618    19616       -2     
- Misses      16231    16246      +15     
  Partials     1249     1249              
Flag Coverage Δ
#unit 52.85% <100.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
jwst/stpipe/step.py 80.23% <100.00%> (+0.07%) ⬆️
...ter_background/master_background_nrs_slits_step.py 18.18% <0.00%> (-2.31%) ⬇️
jwst/ramp_fitting/utils.py 95.25% <0.00%> (-0.08%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a8d5086...955da11. Read the comment docs.

@stscieisenhamer stscieisenhamer marked this pull request as draft October 12, 2020 14:04
@stscieisenhamer
Copy link
Collaborator Author

Changing the status of the PR to Draft. Going to pursue a more preferred solution described in CRDS-381.

@stscieisenhamer
Copy link
Collaborator Author

This PR has been rendered unnecessary by CCD_783

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

Successfully merging this pull request may close these issues.

Failures to get pars reference files in prefetch cause log messages
3 participants