-
Notifications
You must be signed in to change notification settings - Fork 15
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
Some changes in the class Simulation and in IO #293
Conversation
This might break e2e-simulation but we'll need to update it anyway before the next round of simulations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be better to leave write_observations
and read_observations
where they are and add similar methods to the Simulation
class that are tiny wrappers to them? In this way we avoid introducing a breaking change, and it's easier to use the low-level “naked” functions in small test code without the need to instantiate a full Simulation
object.
This would be similar to what we did for several other functions:
Simulation.add_dipole
is a wrapper toadd_dipole_to_observations
;Simulation.add_noise
is a wrapper toadd_noise_to_observations
;Simulation.apply_gaindrift
is a wrapper toapply_gaindrift_to_observations
;Simulation.make_binned_map
is a wrapper tomake_binned_map
(same name!);Simulation.make_destriped_map
is a wrapper tomake_destriped_map
(same name!).
I had the same thought at the beginning but then I realized that
which is coherent with
|
Oh, I see, I missed that fact. Still, I think it would be better if we leave a small stub in from deprecation import deprecated
@deprecated(
deprecated_in="0.11",
current_version=litebird_sim_version,
details="Use Simulation.write_observations",
)
def write_observations(
sim: Simulation,
subdir_name: Union[None, str] = "tod",
include_in_report: bool = True,
*args,
**kwargs,
) -> List[Path]:
# Here we call the method we've just moved inside Simulation
sim.write_observations(…) (The real implementation of When we'll release version 0.12 we'll just chop off these two stubs, but |
It sounds good. I'll add it |
Hi @ziotom78, I had some problems with circular import. I had to remove |
You know, this reminds me of a similar problem I had long time ago. It might be that the weird choice of not having |
This PR moves
read_observations
andwrite_observations
fromio.py
tosimulations.py
, it should make the usage of the high level interface of the class Simulation more straightforward. It contains also small changes in the interface ofmake_binned_map
in the same class.