-
Notifications
You must be signed in to change notification settings - Fork 0
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
tickets/DM-41840: Implement improved detection algorithms #7
Conversation
474619d
to
2648153
Compare
2648153
to
33ee0b4
Compare
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.
See individual comments.
|
||
|
||
class FreeFormComponent(FactorizedComponent): | ||
class FactorizedFreeFormComponent(FactorizedComponent): |
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.
A complete rename of a class like this should at least be a deprecation with an alias until it's removed, if not an RFC.
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.
Normally I would agree but nothing under models
has ever been used in production (and still isn't with this ticket). AFAIK no one other than me and a grad student that I work with have ever used this code, as it's all been experimental up until now. Deprecation also doesn't work, because I used the name for an actual FreeFormComponent (with no spectral constraints).
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.
As I wrote in #software-dev on LSSTC, you should be able to do this:
from deprecated.sphinx import deprecated
class FactorizedFreeFormComponent(FactorizedComponent):
...
@deprecated(reason="Renamed to FactorizedFreeFormComponent", version="v28.0", category=FutureWarning)
class FreeFormComponent(FactorizedFreeFormComponent):
pass
It's up to you but seeing as this class has been on main for over a year, I think it's best to deprecate the name properly.
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 understand your point and normally I would just deprecate it (since it isn't that hard). But in this case I actually reuse the name for a general, non-factorized FreeFormComponent (see https://github.com/lsst/scarlet_lite/blob/tickets/DM-41840/python/lsst/scarlet/lite/models/free_form.py#L143-L242). Had this been in broader use I probably would use a temporary name for the new class, with a deprecation warning on both, but I feel pretty strongly that in this instance no one even knows about these classes other than me and it's only a minor inconvenience to someone if I'm wrong.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7 +/- ##
==========================================
- Coverage 94.85% 94.06% -0.79%
==========================================
Files 38 38
Lines 4740 4852 +112
==========================================
+ Hits 4496 4564 +68
- Misses 244 288 +44 ☔ View full report in Codecov by Sentry. |
No description provided.