cosmic-popsynth 3.6.2__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.
Files changed (181) hide show
  1. cosmic_popsynth-3.7.0/.github/workflows/cmc-review.yml +165 -0
  2. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/.gitignore +4 -1
  3. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/PKG-INFO +1 -1
  4. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/changelog.md +12 -1
  5. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/Makefile +1 -0
  6. cosmic_popsynth-3.7.0/docs/_generated/README.md +2 -0
  7. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/conf.py +9 -0
  8. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/create_settings_html.py +1 -1
  9. cosmic_popsynth-3.7.0/docs/generate_default_bsedict.py +77 -0
  10. cosmic_popsynth-3.7.0/docs/pages/evolve/evolve_sample.rst +48 -0
  11. cosmic_popsynth-3.7.0/docs/pages/evolve/grid.rst +43 -0
  12. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/pages/evolve/interface.rst +4 -18
  13. cosmic_popsynth-3.7.0/docs/pages/evolve/multiple.rst +73 -0
  14. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/pages/evolve/rerun.rst +3 -15
  15. cosmic_popsynth-3.7.0/docs/pages/evolve/resolution.rst +97 -0
  16. cosmic_popsynth-3.7.0/docs/pages/evolve/restart.rst +109 -0
  17. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/pages/evolve/single.rst +4 -26
  18. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/pages/inifile.rst +5 -5
  19. cosmic_popsynth-3.7.0/examples/Params.ini +882 -0
  20. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/meson.build +8 -1
  21. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/pyproject.toml +1 -1
  22. cosmic_popsynth-3.7.0/src/cosmic/_version.py +1 -0
  23. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/data/cosmic-settings.json +118 -5
  24. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/evolve.py +14 -5
  25. cosmic_popsynth-3.7.0/src/cosmic/src/assign_remnant.f +673 -0
  26. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/comenv.f +4 -4
  27. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/const_bse.h +8 -6
  28. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/evolv1.f +1 -1
  29. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/evolv2.f +50 -43
  30. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/hrdiag.f +4 -3
  31. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/kick.f +23 -6
  32. cosmic_popsynth-3.7.0/src/cosmic/src/ran3.f +88 -0
  33. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/tests/data/Params.ini +6 -0
  34. cosmic_popsynth-3.7.0/src/cosmic/tests/data/initial_conditions_for_testing.hdf5 +0 -0
  35. cosmic_popsynth-3.7.0/src/cosmic/tests/data/kick_initial_conditions.h5 +0 -0
  36. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/tests/test_kick.py +1 -1
  37. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/tests/test_utils.py +3 -1
  38. cosmic_popsynth-3.6.2/.github/workflows/cmc-review.yml +0 -76
  39. cosmic_popsynth-3.6.2/docs/pages/config/README.md +0 -3
  40. cosmic_popsynth-3.6.2/docs/pages/config/config_insert_bse.html +0 -933
  41. cosmic_popsynth-3.6.2/docs/pages/config/config_insert_convergence.html +0 -78
  42. cosmic_popsynth-3.6.2/docs/pages/config/config_insert_filters.html +0 -36
  43. cosmic_popsynth-3.6.2/docs/pages/config/config_insert_rand_seed.html +0 -22
  44. cosmic_popsynth-3.6.2/docs/pages/config/config_insert_sampling.html +0 -148
  45. cosmic_popsynth-3.6.2/docs/pages/evolve/evolve_sample.rst +0 -47
  46. cosmic_popsynth-3.6.2/docs/pages/evolve/grid.rst +0 -54
  47. cosmic_popsynth-3.6.2/docs/pages/evolve/multiple.rst +0 -74
  48. cosmic_popsynth-3.6.2/docs/pages/evolve/resolution.rst +0 -85
  49. cosmic_popsynth-3.6.2/docs/pages/evolve/restart.rst +0 -78
  50. cosmic_popsynth-3.6.2/examples/Params.ini +0 -564
  51. cosmic_popsynth-3.6.2/src/cosmic/_version.py +0 -1
  52. cosmic_popsynth-3.6.2/src/cosmic/src/assign_remnant.f +0 -392
  53. cosmic_popsynth-3.6.2/src/cosmic/src/ran3.f +0 -44
  54. cosmic_popsynth-3.6.2/src/cosmic/tests/data/initial_conditions_for_testing.hdf5 +0 -0
  55. cosmic_popsynth-3.6.2/src/cosmic/tests/data/kick_initial_conditions.h5 +0 -0
  56. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/.codecov.yml +0 -0
  57. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/.gitattributes +0 -0
  58. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/.github/ISSUE_TEMPLATE/general_issue.md +0 -0
  59. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/.github/ISSUE_TEMPLATE/unexpected-stellar-evolutionary-behavior.md +0 -0
  60. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/.github/workflows/build_wheels_and_publish.yml +0 -0
  61. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/.github/workflows/deploy-github-pages.yml +0 -0
  62. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/.github/workflows/github_registory.yml +0 -0
  63. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/.github/workflows/python-package.yml +0 -0
  64. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/.readthedocs.yml +0 -0
  65. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/.vscode/launch.json +0 -0
  66. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/.vscode/tasks.json +0 -0
  67. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/Dockerfile +0 -0
  68. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/LICENSE +0 -0
  69. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/MANIFEST.in +0 -0
  70. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/README.md +0 -0
  71. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/bin/cosmic-pop +0 -0
  72. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/ci/compile_benchmark.sh +0 -0
  73. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/ci/run-tests.sh +0 -0
  74. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/debug/create_binary_in.py +0 -0
  75. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/_static/bootstrap-grid.min.css +0 -0
  76. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/_static/cosmic-docs.css +0 -0
  77. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/_static/custom.js +0 -0
  78. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/_static/settings.js +0 -0
  79. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/_templates/layout.html +0 -0
  80. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/create_params_ini.py +0 -0
  81. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/data/dat_DeltaBurst_13_14_13_14.h5 +0 -0
  82. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/data/qcrit_table.csv +0 -0
  83. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/index.rst +0 -0
  84. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/pages/about.rst +0 -0
  85. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/pages/cite.rst +0 -0
  86. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/pages/develop/adding-options.rst +0 -0
  87. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/pages/develop/debugging-vscode.rst +0 -0
  88. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/pages/develop/how-it-works.rst +0 -0
  89. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/pages/develop/new-settings.rst +0 -0
  90. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/pages/develop/option-schema.csv +0 -0
  91. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/pages/develop/setting-schema.csv +0 -0
  92. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/pages/develop/settings-json-file.rst +0 -0
  93. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/pages/developers.rst +0 -0
  94. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/pages/examples.rst +0 -0
  95. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/pages/fixedpop.rst +0 -0
  96. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/pages/install.rst +0 -0
  97. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/pages/output_info.rst +0 -0
  98. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/pages/reference_material.rst +0 -0
  99. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/pages/runpop.rst +0 -0
  100. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/pages/sample/cluster.rst +0 -0
  101. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/pages/sample/independent.rst +0 -0
  102. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/docs/pages/sample/multidim.rst +0 -0
  103. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/examples/CMC_Params.ini +0 -0
  104. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/requirements.txt +0 -0
  105. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/Match.py +0 -0
  106. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/__init__.py +0 -0
  107. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/bse_utils/__init__.py +0 -0
  108. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/bse_utils/meson.build +0 -0
  109. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/bse_utils/zcnsts.py +0 -0
  110. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/bse_utils/zdata.py +0 -0
  111. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/checkstate.py +0 -0
  112. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/data/__init__.py +0 -0
  113. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/filter.py +0 -0
  114. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/get_commit_hash.py +0 -0
  115. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/meson.build +0 -0
  116. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/output.py +0 -0
  117. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/plotting.py +0 -0
  118. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/sample/__init__.py +0 -0
  119. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/sample/cmc/__init__.py +0 -0
  120. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/sample/cmc/elson.py +0 -0
  121. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/sample/cmc/king.py +0 -0
  122. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/sample/cmc/meson.build +0 -0
  123. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/sample/initialbinarytable.py +0 -0
  124. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/sample/initialcmctable.py +0 -0
  125. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/sample/meson.build +0 -0
  126. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/sample/sampler/__init__.py +0 -0
  127. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/sample/sampler/cmc.py +0 -0
  128. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/sample/sampler/independent.py +0 -0
  129. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/sample/sampler/meson.build +0 -0
  130. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/sample/sampler/multidim.py +0 -0
  131. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/sample/sampler/sampler.py +0 -0
  132. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/Makefile +0 -0
  133. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/benchmarkevolv2.f +0 -0
  134. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/bpp_array.f +0 -0
  135. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/bse.f +0 -0
  136. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/checkstate.f +0 -0
  137. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/checkstate.h +0 -0
  138. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/comprad.f +0 -0
  139. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/concatkstars.f +0 -0
  140. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/corerd.f +0 -0
  141. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/deltat.f +0 -0
  142. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/dgcore.f +0 -0
  143. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/gntage.f +0 -0
  144. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/hrdiag_remnant.f +0 -0
  145. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/instar.f +0 -0
  146. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/int64.f +0 -0
  147. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/int64.h +0 -0
  148. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/int64.h.in +0 -0
  149. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/mix.f +0 -0
  150. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/mlwind.f +0 -0
  151. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/mrenv.f +0 -0
  152. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/rl.f +0 -0
  153. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/sse.f +0 -0
  154. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/star.f +0 -0
  155. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/taus113-ran3.f +0 -0
  156. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/taus113tester.f +0 -0
  157. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/tausworth.f +0 -0
  158. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/tausworth.h +0 -0
  159. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/test_bse.f +0 -0
  160. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/zcnsts.f +0 -0
  161. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/zdata.h +0 -0
  162. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/src/zfuncs.f +0 -0
  163. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/tests/data/GW_dat.h5 +0 -0
  164. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/tests/data/Kroupa93.npy +0 -0
  165. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/tests/data/bpp_array_ind_sampling.npy +0 -0
  166. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/tests/data/cmc_elson_test.npz +0 -0
  167. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/tests/data/cmc_king_test.npz +0 -0
  168. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/tests/data/cmc_plummer_test.npz +0 -0
  169. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/tests/data/dat_ThinDisk_10_12_10_12.h5 +0 -0
  170. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/tests/data/dat_ThinDisk_11_11_3.h5 +0 -0
  171. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/tests/data/init_conditions_ind_sampling.npy +0 -0
  172. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/tests/data/input_cmc.fits +0 -0
  173. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/tests/data/input_cmc.hdf5 +0 -0
  174. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/tests/data/unit_test_results.hdf5 +0 -0
  175. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/tests/data/unit_tests_results.hdf5 +0 -0
  176. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/tests/data/utils_test.hdf +0 -0
  177. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/tests/meson.build +0 -0
  178. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/tests/test_evolve.py +0 -0
  179. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/tests/test_match.py +0 -0
  180. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/tests/test_sample.py +0 -0
  181. {cosmic_popsynth-3.6.2 → cosmic_popsynth-3.7.0}/src/cosmic/utils.py +0 -0
