Skip to content

Conversation

@jeremykubica
Copy link
Collaborator

Perform a small refactoring of the simulate_lightcurves function to make it easier to extend to multiple surveys in the future:

  1. Populate most of the results_dict when it is created (instead of in the loop)
  2. Use at_least1d instead of if-based logic.
  3. Add checks that the parameters and columns we want to save actually exist. This will make it easier to debug by replacing a general KeyError with something more informative.

@jeremykubica jeremykubica requested a review from mi-dai September 2, 2025 14:40
@codecov
Copy link

codecov bot commented Sep 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.43%. Comparing base (78e6506) to head (047b3db).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #420      +/-   ##
==========================================
+ Coverage   91.39%   91.43%   +0.03%     
==========================================
  Files          53       53              
  Lines        3777     3770       -7     
==========================================
- Hits         3452     3447       -5     
+ Misses        325      323       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@github-actions
Copy link

github-actions bot commented Sep 2, 2025

Before [78e6506] After [65086f5] Ratio Benchmark (Parameter)
1.43±0.8ms 3.01±0.8ms ~2.11 benchmarks.TimeSuite.time_lightcurve_source
116±3μs 124±4μs 1.07 benchmarks.TimeSuite.time_evaluate_simple_linear_wavelength_source
9.69±0.4ms 9.98±0.3ms 1.03 benchmarks.TimeSuite.time_evaluate_salt3_model
89.6±2μs 91.5±2μs 1.02 benchmarks.TimeSuite.time_make_and_evaluate_step_source
12.3±0.3μs 12.5±0.06μs 1.02 benchmarks.TimeSuite.time_sample_x1_from_hostmass
7.61±0.08ms 7.73±0.09ms 1.01 benchmarks.TimeSuite.time_apply_white_noise
11.1±0.1ms 11.2±0.04ms 1.01 benchmarks.TimeSuite.time_make_evaluate_static_source
29.5±0.4μs 29.9±0.2μs 1.01 benchmarks.TimeSuite.time_make_simple_linear_wavelength_source
109±1μs 110±0.8μs 1.01 benchmarks.TimeSuite.time_sample_x0_from_distmod
8.48±0.04ms 8.48±0.04ms 1.00 benchmarks.TimeSuite.time_load_passbands

Click here to view all benchmarks.

@jeremykubica jeremykubica merged commit 55af270 into main Sep 2, 2025
9 checks passed
@jeremykubica jeremykubica deleted the simulate_refactor branch September 2, 2025 16:45
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