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

Add additional usage examples to ModelLibrary documentation #184

Open
emolter opened this issue Aug 21, 2024 · 0 comments
Open

Add additional usage examples to ModelLibrary documentation #184

emolter opened this issue Aug 21, 2024 · 0 comments

Comments

@emolter
Copy link
Collaborator

emolter commented Aug 21, 2024

Implementation of ModelLibrary on the JWST side revealed some common use-cases and coding patterns that would be useful to document in the AbstractModelLibrary docs. These were:

  • example workflow where map_function() is used as a generator non-trivially. i.e., for data in lib.map_function(lambda m, i: m.data, modify=False): # do something read-only with the data for this model

  • example that shows usage of list(lib.map_function()) to modify models in place

  • library shelve with try…except…finally when errors might be raised while models are open (and note that the try…except should be entirely inside the with context, otherwise finally will not see the library as open)

  • link to documentation of asn dictionaries, e.g. this one for JWST. For this point, it would eventually be useful to agree on a common standard for associations between Roman and JWST, and perhaps move some common association code to stpipe.

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

No branches or pull requests

1 participant