@@ -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
+ });
@@ -115,4 +115,7 @@ binary.in
115
115
  binary.dat
116
116
  *.h5
117
117
  fort.99
118
- savefig/
118
+ savefig/
119
+
120
+ # ignore generated docs files
121
+ _generated/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cosmic-popsynth
3
- Version: 3.6.2
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>
@@ -58,4 +58,15 @@ See the discussed changes in our previous releases here: https://github.com/COSM
58
58
 
59
59
  ## 3.6.2
60
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
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
@@ -55,6 +55,7 @@ clean:
55
55
 
56
56
  .PHONY: html
57
57
  html: apidoc
58
+ python generate_default_bsedict.py
58
59
  python create_settings_html.py
59
60
  $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
60
61
  @echo
@@ -0,0 +1,2 @@
1
+ # _generated
2
+ Generated docs files will be placed here
@@ -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
 
@@ -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"pages/config/config_insert_{group['category']}.html", "w") as 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()
@@ -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)
@@ -26,29 +26,15 @@ samples ~100 binaries and evolving them.
26
26
  import matplotlib.pyplot as plt
27
27
  import numpy as np
28
28
 
29
+ .. include:: ../../_generated/default_bsedict.rst
30
+
31
+ .. ipython:: python
32
+
29
33
  InitialBinaries, mass_singles, mass_binaries, n_singles, n_binaries = InitialBinaryTable.sampler(
30
34
  'independent', [13, 14], [13, 14], binfrac_model=0.5, primary_model='kroupa01',
31
35
  ecc_model='sana12', porb_model='sana12', qmin=-1, SF_start=13700.0, SF_duration=0.0,
32
36
  met=0.002, size=1000)
