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

Missing file argument in Focalplane constructor #546

Open
giuspugl opened this issue Mar 30, 2022 · 4 comments
Open

Missing file argument in Focalplane constructor #546

giuspugl opened this issue Mar 30, 2022 · 4 comments

Comments

@giuspugl
Copy link
Contributor

the latest toast3 version is missing a file argument in case we want to provide a focalplane file , althouhg it is expected to be there from the docstring . see

def __init__(

is it just a bug ?

@keskitalo
Copy link
Member

Not a bug, just a different design. Now you instantiate the focalplane and use the load_hdf5() method. For an example, see toast_sim_ground.

@tskisner
Copy link
Member

Although the design is intentional, @giuspugl is correct that the docstring was stale. I just fixed that in the branch where I am working on the documentation.

The reasoning behind the design choice was that it was too easy to accidentally open the same HDF5 file from multiple processes causing file contention. I was trying to make the user decide what they really wanted to do by opening the file and calling the load_hdf5() method (the load / save methods are also used when writing / reading the focalplane to a Group of a larger HDF5 file). However, this change does make things less convenient for loading data serially from a notebook for example. We could restore "filename" constructor argument, at the risk of it being misused in parallel workflows. Thoughts?

@tskisner tskisner reopened this Mar 30, 2022
@giuspugl
Copy link
Contributor Author

Thanks @keskitalo and @tskisner for reviewing this issue! I am fine with calling load_hdf5() as you 're recommending, as i agree this is less convenient and intuitive for serial runs from a notebook.
However, I think that if the docstring encodes this detail (perhaps with some example for serial runs as @keskitalo did above) and it is documented then I don't see anything against adopting a unified approach. we will be surely safe by misuses in parallel workflows.

@tskisner
Copy link
Member

Ok, good point. I will include an example in the docstring. Will leave this open until that is fixed.

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

3 participants