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

U/echarles/all the estimators #2

Open
wants to merge 29 commits into
base: main
Choose a base branch
from

Conversation

eacharles
Copy link
Collaborator

Added support for several other estimators, bpz, cmnn, dnf, fzboost, gpz, lephare, tpz.

Added tests for each running against DC2, HSC and ComCam data.

@eacharles eacharles self-assigned this Mar 27, 2025
Copy link

@taranu taranu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't go everything carefully but Melissa asked if I could give feedback so hopefully at least some of this is useful.

@@ -107,8 +101,15 @@ class EstimatePZAlgoConfigBase(
def estimator_class(cls) -> type[CatEstimator]:
raise NotImplementedError()

_bands = pexConfig.ListField[str](
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why underscore this? I don't think the average user will attempt to change it without any reason.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because 'bands' is already in use in some of the algorithms.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this is not actually used by the code, it is just a way to set the band names more easily.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bands field used elsewhere seems to be a list of magnitude column names like mag_r_lsst. Is RAIL reading this as an attribute or something?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The various estimators have a variety of patterns as to how they get the list of colums to use. Some (but not all) of them have a parameter called bands to do this.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what I mean, it's confusing to have it be called bands. It should be something like fluxes or flux_columns. If it has to be called bands because RAIL expects it to be called bands, then it would be best to explain this in the doc for the field.

Or put another way, the docs for both _bands and bands should explain to a user initializing one of the config classes that contain both what the difference between the two is, and what overriding them would do.

"mag_z_lsst",
"mag_y_lsst",
]
self.pz_algo.mag_limits = dict(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest putting this in some common definitions file if it's meant to be shared between algorithms. If you foresee the values diverging then never mind.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you have in mind here? Where would that file live, what would it contain, etc..? Do you have a example.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On second thought, a better option is probably defining a class variable like mag_limits_default = dict(...) in EstimatePZTaskConfig, then subclasses can put self.pz_algo.mag_limits = self.mag_limits_default.

@eacharles
Copy link
Collaborator Author

eacharles commented Apr 4, 2025 via email

@eacharles
Copy link
Collaborator Author

eacharles commented Apr 4, 2025 via email

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

Successfully merging this pull request may close these issues.

None yet

2 participants