33
37
 
34
- BSEDict = {
35
- 'xi': 1.0, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'wdflag': 1, 'alpha1': 1.0,
36
- 'pts1': 0.001, 'pts3': 0.02, 'pts2': 0.01, 'epsnov': 0.001, 'hewind': 0.5, 'ck': 1000,
37
- 'bwind': 0.0, 'lambdaf': 0.0, 'mxns': 3.0, 'beta': -1.0, 'tflag': 1, 'acc2': 1.5,
38
- 'grflag' : 1, 'remnantflag': 4, 'ceflag': 0, 'eddfac': 1.0, 'ifflag': 0, 'bconst': 3000,
39
- 'sigma': 265.0, 'gamma': -2.0, 'pisn': 45.0,
40
- 'natal_kick_array' : [[-100.0,-100.0,-100.0,-100.0,0.0], [-100.0,-100.0,-100.0,-100.0,0.0]],
41
- 'bhsigmafrac' : 1.0, 'polar_kick_angle' : 90,
42
- 'qcrit_array' : [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],
43
- 'cekickflag' : 2, 'cehestarflag' : 0, 'cemergeflag' : 0, 'ecsn' : 2.25, 'ecsn_mlow' : 1.6,
44
- 'aic' : 1, 'ussn' : 0, 'sigmadiv' :-20.0, 'qcflag' : 1, 'eddlimflag' : 0,
45
- 'fprimc_array' : [2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0],
46
- 'bhspinflag' : 0, 'bhspinmag' : 0.0, 'rejuv_fac' : 1.0, 'rejuvflag' : 0, 'htpmb' : 1,
47
- 'ST_cr' : 1, 'ST_tide' : 1, 'bdecayfac' : 1, 'rembar_massloss' : 0.5, 'kickflag' : 5,
48
- 'zsun' : 0.014, 'bhms_coll_flag' : 0, 'don_lim' : -1, 'acc_lim' : -1, 'rtmsflag' : 0,
49
- 'wd_mass_lim': 1
50
- }
51
-
52
38
  bpp, bcm, initC, kick_info = Evolve.evolve(initialbinarytable=InitialBinaries, BSEDict=BSEDict)
