spacetelescope / jwst

Python library for science observations from the James Webb Space Telescope
https://jwst-pipeline.readthedocs.io/en/latest/
Other
556 stars 164 forks source link

Add dict-like get to DataModel #5008

Open stscijgbot-jp opened 4 years ago

stscijgbot-jp commented 4 years ago

Issue JP-1484 was created on JIRA by Jonathan Eisenhamer:

Add a dict-like get to DataModel. Basically to allow the following

value = model.get('meta.cal_step.resample', 'SKIPPED')

Implementation note: Implementation may fall to properties.ObjectNode

stscijgbot-jp commented 5 months ago

Comment by David Law on JIRA:

Defer to Tyler Pauly on whether or not this is still relevant or can be closed.

stscijgbot-jp commented 5 months ago

Comment by Tyler Pauly on JIRA:

Jonathan Eisenhamer or Brett Graham - thoughts? Was the intent of the ticket specifically with regards to cal_step entries, or a more general method? I don't know how much has changed since this ticket was filed, but I haven't come upon an issue that this would help solve. Perhaps our existing schema architecture covers what gap this may have been intended for.

braingram commented 5 months ago

Although not an exact replacement the following works for a model that has a meta.cal_step attribute.

value = getattr(model.meta.cal_step, "resample", "SKIPPED")