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

Make ObservationModule iterable #153

Open
york-stsci opened this issue Oct 5, 2021 · 0 comments
Open

Make ObservationModule iterable #153

york-stsci opened this issue Oct 5, 2021 · 0 comments

Comments

@york-stsci
Copy link
Collaborator

Currently, in order to use an ObservationModule, it must be created, then nextObservation() must be called, then the observation must be run, and nextObservation() called again until it returns None. Instead, this would add an iter method that includes yield, so that it could be done as:

obm = ObservationModule(obs=obs_dict)
for observation in obm:
observation.add_catalogue(catalogue)
observation.add_error()
observation.finalize()

which is both more pythonic and probably makes more sense.

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

No branches or pull requests

1 participant