Skip to content

WIP: Check engine#785

Merged
katiebreivik merged 10 commits into
COSMIC-PopSynth:developfrom
xevra:check-engine
May 29, 2026
Merged

WIP: Check engine#785
katiebreivik merged 10 commits into
COSMIC-PopSynth:developfrom
xevra:check-engine

Conversation

@xevra
Copy link
Copy Markdown
Contributor

@xevra xevra commented May 28, 2026

Added metisse args and m1-min/m2-min to argument parser for cosmic-pop.

Added commit hash to gitignore.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 76.15%. Comparing base (8772c07) to head (b37b5f1).
⚠️ Report is 159 commits behind head on develop.

Files with missing lines Patch % Lines
src/cosmic/evolve.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           develop     #785       +/-   ##
============================================
- Coverage    86.91%   76.15%   -10.75%     
============================================
  Files           40       58       +18     
  Lines        25542    28164     +2622     
  Branches         0      985      +985     
============================================
- Hits         22198    21448      -750     
- Misses        3344     6411     +3067     
- Partials         0      305      +305     

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

@xevra
Copy link
Copy Markdown
Contributor Author

xevra commented May 28, 2026

Metisse_subgroup_eta_mc Metisse_subgroup_m1m2 Metisse_subgroup_preSN_primary Metisse_subgroup_preSN_secondary Ran some of my tests. Looking good at solar metallicity!

@xevra
Copy link
Copy Markdown
Contributor Author

xevra commented May 28, 2026

Something is broken with one of the histograms, because of a binning/boundary issue, but that's not an issue with COSMIC.

@katiebreivik katiebreivik requested a review from TomWagg May 28, 2026 19:44
Comment thread bin/cosmic-pop Outdated
# Check masses
if SSEDict["stellar_engine"] == "metisse":
# Check m1_min
if args.m1_min < 0.1:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this shouldn't just be hard-coded as 0.1. I think we should either

  1. Read the minimum mass from the METISSE tracks (same as evolve.py does it)
  2. OR at least save this as a constant value at the top of the file and reference it rather than copy 0.1 in

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Roger

Comment thread .gitignore
@xevra
Copy link
Copy Markdown
Contributor Author

xevra commented May 28, 2026

Not ready for merge. Working on a new bug related to the IMF that popped up when I made these changes.

@xevra
Copy link
Copy Markdown
Contributor Author

xevra commented May 28, 2026

This is the error:

cosmic-pop --metallicity 0.02 --inifile Params_Metisse.ini --final-kstar1 14 --final-kstar2 14 --seed 27 --nproc 8 --Niter 2000000 --Nstep 10000 --match -3.0
/Users/xevra/miniconda3/envs/basil/bin/cosmic-pop:243: UserWarning: You are overriding the inifile value of match=-5.0 with match=-3.0 from the commandline
  warnings.warn("You are overriding the inifile value of {0}={1} "
/Users/xevra/miniconda3/envs/basil/bin/cosmic-pop:261: UserWarning: You are overriding the inifile value of seed=42 with seed=27 from the commandline
  warnings.warn("You are overriding the inifile value of {0}={1} "
/Users/xevra/miniconda3/envs/basil/bin/cosmic-pop:339: UserWarning: You have specified both qmin and m2_min. COSMIC will use qmin=0 to determine the secondary masses in the initial sample.
  warnings.warn(f"You have specified both qmin and m2_min. COSMIC will use qmin={args.qmin} to "
Traceback (most recent call last):
  File "/Users/xevra/miniconda3/envs/basil/bin/cosmic-pop", line 377, in <module>
    init_samp_list = InitialBinaryTable.sampler(format_ = sampling['sampling_method'],
                                                final_kstar1 = kstar1_range,
    ...<12 lines>...
                                                params = args.inifile,
                                                SSEDict = SSEDict)
  File "/Users/xevra/miniconda3/envs/basil/lib/python3.13/site-packages/cosmic/sample/initialbinarytable.py", line 251, in sampler
    return sampler(*args, **kwargs)
  File "/Users/xevra/miniconda3/envs/basil/lib/python3.13/site-packages/cosmic/sample/sampler/independent.py", line 225, in get_independent_sampler
    return _independent_sampler_worker(
        final_kstar1, final_kstar2, primary_model, ecc_model, porb_model, SF_start, SF_duration,
        binfrac_model, met, SSEDict=SSEDict, size=size, total_mass=total_mass, sampling_target=sampling_target,
        trim_extra_samples=trim_extra_samples, q_power_law=q_power_law, kwargs=kwargs
    )
  File "/Users/xevra/miniconda3/envs/basil/lib/python3.13/site-packages/cosmic/sample/sampler/independent.py", line 327, in _independent_sampler_worker
    mass2_binaries = initconditions.sample_secondary(mass1_binaries, q_power_law=q_power_law, **kwargs)
  File "/Users/xevra/miniconda3/envs/basil/lib/python3.13/site-packages/cosmic/sample/sampler/independent.py", line 624, in sample_secondary
    raise ValueError("The m2_min you specified is above the minimum"
                     " primary mass of the IMF, either lower m2_min or"
                     " raise the lower value of your sampled primaries")
ValueError: The m2_min you specified is above the minimum primary mass of the IMF, either lower m2_min or raise the lower value of your sampled primaries
Exception ignored in: <function Pool.__del__ at 0x104f262a0>
Traceback (most recent call last):
  File "/Users/xevra/miniconda3/envs/basil/lib/python3.13/site-packages/multiprocess/pool.py", line 271, in __del__
  File "/Users/xevra/miniconda3/envs/basil/lib/python3.13/site-packages/multiprocess/queues.py", line 391, in put
AttributeError: 'NoneType' object has no attribute 'dumps'

I'm looking into it.

@xevra
Copy link
Copy Markdown
Contributor Author

xevra commented May 28, 2026

cosmic-pop runs now!

@xevra
Copy link
Copy Markdown
Contributor Author

xevra commented May 28, 2026

Metisse_subgroup_m1m2

@xevra
Copy link
Copy Markdown
Contributor Author

xevra commented May 28, 2026

Ready for review! @TomWagg

Copy link
Copy Markdown
Collaborator

@TomWagg TomWagg left a comment

Choose a reason for hiding this comment

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

Looks good!

@katiebreivik katiebreivik merged commit ce9fc3f into COSMIC-PopSynth:develop May 29, 2026
4 of 6 checks passed
katiebreivik added a commit to katiebreivik/COSMIC that referenced this pull request May 29, 2026
* cosmic-pop progress

* working

* Tested combinations of qmin and m1_min for just argument parsing only

* Fixed hasattr check

* hotfix for multiprocessing in cosmic-pop

* Working on minimum mass

* Fixed it! Thanks Katie!

---------

Co-authored-by: Vera <vdfavero@cita.utoronto.ca>
Co-authored-by: Katie Breivik <kbreivik@andrew.cmu.edu>
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