Skip to content

Comments

Run sorcha without forcing reading config file or forced writing results to disk#1181

Merged
Little-Ryugu merged 7 commits intodirac-institute:mainfrom
yoachim:u/yoachim/run_wo_config
Feb 11, 2026
Merged

Run sorcha without forcing reading config file or forced writing results to disk#1181
Little-Ryugu merged 7 commits intodirac-institute:mainfrom
yoachim:u/yoachim/run_wo_config

Conversation

@yoachim
Copy link
Contributor

@yoachim yoachim commented Jan 28, 2026

For cases where one has several pointing histories and several solar system body populations, it would be useful to loop over those within python and call runLSSTSimulation directly without using the command line and configuration file(s).

  • Update so sorchaConfigs is now a subclass of basesorchaConfigs, so if one wants to make a config without reading a file it is possible to with basesorchaConfigs, and sorchaConfigs behaves as before.
  • Add return_only kwargs to runLSSTSimulation and PPStats.stats so users are not forced to write output to disk in case they just want the DataFrames returned
  • Minor fixes in some other config classes so they work with both reading config files and manual instatiation.

Review Checklist for Source Code Changes

  • [ x] Does pip install still work?
  • [ x] Have you written a unit test for any new functions?
  • [ x] Do all the units tests run successfully?
  • [ x] Does Sorcha run successfully on a test set of input files/databases?
  • [ x] Have you used black on the files you have updated to confirm python programming style guide enforcement?

@yoachim yoachim requested a review from mschwamb January 28, 2026 19:27
@codecov
Copy link

codecov bot commented Jan 28, 2026

Codecov Report

❌ Patch coverage is 72.09302% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.87%. Comparing base (6db2807) to head (8867f09).
⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
src/sorcha/sorcha.py 38.88% 11 Missing ⚠️
src/sorcha/modules/PPStats.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1181      +/-   ##
==========================================
- Coverage   85.08%   84.87%   -0.22%     
==========================================
  Files          69       69              
  Lines        3534     3557      +23     
==========================================
+ Hits         3007     3019      +12     
- Misses        527      538      +11     

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

@mschwamb
Copy link
Collaborator

@yoachim The team needs to chat internally if we're happy for this to be setup for not running with config files. My worry is it's really easy to forget how you set things up if we allow this. We've also been making a lot of changes for Rubin operations so if we do agree to go this direction, this may PR may be better to be merged when we have the changes in for using real LSST pointing information.

@mschwamb
Copy link
Collaborator

Our next call is February 9th. I'll raise this then @yoachim

@yoachim
Copy link
Contributor Author

yoachim commented Jan 28, 2026

@mschwamb sounds good, no particular rush. My main pitch here is that I know astronomers love their config and csv files, but it's good practice to let python users call your python code from within python. And if code is going to run on a cluster it's important to give users control over disk I/O. If I've got 30 pointing histories and 7 solar system populations, I don't want 200+ jobs simultaneously trying to dump observations to disk (which I'm then just going to have to read back in and analyze anyway).

@yoachim yoachim force-pushed the u/yoachim/run_wo_config branch from adb1976 to d652bf6 Compare February 6, 2026 19:04
@Little-Ryugu Little-Ryugu self-requested a review February 9, 2026 11:27
Copy link
Collaborator

@Little-Ryugu Little-Ryugu left a comment

Choose a reason for hiding this comment

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

Looks nearly good to go. Just a small addition to the docstrings to help future development, and you need to run black version 26.1.0 for the linter.

@yoachim yoachim requested a review from Little-Ryugu February 11, 2026 02:40
Copy link
Collaborator

@Little-Ryugu Little-Ryugu left a comment

Choose a reason for hiding this comment

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

Looks all good to me.

@mschwamb mschwamb removed their request for review February 11, 2026 10:06
@Little-Ryugu Little-Ryugu merged commit 7e52352 into dirac-institute:main Feb 11, 2026
5 of 9 checks passed
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