cosmic-popsynth 3.6.1__tar.gz → 3.7.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/.github/workflows/build_wheels_and_publish.yml +21 -26
- cosmic_popsynth-3.7.0/.github/workflows/cmc-review.yml +165 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/.github/workflows/python-package.yml +5 -8
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/.gitignore +4 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/PKG-INFO +2 -3
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/bin/cosmic-pop +9 -14
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/changelog.md +15 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/docs/Makefile +1 -0
- cosmic_popsynth-3.7.0/docs/_generated/README.md +2 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/docs/conf.py +9 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/docs/create_params_ini.py +1 -1
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/docs/create_settings_html.py +2 -2
- cosmic_popsynth-3.7.0/docs/generate_default_bsedict.py +77 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/docs/pages/develop/adding-options.rst +1 -1
- cosmic_popsynth-3.7.0/docs/pages/evolve/evolve_sample.rst +48 -0
- cosmic_popsynth-3.7.0/docs/pages/evolve/grid.rst +43 -0
- cosmic_popsynth-3.7.0/docs/pages/evolve/interface.rst +327 -0
- cosmic_popsynth-3.7.0/docs/pages/evolve/multiple.rst +73 -0
- cosmic_popsynth-3.7.0/docs/pages/evolve/rerun.rst +133 -0
- cosmic_popsynth-3.7.0/docs/pages/evolve/resolution.rst +97 -0
- cosmic_popsynth-3.7.0/docs/pages/evolve/restart.rst +109 -0
- cosmic_popsynth-3.7.0/docs/pages/evolve/single.rst +175 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/docs/pages/examples.rst +2 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/docs/pages/inifile.rst +10 -6
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/docs/pages/output_info.rst +1 -1
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/docs/pages/sample/independent.rst +165 -25
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/docs/pages/sample/multidim.rst +5 -6
- cosmic_popsynth-3.7.0/examples/Params.ini +882 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/meson.build +10 -7
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/pyproject.toml +4 -4
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/requirements.txt +1 -2
- cosmic_popsynth-3.7.0/src/cosmic/_version.py +1 -0
- cosmic_popsynth-3.7.0/src/cosmic/data/__init__.py +0 -0
- {cosmic_popsynth-3.6.1/docs → cosmic_popsynth-3.7.0/src/cosmic/data}/cosmic-settings.json +180 -31
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/evolve.py +77 -43
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/meson.build +7 -1
- cosmic_popsynth-3.7.0/src/cosmic/output.py +466 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/plotting.py +0 -3
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/sample/initialbinarytable.py +13 -16
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/sample/initialcmctable.py +1 -1
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/sample/sampler/cmc.py +5 -5
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/sample/sampler/independent.py +75 -18
- cosmic_popsynth-3.7.0/src/cosmic/src/assign_remnant.f +673 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/bpp_array.f +48 -41
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/comenv.f +86 -68
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/comprad.f +10 -1
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/const_bse.h +11 -7
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/evolv1.f +1 -1
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/evolv2.f +157 -99
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/hrdiag.f +47 -5
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/kick.f +23 -6
- cosmic_popsynth-3.7.0/src/cosmic/src/ran3.f +88 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/tests/data/Params.ini +6 -0
- cosmic_popsynth-3.7.0/src/cosmic/tests/data/initial_conditions_for_testing.hdf5 +0 -0
- cosmic_popsynth-3.7.0/src/cosmic/tests/data/kick_initial_conditions.h5 +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/tests/data/unit_tests_results.hdf5 +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/tests/test_kick.py +1 -1
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/tests/test_sample.py +26 -5
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/tests/test_utils.py +3 -1
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/utils.py +155 -481
- cosmic_popsynth-3.6.1/docs/pages/config/README.md +0 -3
- cosmic_popsynth-3.6.1/docs/pages/config/config_insert_bse.html +0 -933
- cosmic_popsynth-3.6.1/docs/pages/config/config_insert_convergence.html +0 -78
- cosmic_popsynth-3.6.1/docs/pages/config/config_insert_filters.html +0 -36
- cosmic_popsynth-3.6.1/docs/pages/config/config_insert_rand_seed.html +0 -22
- cosmic_popsynth-3.6.1/docs/pages/config/config_insert_sampling.html +0 -148
- cosmic_popsynth-3.6.1/docs/pages/evolve/evolve_sample.rst +0 -47
- cosmic_popsynth-3.6.1/docs/pages/evolve/grid.rst +0 -54
- cosmic_popsynth-3.6.1/docs/pages/evolve/multiple.rst +0 -74
- cosmic_popsynth-3.6.1/docs/pages/evolve/resolution.rst +0 -85
- cosmic_popsynth-3.6.1/docs/pages/evolve/restart.rst +0 -78
- cosmic_popsynth-3.6.1/docs/pages/evolve/single.rst +0 -148
- cosmic_popsynth-3.6.1/examples/Params.ini +0 -564
- cosmic_popsynth-3.6.1/src/cosmic/_version.py +0 -1
- cosmic_popsynth-3.6.1/src/cosmic/src/assign_remnant.f +0 -386
- cosmic_popsynth-3.6.1/src/cosmic/src/ran3.f +0 -44
- cosmic_popsynth-3.6.1/src/cosmic/tests/data/initial_conditions_for_testing.hdf5 +0 -0
- cosmic_popsynth-3.6.1/src/cosmic/tests/data/kick_initial_conditions.h5 +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/.codecov.yml +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/.gitattributes +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/.github/ISSUE_TEMPLATE/general_issue.md +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/.github/ISSUE_TEMPLATE/unexpected-stellar-evolutionary-behavior.md +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/.github/workflows/deploy-github-pages.yml +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/.github/workflows/github_registory.yml +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/.readthedocs.yml +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/.vscode/launch.json +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/.vscode/tasks.json +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/Dockerfile +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/LICENSE +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/MANIFEST.in +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/README.md +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/ci/compile_benchmark.sh +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/ci/run-tests.sh +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/debug/create_binary_in.py +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/docs/_static/bootstrap-grid.min.css +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/docs/_static/cosmic-docs.css +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/docs/_static/custom.js +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/docs/_static/settings.js +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/docs/_templates/layout.html +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/docs/data/dat_DeltaBurst_13_14_13_14.h5 +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/docs/data/qcrit_table.csv +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/docs/index.rst +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/docs/pages/about.rst +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/docs/pages/cite.rst +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/docs/pages/develop/debugging-vscode.rst +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/docs/pages/develop/how-it-works.rst +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/docs/pages/develop/new-settings.rst +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/docs/pages/develop/option-schema.csv +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/docs/pages/develop/setting-schema.csv +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/docs/pages/develop/settings-json-file.rst +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/docs/pages/developers.rst +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/docs/pages/fixedpop.rst +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/docs/pages/install.rst +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/docs/pages/reference_material.rst +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/docs/pages/runpop.rst +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/docs/pages/sample/cluster.rst +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/examples/CMC_Params.ini +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/Match.py +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/__init__.py +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/bse_utils/__init__.py +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/bse_utils/meson.build +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/bse_utils/zcnsts.py +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/bse_utils/zdata.py +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/checkstate.py +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/filter.py +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/get_commit_hash.py +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/sample/__init__.py +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/sample/cmc/__init__.py +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/sample/cmc/elson.py +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/sample/cmc/king.py +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/sample/cmc/meson.build +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/sample/meson.build +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/sample/sampler/__init__.py +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/sample/sampler/meson.build +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/sample/sampler/multidim.py +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/sample/sampler/sampler.py +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/Makefile +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/benchmarkevolv2.f +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/bse.f +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/checkstate.f +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/checkstate.h +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/concatkstars.f +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/corerd.f +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/deltat.f +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/dgcore.f +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/gntage.f +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/hrdiag_remnant.f +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/instar.f +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/int64.f +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/int64.h +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/int64.h.in +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/mix.f +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/mlwind.f +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/mrenv.f +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/rl.f +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/sse.f +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/star.f +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/taus113-ran3.f +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/taus113tester.f +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/tausworth.f +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/tausworth.h +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/test_bse.f +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/zcnsts.f +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/zdata.h +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/src/zfuncs.f +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/tests/data/GW_dat.h5 +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/tests/data/Kroupa93.npy +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/tests/data/bpp_array_ind_sampling.npy +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/tests/data/cmc_elson_test.npz +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/tests/data/cmc_king_test.npz +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/tests/data/cmc_plummer_test.npz +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/tests/data/dat_ThinDisk_10_12_10_12.h5 +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/tests/data/dat_ThinDisk_11_11_3.h5 +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/tests/data/init_conditions_ind_sampling.npy +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/tests/data/input_cmc.fits +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/tests/data/input_cmc.hdf5 +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/tests/data/unit_test_results.hdf5 +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/tests/data/utils_test.hdf +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/tests/meson.build +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/tests/test_evolve.py +0 -0
- {cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/src/cosmic/tests/test_match.py +0 -0
{cosmic_popsynth-3.6.1 → cosmic_popsynth-3.7.0}/.github/workflows/build_wheels_and_publish.yml
RENAMED
|
@@ -6,79 +6,74 @@ on:
|
|
|
6
6
|
workflow_dispatch:
|
|
7
7
|
|
|
8
8
|
env:
|
|
9
|
-
CIBW_BUILD: "
|
|
9
|
+
CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-*"
|
|
10
10
|
CIBW_ARCHS_LINUX: "x86_64"
|
|
11
11
|
CIBW_SKIP: "*-win32 *musllinux*"
|
|
12
12
|
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
|
|
13
13
|
CIBW_BEFORE_BUILD: pip install numpy --config-settings=setup-args="-Dallow-noblas=true"
|
|
14
14
|
CIBW_BUILD_VERBOSITY: "1"
|
|
15
|
+
CIBW_BEFORE_ALL_LINUX: yum install -y gcc-gfortran
|
|
16
|
+
CIBW_ENVIRONMENT_LINUX: "FC=gfortran F77=gfortran"
|
|
17
|
+
CIBW_ENVIRONMENT_MACOS: "FC=gfortran F77=gfortran MACOSX_DEPLOYMENT_TARGET=14.0"
|
|
15
18
|
|
|
16
19
|
jobs:
|
|
17
20
|
build-wheels-and-dist:
|
|
18
|
-
name: Build
|
|
21
|
+
name: Build wheels on ${{ matrix.os }}
|
|
19
22
|
runs-on: ${{ matrix.os }}
|
|
20
23
|
strategy:
|
|
21
24
|
matrix:
|
|
22
|
-
os: [ubuntu-latest, macos-
|
|
23
|
-
python-version: [3.9, "3.10", "3.11", "3.12"]
|
|
25
|
+
os: [ubuntu-latest, macos-14]
|
|
24
26
|
|
|
25
27
|
steps:
|
|
26
28
|
- uses: actions/checkout@v4
|
|
27
29
|
with:
|
|
28
30
|
fetch-depth: 0
|
|
31
|
+
|
|
32
|
+
# this step only uses a single python version since cibuildwheel
|
|
33
|
+
# builds multiple versions in one go on linux
|
|
29
34
|
- uses: actions/setup-python@v5
|
|
30
35
|
name: Install Python
|
|
31
36
|
with:
|
|
32
|
-
python-version: "3.
|
|
37
|
+
python-version: "3.12"
|
|
33
38
|
|
|
34
|
-
- name:
|
|
39
|
+
- name: Install hdf5 (macOS)
|
|
35
40
|
if: runner.os == 'macOS'
|
|
36
41
|
run: |
|
|
37
|
-
|
|
38
|
-
brew reinstall hdf5
|
|
42
|
+
brew install hdf5
|
|
39
43
|
|
|
40
44
|
- name: Install numpy
|
|
41
45
|
run: |
|
|
42
46
|
python -m pip install --upgrade pip
|
|
43
|
-
python -m pip install numpy h5py versioneer
|
|
47
|
+
python -m pip install numpy h5py versioneer
|
|
44
48
|
|
|
45
49
|
- name: Install dependencies
|
|
46
50
|
run: |
|
|
47
51
|
python -m pip install setuptools wheel build meson-python ninja meson pytest cibuildwheel
|
|
48
52
|
|
|
49
|
-
- name:
|
|
53
|
+
- name: Set up Fortran (macOS)
|
|
50
54
|
if: runner.os == 'macOS'
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
uses: fortran-lang/setup-fortran@v1
|
|
56
|
+
with:
|
|
57
|
+
compiler: gcc
|
|
58
|
+
version: '13'
|
|
55
59
|
|
|
56
60
|
- name: Build source and wheels distribution on Linux
|
|
57
|
-
if: runner.os == 'Linux'
|
|
58
61
|
run: |
|
|
59
62
|
python -m build --sdist --outdir dist
|
|
60
63
|
python -m cibuildwheel --output-dir dist
|
|
61
64
|
|
|
62
65
|
- uses: actions/upload-artifact@v4
|
|
63
66
|
with:
|
|
64
|
-
name: dist-${{ matrix.os }}
|
|
67
|
+
name: dist-${{ matrix.os }}
|
|
65
68
|
path: ./dist/*
|
|
66
69
|
|
|
67
70
|
publish:
|
|
68
71
|
needs: [build-wheels-and-dist]
|
|
69
|
-
name: Publish Python 🐍 distributions 📦 to PyPI
|
|
70
|
-
runs-on:
|
|
71
|
-
strategy:
|
|
72
|
-
matrix:
|
|
73
|
-
os: [ubuntu-latest]
|
|
74
|
-
python-version: ["3.10"]
|
|
72
|
+
name: Publish Python 🐍 distributions 📦 to PyPI
|
|
73
|
+
runs-on: ubuntu-latest
|
|
75
74
|
|
|
76
75
|
steps:
|
|
77
76
|
- uses: actions/checkout@v4
|
|
78
|
-
- name: Set up Python ${{ matrix.python-version }}
|
|
79
|
-
uses: actions/setup-python@v5
|
|
80
|
-
with:
|
|
81
|
-
python-version: ${{ matrix.python-version }}
|
|
82
77
|
|
|
83
78
|
- name: Download artifacts
|
|
84
79
|
uses: actions/download-artifact@v4
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
name: Flag CMC review for cosmic changes
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request_target:
|
|
5
|
+
types: [opened]
|
|
6
|
+
paths:
|
|
7
|
+
- 'src/cosmic/evolve.py'
|
|
8
|
+
- 'src/cosmic/data/cosmic-settings.json'
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
pull-requests: write
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
flag-cmc-review:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- name: decide whether to flag PR
|
|
20
|
+
id: decide
|
|
21
|
+
uses: actions/github-script@v7
|
|
22
|
+
with:
|
|
23
|
+
script: |
|
|
24
|
+
const owner = context.repo.owner;
|
|
25
|
+
const repo = context.repo.repo;
|
|
26
|
+
const pull_number = context.payload.pull_request.number;
|
|
27
|
+
|
|
28
|
+
const SETTINGS_PATH = 'src/cosmic/data/cosmic-settings.json';
|
|
29
|
+
|
|
30
|
+
// helper: fetch file content at a specific ref (sha/branch)
|
|
31
|
+
async function fetchText(path, ref) {
|
|
32
|
+
const res = await github.rest.repos.getContent({ owner, repo, path, ref });
|
|
33
|
+
if (Array.isArray(res.data) || !res.data.content) {
|
|
34
|
+
throw new Error(`unexpected content response for ${path} at ${ref}`);
|
|
35
|
+
}
|
|
36
|
+
const buff = Buffer.from(res.data.content, res.data.encoding || 'base64');
|
|
37
|
+
return buff.toString('utf8');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// helper: count keys on the object with category === "bse"
|
|
41
|
+
// json is expected to be an array: [{category: "blah", ...}, {category: "bse", ...}]
|
|
42
|
+
// counts top-level keys excluding "category"
|
|
43
|
+
function bseKeyCount(jsonVal) {
|
|
44
|
+
if (!Array.isArray(jsonVal)) return 0;
|
|
45
|
+
|
|
46
|
+
const bseObj = jsonVal.find(
|
|
47
|
+
(x) => x && typeof x === 'object' && !Array.isArray(x) && x.category === 'bse'
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
if (!bseObj) return 0;
|
|
51
|
+
|
|
52
|
+
return Object.keys(bseObj).filter((k) => k === 'settings').length;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// list changed files in the PR
|
|
56
|
+
const files = await github.paginate(github.rest.pulls.listFiles, {
|
|
57
|
+
owner,
|
|
58
|
+
repo,
|
|
59
|
+
pull_number,
|
|
60
|
+
per_page: 100,
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
const changed = new Set(files.map(f => f.filename));
|
|
64
|
+
const changedEvolve = changed.has('src/cosmic/evolve.py');
|
|
65
|
+
const changedSettings = changed.has(SETTINGS_PATH);
|
|
66
|
+
|
|
67
|
+
let shouldFlag = false;
|
|
68
|
+
let reason = '';
|
|
69
|
+
|
|
70
|
+
// if evolve changed, always flag
|
|
71
|
+
if (changedEvolve) {
|
|
72
|
+
shouldFlag = true;
|
|
73
|
+
reason = 'evolve file changed, probably needs CMC review';
|
|
74
|
+
} else if (changedSettings) {
|
|
75
|
+
// only flag if bse key-count changes between base and head
|
|
76
|
+
const baseSha = context.payload.pull_request.base.sha;
|
|
77
|
+
const headSha = context.payload.pull_request.head.sha;
|
|
78
|
+
|
|
79
|
+
try {
|
|
80
|
+
const baseText = await fetchText(SETTINGS_PATH, baseSha);
|
|
81
|
+
const headText = await fetchText(SETTINGS_PATH, headSha);
|
|
82
|
+
|
|
83
|
+
const baseJson = JSON.parse(baseText);
|
|
84
|
+
const headJson = JSON.parse(headText);
|
|
85
|
+
|
|
86
|
+
const baseCount = bseKeyCount(baseJson);
|
|
87
|
+
const headCount = bseKeyCount(headJson);
|
|
88
|
+
|
|
89
|
+
if (baseCount !== headCount) {
|
|
90
|
+
shouldFlag = true;
|
|
91
|
+
reason = `bse key count changed (${baseCount} -> ${headCount})`;
|
|
92
|
+
} else {
|
|
93
|
+
shouldFlag = false;
|
|
94
|
+
reason = `bse key count unchanged (${baseCount})`;
|
|
95
|
+
}
|
|
96
|
+
} catch (err) {
|
|
97
|
+
// if parsing/fetching fails, be conservative and flag
|
|
98
|
+
shouldFlag = true;
|
|
99
|
+
reason = `could not compare bse key count safely (${err.message}); flagging for review`;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
core.setOutput('should_flag', shouldFlag ? 'true' : 'false');
|
|
104
|
+
core.setOutput('reason', reason);
|
|
105
|
+
|
|
106
|
+
- name: add "needs-cmc-review" label
|
|
107
|
+
if: steps.decide.outputs.should_flag == 'true'
|
|
108
|
+
uses: actions/github-script@v7
|
|
109
|
+
with:
|
|
110
|
+
script: |
|
|
111
|
+
const labelName = 'needs-cmc-review';
|
|
112
|
+
|
|
113
|
+
// ensure the label exists, or create it
|
|
114
|
+
try {
|
|
115
|
+
await github.rest.issues.getLabel({
|
|
116
|
+
owner: context.repo.owner,
|
|
117
|
+
repo: context.repo.repo,
|
|
118
|
+
name: labelName,
|
|
119
|
+
});
|
|
120
|
+
} catch (error) {
|
|
121
|
+
if (error.status === 404) {
|
|
122
|
+
await github.rest.issues.createLabel({
|
|
123
|
+
owner: context.repo.owner,
|
|
124
|
+
repo: context.repo.repo,
|
|
125
|
+
name: labelName,
|
|
126
|
+
color: 'fbca04',
|
|
127
|
+
description: 'PR touches cosmic core/settings and needs CMC review',
|
|
128
|
+
});
|
|
129
|
+
} else {
|
|
130
|
+
throw error;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
await github.rest.issues.addLabels({
|
|
135
|
+
owner: context.repo.owner,
|
|
136
|
+
repo: context.repo.repo,
|
|
137
|
+
issue_number: context.issue.number,
|
|
138
|
+
labels: [labelName],
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
- name: comment to request CMC review
|
|
142
|
+
if: steps.decide.outputs.should_flag == 'true'
|
|
143
|
+
uses: actions/github-script@v7
|
|
144
|
+
with:
|
|
145
|
+
script: |
|
|
146
|
+
const reason = `${{ toJSON(steps.decide.outputs.reason) }}`.replace(/^"|"$/g, '');
|
|
147
|
+
|
|
148
|
+
const body = `
|
|
149
|
+
🚨 **CMC review requested**
|
|
150
|
+
|
|
151
|
+
This pull request modifies one or more of:
|
|
152
|
+
- \`src/cosmic/evolve.py\`
|
|
153
|
+
- \`src/cosmic/data/cosmic-settings.json\` (only flagged when \`category: "bse"\` key-count changes)
|
|
154
|
+
|
|
155
|
+
**Trigger:** ${reason}
|
|
156
|
+
|
|
157
|
+
A CMC developer should review this PR to ensure corresponding changes are propagated upstream as needed.
|
|
158
|
+
`;
|
|
159
|
+
|
|
160
|
+
await github.rest.issues.createComment({
|
|
161
|
+
owner: context.repo.owner,
|
|
162
|
+
repo: context.repo.repo,
|
|
163
|
+
issue_number: context.issue.number,
|
|
164
|
+
body,
|
|
165
|
+
});
|
|
@@ -12,7 +12,7 @@ jobs:
|
|
|
12
12
|
strategy:
|
|
13
13
|
fail-fast: false
|
|
14
14
|
matrix:
|
|
15
|
-
python-version: ['3.
|
|
15
|
+
python-version: ['3.10', '3.11', '3.12', '3.13']
|
|
16
16
|
|
|
17
17
|
steps:
|
|
18
18
|
- uses: actions/checkout@v4
|
|
@@ -32,19 +32,16 @@ jobs:
|
|
|
32
32
|
${{ runner.os }}-
|
|
33
33
|
- name: Install dependencies and package
|
|
34
34
|
run: |
|
|
35
|
+
# upgrade apt-get and install system dependencies
|
|
35
36
|
sudo apt-get update
|
|
36
37
|
sudo apt-get install gfortran swig libhdf5-serial-dev meson python3-dev
|
|
38
|
+
|
|
39
|
+
# upgrade pip and install dependencies
|
|
40
|
+
python -m pip install -U pip setuptools wheel packaging flake8
|
|
37
41
|
pip install numpy ninja pytest
|
|
38
42
|
pip install -r requirements.txt
|
|
39
43
|
python -m pip install .
|
|
40
44
|
|
|
41
|
-
- name: Lint with flake8
|
|
42
|
-
run: |
|
|
43
|
-
# stop the build if there are Python syntax errors or undefined names
|
|
44
|
-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude docs
|
|
45
|
-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
|
46
|
-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude docs,versioneer.py,cosmic/_version.py,cosmic/tests,cosmic/*/__init__.py
|
|
47
|
-
|
|
48
45
|
- name: Test with pytest
|
|
49
46
|
run: |
|
|
50
47
|
bash ci/compile_benchmark.sh
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cosmic-popsynth
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.7.0
|
|
4
4
|
Summary: a Python-interfaced binary population synthesis suite
|
|
5
5
|
Author: Scott Coughlin, Michael Zevin, Carl L. Rodriguez, Tom Wagg
|
|
6
6
|
Author-Email: Katelyn Breivik <katie.breivik@gmail.com>
|
|
@@ -11,7 +11,7 @@ Classifier: Intended Audience :: Science/Research
|
|
|
11
11
|
Classifier: License :: OSI Approved :: MIT License
|
|
12
12
|
Classifier: Operating System :: OS Independent
|
|
13
13
|
Classifier: Programming Language :: Python
|
|
14
|
-
Requires-Python: >=3.
|
|
14
|
+
Requires-Python: >=3.10
|
|
15
15
|
Requires-Dist: numpy
|
|
16
16
|
Requires-Dist: scipy
|
|
17
17
|
Requires-Dist: astropy
|
|
@@ -22,7 +22,6 @@ Requires-Dist: tables
|
|
|
22
22
|
Requires-Dist: h5py
|
|
23
23
|
Requires-Dist: schwimmbad
|
|
24
24
|
Requires-Dist: matplotlib
|
|
25
|
-
Requires-Dist: importlib-metadata
|
|
26
25
|
Description-Content-Type: text/markdown
|
|
27
26
|
|
|
28
27
|
# COSMIC
|
|
@@ -22,10 +22,12 @@ import numpy as np
|
|
|
22
22
|
import pandas as pd
|
|
23
23
|
from pandas.errors import PerformanceWarning
|
|
24
24
|
import warnings
|
|
25
|
+
import h5py as h5
|
|
25
26
|
|
|
26
27
|
from cosmic.sample.initialbinarytable import InitialBinaryTable
|
|
27
28
|
from cosmic import Match, utils
|
|
28
29
|
from cosmic.evolve import Evolve
|
|
30
|
+
from cosmic._version import __version__
|
|
29
31
|
|
|
30
32
|
from schwimmbad import MPIPool
|
|
31
33
|
from os import sys
|
|
@@ -105,9 +107,9 @@ def parse_commandline():
|
|
|
105
107
|
parser.add_argument("--binary_state", nargs='+', type=int)
|
|
106
108
|
parser.add_argument("--sampling_method")
|
|
107
109
|
parser.add_argument("--primary_model", help="Chooses the initial primary mass function from: salpeter55, kroupa93, kroupa01", type=str)
|
|
108
|
-
parser.add_argument("--binfrac_model", help="Chooses the binary fraction model from: a float between [0,1], vanHaaften, and
|
|
110
|
+
parser.add_argument("--binfrac_model", help="Chooses the binary fraction model from: a float between [0,1], vanHaaften, and offner23", type=binfrac_type)
|
|
109
111
|
parser.add_argument("--ecc_model", help="Chooses the initial eccentricity distribution model from: thermal, uniform, and sana12", type=str)
|
|
110
|
-
parser.add_argument("--porb_model", help="Chooses the initial orbital period distribution model from: log_uniform and
|
|
112
|
+
parser.add_argument("--porb_model", help="Chooses the initial orbital period distribution model from: log_uniform, sana12, renzo19, raghavan10, moe19, and martinez26", type=str)
|
|
111
113
|
parser.add_argument("--SF_start", help="Sets the time in the past when star formation initiates in Myr", type=float)
|
|
112
114
|
parser.add_argument("--SF_duration", help="Sets the duration of constant star formation in Myr", type=float)
|
|
113
115
|
parser.add_argument("--metallicity", type=float)
|
|
@@ -266,18 +268,11 @@ if __name__ == '__main__':
|
|
|
266
268
|
idx = 0
|
|
267
269
|
log_file = open('log_kstar1_{0}_kstar2_{1}_SFstart_{2}_SFduration_{3}_metallicity_{4}.txt'.format(kstar1_range_string, kstar2_range_string, sampling['SF_start'], sampling['SF_duration'], sampling['metallicity']), 'w')
|
|
268
270
|
|
|
269
|
-
# save configuration settings to output file
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
warnings.simplefilter(action="ignore", category=PerformanceWarning)
|
|
275
|
-
|
|
276
|
-
with pd.HDFStore(dat_store_fname,complib=args.complib,complevel=args.complevel) as dat_store:
|
|
277
|
-
for k, v in configuration_settings.items():
|
|
278
|
-
for k1, v1 in v.items():
|
|
279
|
-
dat_store.put('config/{0}/{1}/'.format(k, k1), pd.Series(v1))
|
|
280
|
-
dat_store.put('config/rand_seed/', pd.Series(seed_int))
|
|
271
|
+
# save configuration settings and COSMIC version to output file
|
|
272
|
+
with h5.File(dat_store_fname, 'a') as f:
|
|
273
|
+
f["config"] = json.dumps({'BSEDict' : BSEDict, 'filters' : filters, 'convergence' : convergence,
|
|
274
|
+
'sampling' : sampling, 'rand_seed': seed_int})
|
|
275
|
+
f.attrs['COSMIC_version'] = __version__
|
|
281
276
|
|
|
282
277
|
# Initialize the step counter and convergence array/list
|
|
283
278
|
Nstep = idx - np.mod(idx, args.Nstep)
|
|
@@ -55,3 +55,18 @@ See the discussed changes in our previous releases here: https://github.com/COSM
|
|
|
55
55
|
## 3.6.1
|
|
56
56
|
- Add support for single stars in both independent and multidim sampling
|
|
57
57
|
- update documentation
|
|
58
|
+
|
|
59
|
+
## 3.6.2
|
|
60
|
+
- Add functions to `cosmic.utils` for initC IO that's more efficient (`save_initC`, `load_initC`) by saving
|
|
61
|
+
identical setting columns separately with only one copy - saves ~1kb per binary
|
|
62
|
+
- Make He and CO core masses available in output
|
|
63
|
+
- Change defaults; `qcflag=5` and `eccfac=10`
|
|
64
|
+
- Prevent users from supplying both `qmin` and `m2_min`
|
|
65
|
+
- Prevent users from supplying both `sep` and `porb` when sampling, calculate `porb` from `sep` as necessary
|
|
66
|
+
- Define `binstate=-1` as single stars
|
|
67
|
+
|
|
68
|
+
## 3.7.0
|
|
69
|
+
- Add `remnantflag=5`: The Mandel & Muller 2020 prescription for remnant masses
|
|
70
|
+
- Add `kickflag=6`: The Mandel & Muller 2020 prescription for natal kicks. This can be tuned with `mm_mu_ns` and `mm_mu_bh`
|
|
71
|
+
- Add `remnantflag=6`: The Maltsev+25 and Willcox+25 prescription for remnant masses. This can be tuned with `maltsev_mode` and `maltsev_fallback`
|
|
72
|
+
- (Docs) Any tutorial that uses a plain BSEDict now uses one that is drawn from the cosmic-settings.json file to avoid missing changes and saves us updating each docs page
|
|
@@ -15,6 +15,9 @@
|
|
|
15
15
|
import sys
|
|
16
16
|
import os
|
|
17
17
|
import re
|
|
18
|
+
from pathlib import Path
|
|
19
|
+
|
|
20
|
+
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
|
18
21
|
|
|
19
22
|
from cosmic import __version__ as cosmic_version
|
|
20
23
|
|
|
@@ -144,6 +147,12 @@ pygments_style = 'monokai'
|
|
|
144
147
|
# If true, `todo` and `todoList` produce output, else they produce nothing.
|
|
145
148
|
todo_include_todos = False
|
|
146
149
|
|
|
150
|
+
# this runs before each plot directive
|
|
151
|
+
plot_pre_code = """
|
|
152
|
+
from generate_default_bsedict import get_default_BSE_settings
|
|
153
|
+
default_BSEDict = get_default_BSE_settings(to_python=True)
|
|
154
|
+
"""
|
|
155
|
+
|
|
147
156
|
|
|
148
157
|
# -- Options for HTML output ----------------------------------------------
|
|
149
158
|
|
|
@@ -99,7 +99,7 @@ def construct_ini_from_json(config, include_comments=True):
|
|
|
99
99
|
|
|
100
100
|
def main():
|
|
101
101
|
# read the config file
|
|
102
|
-
with open("cosmic-settings.json") as f:
|
|
102
|
+
with open("../src/cosmic/data/cosmic-settings.json") as f:
|
|
103
103
|
config = json.load(f)
|
|
104
104
|
|
|
105
105
|
# convert it to an INI file, replace HTML tags and save the output
|
|
@@ -46,7 +46,7 @@ settings_template = """<div class="setting">
|
|
|
46
46
|
option_template = """<li><code class="docutils literal notranslate"><span class="pre opt-val"></span></code>: <span class="opt-desc"></span></li>"""
|
|
47
47
|
|
|
48
48
|
# read the settings file
|
|
49
|
-
with open("cosmic-settings.json") as f:
|
|
49
|
+
with open("../src/cosmic/data/cosmic-settings.json") as f:
|
|
50
50
|
settings = json.load(f)
|
|
51
51
|
|
|
52
52
|
# go through each major settings group
|
|
@@ -198,5 +198,5 @@ for group in settings:
|
|
|
198
198
|
soup.select_one(".container-fluid").append(new_group)
|
|
199
199
|
|
|
200
200
|
# write the soup out to an HTML file for this category
|
|
201
|
-
with open(f"
|
|
201
|
+
with open(f"_generated/config_insert_{group['category']}.html", "w") as f:
|
|
202
202
|
f.write(str(soup))
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
|
+
def get_default_BSE_settings(to_python=False):
|
|
5
|
+
"""Get a copy of the default BSE settings from the COSMIC settings JSON file"""
|
|
6
|
+
json_path = (
|
|
7
|
+
Path(__file__).resolve().parent.parent
|
|
8
|
+
/ "src"
|
|
9
|
+
/ "cosmic"
|
|
10
|
+
/ "data"
|
|
11
|
+
/ "cosmic-settings.json"
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
with json_path.open(encoding="utf-8") as f:
|
|
15
|
+
cosmic_settings = json.load(f)
|
|
16
|
+
|
|
17
|
+
defaults = {}
|
|
18
|
+
# loop through settings to find bse
|
|
19
|
+
for cat in cosmic_settings:
|
|
20
|
+
if cat["category"] != "bse":
|
|
21
|
+
continue
|
|
22
|
+
|
|
23
|
+
# go through each setting, finding the default option
|
|
24
|
+
for setting in cat["settings"]:
|
|
25
|
+
for option in setting["options"]:
|
|
26
|
+
if option.get("default", False):
|
|
27
|
+
defaults[setting["name"]] = option["name"]
|
|
28
|
+
|
|
29
|
+
if to_python:
|
|
30
|
+
# ensure array settings are converted from strings to lists
|
|
31
|
+
for setting in ["qcrit_array", "natal_kick_array", "fprimc_array"]:
|
|
32
|
+
# this one requires special handling because of the fractions
|
|
33
|
+
if setting == "fprimc_array":
|
|
34
|
+
parts = defaults[setting].strip("[]").split(",")
|
|
35
|
+
defaults[setting] = [float(p.split("/")[0]) / float(p.split("/")[1]) for p in parts]
|
|
36
|
+
else:
|
|
37
|
+
defaults[setting] = json.loads(defaults[setting])
|
|
38
|
+
|
|
39
|
+
return defaults
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def generate_rst_bsedict(MAX_LINE_LENGTH=80):
|
|
43
|
+
"""Generate the default BSE settings dictionary for use in documentation"""
|
|
44
|
+
defaults = get_default_BSE_settings()
|
|
45
|
+
|
|
46
|
+
indent_str = " " * 8
|
|
47
|
+
|
|
48
|
+
with open("_generated/default_bsedict.rst", "w") as f:
|
|
49
|
+
lines = [
|
|
50
|
+
".. ipython:: python",
|
|
51
|
+
"",
|
|
52
|
+
" BSEDict = {",
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
first = True
|
|
56
|
+
current_line = indent_str
|
|
57
|
+
for k, v in defaults.items():
|
|
58
|
+
entry = f'"{k}": {v}'
|
|
59
|
+
if not first:
|
|
60
|
+
entry = ", " + entry
|
|
61
|
+
first = False
|
|
62
|
+
|
|
63
|
+
# check if adding this entry would exceed line length
|
|
64
|
+
if len(current_line) + len(entry) > MAX_LINE_LENGTH:
|
|
65
|
+
lines.append(current_line.rstrip() + ",")
|
|
66
|
+
current_line = indent_str + entry.lstrip(", ")
|
|
67
|
+
else:
|
|
68
|
+
current_line += entry
|
|
69
|
+
|
|
70
|
+
if current_line.strip():
|
|
71
|
+
lines.append(current_line.rstrip())
|
|
72
|
+
lines.append(" }")
|
|
73
|
+
|
|
74
|
+
f.write("\n".join(lines))
|
|
75
|
+
|
|
76
|
+
if __name__ == "__main__":
|
|
77
|
+
generate_rst_bsedict()
|
|
@@ -13,7 +13,7 @@ Summary checklist
|
|
|
13
13
|
Been here before and just making sure you're not missing anything? Here's a quick checklist:
|
|
14
14
|
|
|
15
15
|
- ``src/cosmic/src``: Add the new option to the relevant COSMIC code file and **test your changes**!
|
|
16
|
-
- ``
|
|
16
|
+
- ``src/cosmic/data/cosmic-settings.json``: Add the new option to the JSON file
|
|
17
17
|
|
|
18
18
|
Code changes
|
|
19
19
|
------------
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
*****************************************
|
|
2
|
+
Evolving a Monte-Carlo sampled population
|
|
3
|
+
*****************************************
|
|
4
|
+
Once an initial binary population is sampled, it can be evolved using the ``Evolve`` class just as we've done so far.
|
|
5
|
+
You can read more about sampling initial binary populations in the :ref:`runpop` page.
|
|
6
|
+
|
|
7
|
+
Note that the same process used other examples applies here as well: the ``BSEDict`` must be supplied,
|
|
8
|
+
if the flags in the dictionary change from their defaults.
|
|
9
|
+
|
|
10
|
+
First, let's import the necessary modules from COSMIC:
|
|
11
|
+
|
|
12
|
+
.. ipython:: python
|
|
13
|
+
|
|
14
|
+
from cosmic.sample.initialbinarytable import InitialBinaryTable
|
|
15
|
+
|
|
16
|
+
from cosmic.evolve import Evolve
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
Now let's use the independent sampler to generate an initial binary population. You can learn more
|
|
20
|
+
about the independent sampler in the :ref:`independent` page.
|
|
21
|
+
|
|
22
|
+
.. ipython:: python
|
|
23
|
+
|
|
24
|
+
final_kstars = range(16)
|
|
25
|
+
|
|
26
|
+
InitialBinaries, mass_singles, mass_binaries, n_singles, n_binaries = \
|
|
27
|
+
InitialBinaryTable.sampler('independent', final_kstars, final_kstars,
|
|
28
|
+
binfrac_model=0.5, primary_model='kroupa01',
|
|
29
|
+
ecc_model='sana12', porb_model='sana12',
|
|
30
|
+
qmin=-1, SF_start=13700.0,
|
|
31
|
+
SF_duration=0.0, met=0.02, size=10, keep_singles=True)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
And finally, we can evolve the initial binary population using the Evolve class as we've done in the previous
|
|
35
|
+
guides:
|
|
36
|
+
|
|
37
|
+
.. include:: ../../_generated/default_bsedict.rst
|
|
38
|
+
|
|
39
|
+
.. ipython:: python
|
|
40
|
+
:okwarning:
|
|
41
|
+
|
|
42
|
+
bpp, bcm, initC, kick_info = Evolve.evolve(
|
|
43
|
+
initialbinarytable=InitialBinaries, BSEDict=BSEDict
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
print(bcm.iloc[:10])
|
|
47
|
+
|
|
48
|
+
print(bpp)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
*********************************
|
|
2
|
+
Evolving a fixed grid of binaries
|
|
3
|
+
*********************************
|
|
4
|
+
|
|
5
|
+
Sometimes it is helpful to run a fixed grid of initial binaries to explore how
|
|
6
|
+
changing a single parameter affects the evolved binary. Let's start by importing the necessary modules and
|
|
7
|
+
setting up the BSEDict settings as we've done in the previous examples.
|
|
8
|
+
|
|
9
|
+
.. ipython:: python
|
|
10
|
+
|
|
11
|
+
from cosmic.sample.initialbinarytable import InitialBinaryTable
|
|
12
|
+
|
|
13
|
+
from cosmic.evolve import Evolve
|
|
14
|
+
|
|
15
|
+
.. include:: ../../_generated/default_bsedict.rst
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
Here we evolve the same system that produces a GW150914-like binary, but run over several initial orbital
|
|
19
|
+
periods spaced evenly in log space.
|
|
20
|
+
|
|
21
|
+
.. ipython:: python
|
|
22
|
+
:okwarning:
|
|
23
|
+
|
|
24
|
+
n_grid = 10
|
|
25
|
+
|
|
26
|
+
binary_grid = InitialBinaryTable.InitialBinaries(
|
|
27
|
+
m1=np.ones(n_grid)*100.0,
|
|
28
|
+
m2=np.ones(n_grid)*85.0,
|
|
29
|
+
porb=np.logspace(3,5,n_grid),
|
|
30
|
+
ecc=np.ones(n_grid)*0.65,
|
|
31
|
+
tphysf=np.ones(n_grid)*13700.0,
|
|
32
|
+
kstar1=np.ones(n_grid),
|
|
33
|
+
kstar2=np.ones(n_grid),
|
|
34
|
+
metallicity=np.ones(n_grid)*0.005
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
print(binary_grid)
|
|
38
|
+
|
|
39
|
+
bpp, bcm, initC, kick_info = Evolve.evolve(initialbinarytable=binary_grid, BSEDict=BSEDict)
|
|
40
|
+
|
|
41
|
+
print(bpp)
|
|
42
|
+
|
|
43
|
+
print(bcm)
|