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

tickets/DM-41840: Implement improved detection algorithms #7

Merged
merged 7 commits into from
Nov 21, 2024

Conversation

fred3m
Copy link
Collaborator

@fred3m fred3m commented Sep 20, 2024

No description provided.

@fred3m fred3m force-pushed the tickets/DM-41840 branch 6 times, most recently from 474619d to 2648153 Compare September 20, 2024 19:26
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.

See individual comments.

pyproject.toml Outdated Show resolved Hide resolved
python/lsst/scarlet/lite/blend.py Outdated Show resolved Hide resolved
python/lsst/scarlet/lite/detect.py Outdated Show resolved Hide resolved
python/lsst/scarlet/lite/detect_pybind11.cc Show resolved Hide resolved
python/lsst/scarlet/lite/detect_pybind11.cc Show resolved Hide resolved
python/lsst/scarlet/lite/models/free_form.py Outdated Show resolved Hide resolved
python/lsst/scarlet/lite/utils.py Outdated Show resolved Hide resolved
tests/test_detect.py Outdated Show resolved Hide resolved
tests/test_detect.py Outdated Show resolved Hide resolved


class FreeFormComponent(FactorizedComponent):
class FactorizedFreeFormComponent(FactorizedComponent):
Copy link

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.

Copy link
Collaborator Author

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).

Copy link

@taranu taranu Nov 7, 2024

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.

Copy link
Collaborator Author

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.

Copy link

codecov bot commented Oct 29, 2024

Codecov Report

Attention: Patch coverage is 76.71958% with 44 lines in your changes missing coverage. Please review.

Project coverage is 94.06%. Comparing base (ae00866) to head (63d0086).

Files with missing lines Patch % Lines
python/lsst/scarlet/lite/models/free_form.py 40.90% 39 Missing ⚠️
python/lsst/scarlet/lite/detect.py 93.33% 2 Missing ⚠️
python/lsst/scarlet/lite/initialization.py 60.00% 2 Missing ⚠️
python/lsst/scarlet/lite/parameters.py 66.66% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@fred3m fred3m merged commit 168dd56 into main Nov 21, 2024
7 checks passed
@fred3m fred3m deleted the tickets/DM-41840 branch November 21, 2024 19:10
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.

3 participants