53
39
 
54
40
  Now we can create a ``COSMICOutput`` object quite easily (with an optional label):
@@ -0,0 +1,73 @@
1
+ **************************
2
+ Evolving multiple binaries
3
+ **************************
4
+
5
+ Following on from `evolving a single binary <single.html>`_, we can also evolve multiple binaries.
6
+ Let's start by importing the necessary modules:
7
+
8
+ .. ipython:: python
9
+
10
+ from cosmic.sample.initialbinarytable import InitialBinaryTable
11
+
12
+ from cosmic.evolve import Evolve
13
+
14
+
15
+ And use the same BSE dict as before:
16
+
17
+ .. include:: ../../_generated/default_bsedict.rst
18
+
19
+ Below is an example for systems that could form GW150914 and GW170817 - like binaries.
20
+
21
+ .. ipython:: python
22
+ :okwarning:
23
+
24
+ binary_set = InitialBinaryTable.InitialBinaries(
25
+ m1=[85.543645, 11.171469], m2=[84.99784, 6.67305],
26
+ porb=[446.795757, 170.758343], ecc=[0.448872, 0.370],
27
+ tphysf=[13700.0, 13700.0],
28
+ kstar1=[1, 1], kstar2=[1, 1],
29
+ metallicity=[0.002, 0.02]
30
+ )
31
+
32
+ print(binary_set)
33
+
34
+ import numpy as np
35
+
36
+ np.random.seed(5)
37
+
38
+ bpp, bcm, initC, kick_info = Evolve.evolve(initialbinarytable=binary_set, BSEDict=BSEDict)
39
+
40
+ As before, bpp, bcm, and initC are returned as pandas DataFrames which assign an
41
+ index to each binary system we evolve. We can access each binary as follows:
42
+
43
+ .. ipython:: python
44
+
45
+ print(bpp.loc[0])
46
+
47
+ print(bcm.loc[0])
48
+
49
+ print(initC.loc[0])
50
+
51
+ print(bpp.loc[1])
52
+
53
+ The plotting function can also take in multiple binaries. Let's plot both the GW150914-like
54
+ progenitor evolution and the GW170817-like progenitor evolutions. For the GW170817-like
55
+ progenitor, we expect most of the evolution to take place in the first ~60 Myr.
56
+
57
+ .. ipython:: python
58
+ :okwarning:
59
+ :okexcept:
60
+
61
+ from cosmic.plotting import evolve_and_plot
62
+ fig = evolve_and_plot(binary_set, t_min=None, t_max=[6.0, 60.0], BSEDict=BSEDict, sys_obs={})
63
+
64
+
65
+ .. plot::
66
+
67
+ from cosmic.sample.initialbinarytable import InitialBinaryTable
68
+ from cosmic.plotting import evolve_and_plot
69
+ import numpy as np
70
+ np.random.seed(5)
71
+ binary_set = InitialBinaryTable.InitialBinaries(m1=[85.543645, 11.171469], m2=[84.99784, 9.67305], porb=[446.795757, 370.758343], ecc=[0.448872, 0.370], tphysf=[13700.0, 13700.0], kstar1=[1, 1], kstar2=[1, 1], metallicity=[0.002, 0.02])
72
+ fig = evolve_and_plot(binary_set, t_min=None, t_max=[6.0, 60.0], BSEDict=default_BSEDict, sys_obs={})
73
+
@@ -20,21 +20,9 @@ First, let's evolve a binary and save the initC table.
20
20
  from cosmic.sample.initialbinarytable import InitialBinaryTable
