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

DM-44029: Deprecate NaiveDipoleCentroid and NaiveDipoleFlux #313

Merged
merged 2 commits into from Apr 25, 2024

Conversation

parejkoj
Copy link
Contributor

No description provided.

@arunkannawadi arunkannawadi self-requested a review April 24, 2024 15:31
Copy link
Member

@arunkannawadi arunkannawadi left a comment

Choose a reason for hiding this comment

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

LGTM! One major request is to not rename the field. There's also a reference to this algorithm in DipoleMeasurementTask.rst under the doc/ directory. That should also be marked for removal in DM-44030.

@@ -208,7 +208,9 @@ inline DipoleFluxAlgorithm::DipoleFluxAlgorithm(
class that knows how to calculate centroids as a simple unweighted first
* moment of the 3x3 region around the peaks
*/
class NaiveDipoleFlux : public DipoleFluxAlgorithm {
class [[deprecated(
"This algorithm is deprecated and will be removed after v27.")]]
Copy link
Member

Choose a reason for hiding this comment

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

Could you include the names of the algorithms in the deprecation warnings?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That comes "for free" with the compiler warning that is emitted when you try to use the class.

_posCentroid = meas::base::CentroidResultKey(schema[name+"_pos_centroid"]);
_negCentroid = meas::base::CentroidResultKey(schema[name+"_neg_centroid"]);
_avgCentroid = meas::base::CentroidResultKey(schema[name+"_centroid"]);
Copy link
Member

Choose a reason for hiding this comment

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

Removing the suffixes seem like it could break other codes, or user scripts. For something that's going to be removed soon, is it necessary? At the very least, it should be on its own separate commit.

Copy link
Contributor Author

@parejkoj parejkoj Apr 25, 2024

Choose a reason for hiding this comment

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

Unfortunately, if I don't change it some existing tests (that use DipoleMeasurementTask, which are only used in tests now and one of the things I'd like to deprecate in the future) will fail because they set ip_diffim_PsfDipoleFlux as the centroid slot, and the centroid slot requires that "name_x"/"name_y" be the centroid fields, not "name_centroid_x".

Nothing in the stack has used these values for a long time, so I think we're ok.

I did move them to a separate commit, though.

Copy link
Member

Choose a reason for hiding this comment

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

Alright, then!

@@ -158,6 +161,9 @@ void wrapDipoleAlgorithms(lsst::cpputils::python::WrapperCollection &wrappers) {
declarePsfDipoleFlux(wrappers);
}

// Remove these pragmas on DM-44030
#pragma GCC diagnostic pop

Copy link
Member

Choose a reason for hiding this comment

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

Could you add a comment on what these pragma s are doing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Change PsfDipoleFlux algorithm to not postfix `_centroid` for positions,
so that it behaves properly with the slot system.
@parejkoj parejkoj merged commit 180d380 into main Apr 25, 2024
2 checks passed
@parejkoj parejkoj deleted the tickets/DM-44029 branch April 25, 2024 04:40
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