-
Notifications
You must be signed in to change notification settings - Fork 1
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
Toast / sotodlib mapmaking #11
base: main
Are you sure you want to change the base?
Conversation
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.
I added some very high level comments
I did not go into all the details but looks great to me
Thank you very much for all of this 😃
self.clear() | ||
|
||
@function_timer | ||
def _exec(self, data, detectors=None, **kwargs): # type: ignore[no-untyped-def] |
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.
I am not a big fan of perf measure in production code
this could be in an outside script maybe?
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.
Agreed, removed the performance measures but allowed a custom logger for timing.
|
||
@dataclass | ||
class ObservationData: |
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.
I am assuming this is some static data class that it used internally
however it is still very easy to make into an actual jittable pytree in case it is passed around
@dataclass | |
class ObservationData: | |
@jax.tree_util.register_dataclass | |
@dataclass | |
class ObservationData: |
check
https://jax.readthedocs.io/en/latest/_autosummary/jax.tree_util.register_dataclass.html
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.
Thank you! I simply added this line for now. In the future, I will look into specifying meta/data fields for performance.
|
||
for i, leaf in enumerate(in_leaves_ref): | ||
# looping through the Stokes parameters | ||
zeros = in_leaves_ref.copy() |
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.
I think that copy
should not be used and XLA would automatically make a copy if it is needed
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.
I think the copy()
is justified here to create a shallow copy of the original list of pytree leaves. Maybe @pchanial has an opinion on this (this function is mostly taken from his default as_matrix()
implementation for abstract linear operators).
@@ -0,0 +1,161 @@ | |||
import argparse |
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.
You can add scripts in pyproject.toml for convinience
see https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#creating-executable-scripts
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.
This is cool! I added the 'furax-mapmaking' command (for now) by editing pyproject.toml
8bc3fc8
to
0fedfac
Compare
Squashed all modifications (before @Wuhyun's latest commits to address mypy errors and review comments) into one giant commit to avoid merge commits that were messing up the "changes" compared to main branch. |
0fedfac
to
5f554fb
Compare
Added @Wuhyun as co-author on the mega-commit :) |
d8e03c0
to
2003a0b
Compare
Co-authored-by: Wuhyun <[email protected]>
…servationData class
so that it is recognized as a (sub)-package
0a7db5d
to
9c6fc94
Compare
- use `apischema` for (de)serialization
…into toast-mapmaking
ValidLandscapeType = Literal['WCS', 'Healpix'] | ||
|
||
|
||
@dataclass(frozen=True) |
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.
Quels sont vraiment les motivations / bénéfices de l'immutabilité ici ? On pourrait lire une config par défaut, puis la mettre à jour ensuite partiellement.
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.
Dans l'idée, ne pas pouvoir modifier la configuration spécifiée au départ par inadvertance.
Si l'utilisateur fournit un fichier de configuration partiel, les champs restants prendront la valeur par défaut.
3ab8642
to
1b005b3
Compare
Mapmaking utilities built for toast and sotodlib data. Depends on toast and sotodlib for some functionalities.
The code contains all utilities needed to load toast and sotodlib data objects and run mapmaking. However, there are currently two independent sets of codes. These codes will be refactored to use a single combined interface in the near future.