21
21
  from cosmic.evolve import Evolve
22
22
 
23
- BSEDict = {'xi': 1.0, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'wdflag': 1, 'alpha1': 1.0,
24
- 'pts1': 0.001, 'pts3': 0.02, 'pts2': 0.01, 'epsnov': 0.001, 'hewind': 0.5, 'ck': 1000,
25
- 'bwind': 0.0, 'lambdaf': 0.0, 'mxns': 3.0, 'beta': -1.0, 'tflag': 1, 'acc2': 1.5,
26
- 'grflag' : 1, 'remnantflag': 4, 'ceflag': 0, 'eddfac': 1.0, 'ifflag': 0,
27
- 'bconst': 3000, 'sigma': 265.0, 'gamma': -2.0, 'pisn': 45.0,
28
- 'natal_kick_array' : [[-100.0,-100.0,-100.0,-100.0,0.0], [-100.0,-100.0,-100.0,-100.0,0.0]],
29
- 'bhsigmafrac' : 1.0, 'polar_kick_angle' : 90,
30
- 'qcrit_array' : [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],
31
- 'cekickflag' : 2, 'cehestarflag' : 0, 'cemergeflag' : 0, 'ecsn' : 2.25,
32
- 'ecsn_mlow' : 1.6, 'aic' : 1, 'ussn' : 0, 'sigmadiv' :-20.0, 'qcflag' : 1, 'eddlimflag' : 0,
33
- 'fprimc_array' : [2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0],
34
- 'bhspinflag' : 0, 'bhspinmag' : 0.0, 'rejuv_fac' : 1.0, 'rejuvflag' : 0, 'htpmb' : 1,
35
- 'ST_cr' : 1, 'ST_tide' : 1, 'bdecayfac' : 1, 'rembar_massloss' : 0.5, 'kickflag' : 1,
36
- 'zsun' : 0.014, 'bhms_coll_flag' : 0, 'don_lim' : -1, 'acc_lim' : -1, 'rtmsflag' : 0,
37
- 'wd_mass_lim': 1}
23
+ .. include:: ../../_generated/default_bsedict.rst
24
+
25
+ .. ipython:: python
38
26
 
