Skip to content

Updated band requirement for velocity dispersion notebook and modified light2mass.py and test_light2mass.py to reflect changes#338

Open
mia-lamontagne wants to merge 9 commits intoLSST-strong-lensing:mainfrom
mia-lamontagne:velocity-dispersion
Open

Updated band requirement for velocity dispersion notebook and modified light2mass.py and test_light2mass.py to reflect changes#338
mia-lamontagne wants to merge 9 commits intoLSST-strong-lensing:mainfrom
mia-lamontagne:velocity-dispersion

Conversation

@mia-lamontagne
Copy link
Copy Markdown
Contributor

Modified get_deflector_velocity_dispersion.ipynb to run with only the three LSST bands (g, r, i) as these are the only available in the cosmo_DC2.fits catalog.

Updated get_velocity_dispersion() in light2mass.py to support both full 5-band LSST photometry and reduced 3-band input. When only g, r, and i bands are available, the function now substitutes the missing u band with g and the z band with i, ensuring compatibility with LSST_to_SDSS().

Added additional tests to test_light2mass.py to reflect the new 3-band case. While error thresholds remain the same for the 3-band "weak-lensing" case, a greater error threshold of 10% was used in the "spectroscopic" case to reflect expected greater deviation from accepted value.

@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@sibirrer
Copy link
Copy Markdown
Contributor

thank you very much @mia-lamontagne ! There is an error in the tests (click on the CI / build and scroll up), hope you can address that

@sibirrer
Copy link
Copy Markdown
Contributor

@mia-lamontagne the tests are still failing. Did you execute the tests locally first before committing? It can save you hassle and wait time

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.11%. Comparing base (2ab9a2a) to head (f9f681b).
Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #338      +/-   ##
==========================================
+ Coverage   97.93%   98.11%   +0.17%     
==========================================
  Files         154       94      -60     
  Lines       10479     6141    -4338     
==========================================
- Hits        10263     6025    -4238     
+ Misses        216      116     -100     
Files with missing lines Coverage Δ
slsim/Deflectors/light2mass.py 100.00% <100.00%> (ø)

... and 64 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@sibirrer sibirrer left a comment

Choose a reason for hiding this comment

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

Thank you @mia-lamontagne ! One more minor change and then it's ready to merge :)

raise KeyError("The module currently supports only elliptical galaxies.")

if "g" not in bands or "r" not in bands or "i" not in bands:
raise ValueError(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can you also make a test without one of the required bands to raise this error? We are basically done but worth testing this as well :)

@nkhadka21
Copy link
Copy Markdown
Collaborator

Hi @mia-lamontagne , thank you very much for this PR! There is a minor suggestion from @sibirrer which you can address. Then, the PR will be ready to merge! Thank you!

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