39
27
  binary = InitialBinaryTable.InitialBinaries(
40
28
  m1=20, m2=15, porb=100, ecc=0.1, tphysf=13700.0, kstar1=1, kstar2=1, metallicity=0.02
@@ -0,0 +1,97 @@
1
+ ***********************
2
+ Dynamic time resolution
3
+ ***********************
4
+
5
+ COSMIC has the ability to set time resolution of the bcm array depending on the current state of the evolution.
6
+
7
+ .. ipython:: python
8
+
9
+ from cosmic.sample.initialbinarytable import InitialBinaryTable
10
+
11
+ from cosmic.evolve import Evolve
12
+
13
+ General syntax
14
+ ==============
15
+
16
+ The timestep resolution for the bcm array can be set using ``timestep_conditions`` parameter. The format of
17
+ this parameter is a list of lists, where each sublist contains zero or more conditions followed by the desired
18
+ resolution. The conditions are in the form of a string with the format ``'column_name=condition'``. The resolution
19
+ is in the form of a string with the format ``'dtp=resolution'``.
20
+
21
+ The conditions are evaluated at each time step and if the condition is met, the resolution is set to the desired value. If multiple conditions are specified, a timestep is outputted if **any** of the conditions are met.
22
+
23
+ The resolution can be any positive float value given in units of Myr. If the resolution is set to 0.0, every time step will be outputted in the bcm array.
24
+
25
+ Examples
26
+ ========
27
+
28
+ Below we demonstrate three scenarios, setting dtp only during mass transfer, setting dtp to the same resolution for all of the evolution except for after the system merges or is disrupted, and finally an example of setting dtp only during the HMXB stage of the evolution.
29
+
30
+ All steps during mass transfer
31
+ ------------------------------
32
+
33
+ First, print all time steps during mass transfer
34
+
35
+ .. ipython:: python
36
+ :okwarning:
37
+
38
+ single_binary = InitialBinaryTable.InitialBinaries(
39
+ m1=7.806106, m2=5.381412, porb=2858.942021,
40
+ ecc=0.601408, tphysf=13700.0, kstar1=1, kstar2=1, metallicity=0.02
41
+ )
42
+
43
+
44
+ .. include:: ../../_generated/default_bsedict.rst
45
+
46
+
47
+ .. ipython:: python
48
+ :okwarning:
49
+
50
+ # Define the condition for the time step
51
+ timestep_conditions = [['RRLO_1>=1', 'dtp=0.0'], ['RRLO_2>=1', 'dtp=0.0']]
52
+
53
+ bpp, bcm, initC, kick_info = Evolve.evolve(
54
+ initialbinarytable=single_binary, BSEDict=BSEDict,
55
+ timestep_conditions=timestep_conditions
56
+ )
57
+ print(bcm[['tphys', 'kstar_1', 'kstar_2', 'mass_1', 'mass_2', 'RRLO_1', 'RRLO_2']])
58
+
59
+
60
+ Condition on binary state
61
+ -------------------------
62
+ Second, pick a certain resolution for the bcm array until the system merges or is disrupted and then only print the final state
63
+
64
+ .. ipython:: python
65
+ :okwarning:
66
+
67
+ timestep_conditions = [['binstate=0', 'dtp=1.0']]
68
+
69
+ bpp, bcm, initC, kick_info = Evolve.evolve(
70
+ initialbinarytable=single_binary, BSEDict=BSEDict,
71
+ timestep_conditions=timestep_conditions
72
+ )
73
+
74
+ print(bcm[['tphys', 'kstar_1', 'kstar_2', 'mass_1', 'mass_2', 'bin_state']])
75
+
76
+
77
+ Condition on evolutionary state
78
+ -------------------------------
79
+ Finally, we show how to print a fine resolution only during the HMXB stage of the evolution.
80
+
81
+ .. ipython:: python
82
+ :okwarning:
83
+
84
+ single_binary = InitialBinaryTable.InitialBinaries(
85
+ m1=85.543645, m2=84.99784, porb=446.795757,
86
+ ecc=0.448872, tphysf=13700.0,
87
+ kstar1=1, kstar2=1, metallicity=0.002
88
+ )
89
+
90
+ timestep_conditions = [['kstar_1=14', 'kstar_2<10','dtp=0.1'], ['kstar_2=14', 'kstar_1<10','dtp=0.1']]
91
+
92
+ bpp, bcm, initC, kick_info = Evolve.evolve(
93
+ initialbinarytable=single_binary, BSEDict=BSEDict,
94
+ timestep_conditions=timestep_conditions
95
+ )
96
+
97
+ print(bcm[['tphys', 'kstar_1', 'kstar_2', 'mass_1', 'mass_2', 'bin_state']])