cosmic-popsynth 3.4.13__tar.gz → 3.4.15__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 (129) hide show
  1. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/.github/workflows/build_wheels_and_publish.yml +27 -38
  2. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/.gitignore +13 -0
  3. cosmic_popsynth-3.4.15/.vscode/launch.json +30 -0
  4. cosmic_popsynth-3.4.15/.vscode/tasks.json +13 -0
  5. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/PKG-INFO +2 -17
  6. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/bin/cosmic-pop +3 -1
  7. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/changelog.md +4 -0
  8. cosmic_popsynth-3.4.15/debug/create_binary_in.py +66 -0
  9. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/docs/inifile/index.rst +6 -0
  10. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/examples/CMC_Params.ini +1 -0
  11. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/examples/Params.ini +1 -0
  12. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/meson.build +19 -21
  13. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/pyproject.toml +5 -18
  14. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/requirements.txt +1 -0
  15. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/__init__.py +2 -0
  16. cosmic_popsynth-3.4.15/src/cosmic/_version.py +1 -0
  17. cosmic_popsynth-3.4.15/src/cosmic/bse_utils/meson.build +10 -0
  18. cosmic_popsynth-3.4.15/src/cosmic/get_commit_hash.py +15 -0
  19. cosmic_popsynth-3.4.15/src/cosmic/meson.build +21 -0
  20. cosmic_popsynth-3.4.15/src/cosmic/sample/cmc/meson.build +10 -0
  21. cosmic_popsynth-3.4.15/src/cosmic/sample/meson.build +13 -0
  22. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/sample/sampler/independent.py +34 -8
  23. cosmic_popsynth-3.4.15/src/cosmic/sample/sampler/meson.build +12 -0
  24. cosmic_popsynth-3.4.15/src/cosmic/src/Makefile +22 -0
  25. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/evolv2.f +24 -11
  26. cosmic_popsynth-3.4.15/src/cosmic/src/test_bse.f +323 -0
  27. cosmic_popsynth-3.4.15/src/cosmic/tests/meson.build +11 -0
  28. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/tests/test_sample.py +21 -1
  29. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/utils.py +4 -2
  30. cosmic_popsynth-3.4.13/src/cosmic/_version.py +0 -1
  31. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/.codecov.yml +0 -0
  32. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/.gitattributes +0 -0
  33. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/.github/ISSUE_TEMPLATE/general_issue.md +0 -0
  34. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/.github/ISSUE_TEMPLATE/unexpected-stellar-evolutionary-behavior.md +0 -0
  35. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/.github/workflows/deploy-github-pages.yml +0 -0
  36. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/.github/workflows/github_registory.yml +0 -0
  37. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/.github/workflows/python-package.yml +0 -0
  38. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/.readthedocs.yml +0 -0
  39. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/Dockerfile +0 -0
  40. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/LICENSE +0 -0
  41. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/MANIFEST.in +0 -0
  42. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/README.md +0 -0
  43. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/ci/compile_benchmark.sh +0 -0
  44. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/ci/run-tests.sh +0 -0
  45. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/docs/Makefile +0 -0
  46. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/docs/_static/cosmic-docs.css +0 -0
  47. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/docs/_templates/layout.html +0 -0
  48. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/docs/conf.py +0 -0
  49. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/docs/examples/index.rst +0 -0
  50. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/docs/fixedpop/dat_DeltaBurst_13_14_13_14.h5 +0 -0
  51. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/docs/fixedpop/index.rst +0 -0
  52. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/docs/index.rst +0 -0
  53. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/docs/inifile/qcrit_table.csv +0 -0
  54. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/docs/install/index.rst +0 -0
  55. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/docs/output_info/index.rst +0 -0
  56. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/docs/runpop/index.rst +0 -0
  57. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/Match.py +0 -0
  58. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/bse_utils/__init__.py +0 -0
  59. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/bse_utils/zcnsts.py +0 -0
  60. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/bse_utils/zdata.py +0 -0
  61. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/checkstate.py +0 -0
  62. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/evolve.py +0 -0
  63. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/filter.py +0 -0
  64. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/plotting.py +0 -0
  65. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/sample/__init__.py +0 -0
  66. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/sample/cmc/__init__.py +0 -0
  67. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/sample/cmc/elson.py +0 -0
  68. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/sample/cmc/king.py +0 -0
  69. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/sample/initialbinarytable.py +0 -0
  70. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/sample/initialcmctable.py +0 -0
  71. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/sample/sampler/__init__.py +0 -0
  72. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/sample/sampler/cmc.py +0 -0
  73. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/sample/sampler/multidim.py +0 -0
  74. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/sample/sampler/sampler.py +0 -0
  75. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/assign_remnant.f +0 -0
  76. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/benchmarkevolv2.f +0 -0
  77. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/bpp_array.f +0 -0
  78. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/bse.f +0 -0
  79. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/checkstate.f +0 -0
  80. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/checkstate.h +0 -0
  81. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/comenv.f +0 -0
  82. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/comprad.f +0 -0
  83. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/concatkstars.f +0 -0
  84. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/const_bse.h +0 -0
  85. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/corerd.f +0 -0
  86. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/deltat.f +0 -0
  87. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/dgcore.f +0 -0
  88. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/evolv1.f +0 -0
  89. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/gntage.f +0 -0
  90. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/hrdiag.f +0 -0
  91. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/hrdiag_remnant.f +0 -0
  92. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/instar.f +0 -0
  93. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/int64.f +0 -0
  94. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/int64.h +0 -0
  95. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/int64.h.in +0 -0
  96. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/kick.f +0 -0
  97. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/mix.f +0 -0
  98. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/mlwind.f +0 -0
  99. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/mrenv.f +0 -0
  100. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/ran3.f +0 -0
  101. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/rl.f +0 -0
  102. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/sse.f +0 -0
  103. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/star.f +0 -0
  104. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/taus113-ran3.f +0 -0
  105. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/taus113tester.f +0 -0
  106. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/tausworth.f +0 -0
  107. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/tausworth.h +0 -0
  108. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/zcnsts.f +0 -0
  109. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/zdata.h +0 -0
  110. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/src/zfuncs.f +0 -0
  111. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/tests/data/GW_dat.h5 +0 -0
  112. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/tests/data/Kroupa93.npy +0 -0
  113. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/tests/data/Params.ini +0 -0
  114. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/tests/data/bpp_array_ind_sampling.npy +0 -0
  115. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/tests/data/cmc_elson_test.npz +0 -0
  116. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/tests/data/cmc_king_test.npz +0 -0
  117. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/tests/data/cmc_plummer_test.npz +0 -0
  118. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/tests/data/dat_ThinDisk_10_12_10_12.h5 +0 -0
  119. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/tests/data/dat_ThinDisk_11_11_3.h5 +0 -0
  120. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/tests/data/init_conditions_ind_sampling.npy +0 -0
  121. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/tests/data/initial_conditions_for_testing.hdf5 +0 -0
  122. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/tests/data/input_cmc.fits +0 -0
  123. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/tests/data/input_cmc.hdf5 +0 -0
  124. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/tests/data/unit_test_results.hdf5 +0 -0
  125. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/tests/data/unit_tests_results.hdf5 +0 -0
  126. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/tests/data/utils_test.hdf +0 -0
  127. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/tests/test_evolve.py +0 -0
  128. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/tests/test_match.py +0 -0
  129. {cosmic_popsynth-3.4.13 → cosmic_popsynth-3.4.15}/src/cosmic/tests/test_utils.py +0 -0
@@ -14,12 +14,13 @@ env:
14
14
  CIBW_BUILD_VERBOSITY: "1"
15
15
 
16
16
  jobs:
17
- build-wheels:
17
+ build-wheels-and-dist:
18
18
  name: Build ${{ matrix.python-version }} wheels on ${{ matrix.os }}
19
19
  runs-on: ${{ matrix.os }}
20
20
  strategy:
21
21
  matrix:
22
22
  os: [ubuntu-latest, macos-latest]
23
+ python-version: [3.9, "3.10"]
23
24
 
24
25
  steps:
25
26
  - uses: actions/checkout@v3
@@ -29,52 +30,40 @@ jobs:
29
30
  name: Install Python
30
31
  with:
31
32
  python-version: "3.10"
32
-
33
- - name: Setup Mac
33
+
34
+ - name: link gfortran and hdf5
34
35
  if: runner.os == 'macOS'
35
36
  run: |
36
- python -m pip install numpy h5py versioneer
37
+ sudo ln -s /opt/homebrew/bin/gfortran-12 /usr/local/bin/gfortran
38
+ brew reinstall hdf5
37
39
 
38
- - name: Setup Linux
39
- if: runner.os == 'Linux'
40
+ - name: Install numpy
40
41
  run: |
41
- python -m pip install numpy h5py versioneer
42
-
43
- - name: Build wheels
42
+ python -m pip install --upgrade pip
43
+ python -m pip install numpy h5py versioneer
44
+
45
+ - name: Install dependencies
46
+ run: |
47
+ python -m pip install cibuildwheel==2.17.0 setuptools wheel build meson-python ninja meson
48
+
49
+ - name: Build source distribution (sdist)
50
+ run: |
51
+ python -m build --sdist --outdir dist
52
+
53
+ - name: Build wheels using cibuildwheel
44
54
  run: |
45
- sudo ln -s /opt/homebrew/bin/gfortran-11 /opt/homebrew/bin/gfortran || true
46
- python -m pip install meson ninja build
47
- meson setup build
48
- meson compile -C build
49
- python -m build --wheel --outdir wheelhouse
55
+ python -m cibuildwheel --output-dir dist
56
+
50
57
  - uses: actions/upload-artifact@v3
51
58
  with:
52
- path: ./wheelhouse/*.whl
53
-
54
- build-source-dist:
55
- name: Build source dist
56
- runs-on: ubuntu-latest
57
- steps:
58
- - uses: actions/checkout@v3
59
- with:
60
- fetch-depth: 0
61
- - uses: actions/setup-python@v4
62
- name: Install Python
63
- with:
64
- python-version: "3.10"
65
-
66
- - name: Build dist
67
- run: |
68
- python -m pip install --upgrade pip
69
- pip install setuptools wheel twine numpy build meson ninja
70
- pip install .
71
- python -m build
72
- - uses: actions/upload-artifact@v3
73
- with:
74
- path: ./dist/*.tar.gz
59
+ path: ./dist/*.tar.gz
60
+
61
+ - uses: actions/upload-artifact@v3
62
+ with:
63
+ path: ./dist/*.whl
75
64
 
76
65
  publish:
77
- needs: [build-wheels, build-source-dist]
66
+ needs: [build-wheels-and-dist]
78
67
  name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
79
68
  runs-on: ${{ matrix.os }}
80
69
  strategy:
@@ -1,3 +1,10 @@
1
+ # ignore files without extensions
2
+ *
3
+ !/**/
4
+ !*.*
5
+
6
+ .DS_Store
7
+
1
8
  # Byte-compiled / optimized / DLL files
2
9
  __pycache__/
3
10
  *.py[cod]
@@ -102,3 +109,9 @@ ENV/
102
109
 
103
110
  # mypy
104
111
  .mypy_cache/
112
+
113
+ *.o
114
+ binary.in
115
+ binary.dat
116
+ *.h5
117
+ fort.99
@@ -0,0 +1,30 @@
1
+ {
2
+ "version": "0.2.0",
3
+ "configurations": [
4
+ {
5
+ "name": "(gdb) Launch",
6
+ "type": "cppdbg",
7
+ "request": "launch",
8
+ "program": "${workspaceRoot}/debug/test",
9
+ "args": [],
10
+ "stopAtEntry": false,
11
+ "cwd": "${workspaceRoot}/debug",
12
+ "environment": [],
13
+ "externalConsole": false,
14
+ "MIMode": "gdb",
15
+ "preLaunchTask": "make",
16
+ "setupCommands": [
17
+ {
18
+ "description": "Enable pretty-printing for gdb",
19
+ "text": "-enable-pretty-printing",
20
+ "ignoreFailures": true
21
+ },
22
+ {
23
+ "description": "Set Disassembly Flavor to Intel",
24
+ "text": "-gdb-set disassembly-flavor intel",
25
+ "ignoreFailures": true
26
+ }
27
+ ]
28
+ },
29
+ ]
30
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "version": "2.0.0",
3
+ "tasks": [
4
+ {
5
+ "label": "make",
6
+ "type": "shell",
7
+ "command": "make test",
8
+ "options": {
9
+ "cwd": "${workspaceFolder}/cosmic/src"
10
+ },
11
+ }
12
+ ]
13
+ }
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cosmic-popsynth
3
- Version: 3.4.13
3
+ Version: 3.4.15
4
4
  Summary: a Python-interfaced binary population synthesis suite
5
- Author: Scott Coughlin, Michael Zevin, Carl L. Rodriguez
5
+ Author: Scott Coughlin, Michael Zevin, Carl L. Rodriguez, Tom Wagg
6
6
  Author-Email: Katelyn Breivik <katie.breivik@gmail.com>
7
7
  License: MIT License
8
8
  Classifier: Development Status :: 5 - Production/Stable
@@ -23,21 +23,6 @@ Requires-Dist: h5py
23
23
  Requires-Dist: schwimmbad
24
24
  Requires-Dist: matplotlib
25
25
  Requires-Dist: importlib-metadata
26
- Requires-Dist: pytest; extra == "test"
27
- Requires-Dist: pytest-xdist; extra == "test"
28
- Requires-Dist: pytest-cov; extra == "test"
29
- Requires-Dist: flake8; extra == "test"
30
- Requires-Dist: coverage; extra == "test"
31
- Requires-Dist: sphinx; extra == "docs"
32
- Requires-Dist: numpydoc; extra == "docs"
33
- Requires-Dist: sphinx-bootstrap-theme; extra == "docs"
34
- Requires-Dist: sphinxcontrib-programoutput; extra == "docs"
35
- Requires-Dist: sphinx-automodapi; extra == "docs"
36
- Requires-Dist: ipython; extra == "docs"
37
- Requires-Dist: sphinx_rtd_theme; extra == "docs"
38
- Requires-Dist: pickleshare; extra == "docs"
39
- Provides-Extra: test
40
- Provides-Extra: docs
41
26
  Description-Content-Type: text/markdown
42
27
 
43
28
  # COSMIC
@@ -98,6 +98,8 @@ def parse_commandline():
98
98
  help="Number of binaries to try before checking for "
99
99
  "convergence, it will check ever Nstep binaries until "
100
100
  "it reach Niter binaries", type=int, default=10000)
101
+ parser.add_argument("--max-wall-time", type=int, default=3155760,
102
+ help="Maximum wall time (seconds) for sampling binaries")
101
103
  parser.add_argument("--binary_state", nargs='+', type=int)
102
104
  parser.add_argument("--sampling_method")
103
105
  parser.add_argument("--primary_model", help="Chooses the initial primary mass function from: salpeter55, kroupa93, kroupa01", type=str)
@@ -288,7 +290,7 @@ if __name__ == '__main__':
288
290
  log_file.write("You have specified both qmin and m2_min.\n")
289
291
  log_file.write("COSMIC will use qmin={} to determine the secondary masses in the initial sample.\n".format(args.qmin))
290
292
 
291
- while (Nstep < args.Niter) & (np.max(match) > convergence['match']):
293
+ while (Nstep < args.Niter) & (np.max(match) > convergence['match']) & ((time.time() - start_time) < args.max_wall_time):
292
294
  # Set random seed such that each iteration gets a unique, determinable seed
293
295
  rand_seed = seed_int + Nstep
294
296
  np.random.seed(rand_seed)
@@ -39,3 +39,7 @@ See the discussed changes in our previous releases here: https://github.com/COSM
39
39
  - Add `teff_1` and `teff_2` as variables that can be used to set `timestep_conditions`
40
40
  - Add in `-1` option to turn off Magnetic Braking in htmb
41
41
  - Added `central_bh` and `scale_with_central_bh` as options to the CMC sampler, in order to add central massive black holes to CMC initial conditions
42
+
43
+
44
+ ## 3.4.11
45
+ - Added sampling options to ``independent`` sampler to allow for custom power law distributions for ``porb`` and ``q``
@@ -0,0 +1,66 @@
1
+ import pandas as pd
2
+
3
+ BSE_settings = {'xi': 1.0, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'wdflag': 1, 'alpha1': 1.0,
4
+ 'pts1': 0.001, 'pts3': 0.02, 'pts2': 0.01, 'epsnov': 0.001, 'hewind': 0.5,
5
+ 'ck': 1000, 'bwind': 0.0, 'lambdaf': 0.0, 'mxns': 3.0, 'beta': -1.0, 'tflag': 1,
6
+ 'acc2': 1.5, 'grflag': 1, 'remnantflag': 4, 'ceflag': 0, 'eddfac': 1.0,
7
+ 'ifflag': 0, 'bconst': 3000, 'sigma': 265.0, 'gamma': -2.0, 'pisn': 45.0,
8
+ 'natal_kick_array': [[-100.0, -100.0, -100.0, -100.0, 0.0],
9
+ [-100.0, -100.0, -100.0, -100.0, 0.0]], 'bhsigmafrac': 1.0,
10
+ 'polar_kick_angle': 90, 'qcrit_array': [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
11
+ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
12
+ 'cekickflag': 2, 'cehestarflag': 0, 'cemergeflag': 0, 'ecsn': 2.25,
13
+ 'ecsn_mlow': 1.6, 'aic': 1, 'ussn': 0, 'sigmadiv': -20.0, 'qcflag': 5,
14
+ 'eddlimflag': 0, 'fprimc_array': [2.0/21.0, 2.0/21.0, 2.0/21.0, 2.0/21.0,
15
+ 2.0/21.0, 2.0/21.0, 2.0/21.0, 2.0/21.0,
16
+ 2.0/21.0, 2.0/21.0, 2.0/21.0, 2.0/21.0,
17
+ 2.0/21.0, 2.0/21.0, 2.0/21.0, 2.0/21.0],
18
+ 'bhspinflag': 0, 'bhspinmag': 0.0, 'rejuv_fac': 1.0, 'rejuvflag': 0, 'htpmb': 1,
19
+ 'ST_cr': 1, 'ST_tide': 1, 'bdecayfac': 1, 'rembar_massloss': 0.5, 'kickflag': 0,
20
+ 'zsun': 0.014, 'bhms_coll_flag': 0, 'don_lim': -1, 'acc_lim': -1, 'binfrac': 0.5,
21
+ 'rtmsflag': 0, 'wd_mass_lim': 1, 'idum': 100}
22
+
23
+
24
+ def create_binary_in(mass0, tphysf, tb, kstar, Z, ecc, BSE_settings):
25
+ """Create a binary.in file based on the given parameters
26
+
27
+ This follows the format in cosmic/src/test_bse.f and changes there would need to be reflected here.
28
+ """
29
+ with open('binary.in', 'w') as f:
30
+ f.write(f'{mass0[0]} {mass0[1]} {tphysf} {tb} {kstar[0]} {kstar[1]} {Z} {ecc}\n')
31
+
32
+ lines = [
33
+ ['neta', 'bwind', 'hewind', 'alpha1', 'lambdaf', 'windflag', 'rtmsflag'],
34
+ ['ceflag', 'tflag', 'ifflag', 'wdflag', 'bhflag', 'remnantflag', 'mxns', 'idum'],
35
+ ['pts1', 'pts2', 'pts3'],
36
+ ['sigma', 'beta', 'xi', 'acc2', 'epsnov', 'eddfac', 'gamma']
37
+ ]
38
+
39
+ for line in lines:
40
+ f.write(' '.join([str(BSE_settings[key]) for key in line]) + '\n')
41
+
42
+
43
+ def convert_initC_row_to_binary_in(initC_file, bin_num):
44
+ """Convert a row from an initC file to a binary.in file
45
+
46
+ Parameters
47
+ ----------
48
+ initC_file : `str`
49
+ Path to the initC file
50
+ bin_num : `int`
51
+ The binary number to convert
52
+ """
53
+ # get binary from initC
54
+ initC = pd.read_hdf(initC_file, key="initC")
55
+ r = initC.loc[bin_num]
56
+
57
+ # update BSE settings with those in the binary
58
+ BSE_settings['idum'] = r['randomseed'].astype(int)
59
+ for key in BSE_settings:
60
+ if key in r:
61
+ BSE_settings[key] = r[key]
62
+
63
+ # create binary.in file
64
+ create_binary_in([r['mass_1'], r['mass_2']], r['tphysf'], r['porb'],
65
+ [r['kstar_1'].astype(int), r['kstar_2'].astype(int)],
66
+ r['metallicity'], r['ecc'], BSE_settings)
@@ -1055,6 +1055,11 @@ common envelope occurs regardless of the choices below:
1055
1055
  ``-2`` : assumes material is lost from the system as
1056
1056
  if it is a wind from the secondary
1057
1057
 
1058
+ ``-3`` : assumes mass is lost through the outer Lagrangian point,
1059
+ forming a circumbinary disk. See Zapartas+17 Eq. 9 and
1060
+ Artymowicz & Lubow (1994).
1061
+
1062
+
1058
1063
  ``>0`` : assumes that the lost material takes away a
1059
1064
  fraction *gamma* of the orbital angular momentum
1060
1065
 
@@ -1104,6 +1109,7 @@ common envelope occurs regardless of the choices below:
1104
1109
  eddfac = 1.0
1105
1110
 
1106
1111
  ; gamma is the angular momentum factor for mass lost during Roche-lobe overflow
1112
+ ; gamma=-3: assumes mass is lost through the outer Lagrangian point, forming a circumbinary disk. See Zapartas+17 Eq. 9 and Artymowicz & Lubow (1994).
1107
1113
  ; gamma=-2: assumes material is lost from the system as if it is a wind from the secondary (for super-Eddington mass transfer rates)
1108
1114
  ; gamma=-1: assumes the lost material carries with is the specific angular momentum of the primary
1109
1115
  ; gamma>0: assumes that the lost material take away a fraction (gamma) of the orbital angular momentum
@@ -534,6 +534,7 @@ bhspinmag = 0.0
534
534
  eddfac = 1.0
535
535
 
536
536
  ; gamma is the angular momentum factor for mass lost during RLO
537
+ ; gamma=-3: assumes mass is lost through the outer Lagrangian point, forming a circumbinary disk. See Zapartas+17 Eq. 9 and Artymowicz & Lubow (1994).
537
538
  ; gamma=-2: assumes material is lost from the system as if it is a wind from the secondary (for super-Eddington mass transfer rates)
538
539
  ; gamma=-1: assumes the lost material carries with is the specific angular momentum of the primary
539
540
  ; gamma>0: assumes that the lost material take away a fraction (gamma) of the orbital angular momentum
@@ -416,6 +416,7 @@ grflag = 1
416
416
  eddfac = 1.0
417
417
 
418
418
  ; gamma is the angular momentum factor for mass lost during RLO
419
+ ; gamma=-3: assumes mass is lost through the outer Lagrangian point, forming a circumbinary disk. See Zapartas+17 Eq. 9 and Artymowicz & Lubow (1994).
419
420
  ; gamma=-2: assumes material is lost from the system as if it is a wind from the secondary (for super-Eddington mass transfer rates)
420
421
  ; gamma=-1: assumes the lost material carries with is the specific angular momentum of the primary
421
422
  ; gamma>0: assumes that the lost material take away a fraction (gamma) of the orbital angular momentum
@@ -1,7 +1,7 @@
1
1
  project('cosmic',
2
2
  'c',
3
3
  'fortran',
4
- version : '3.4.13',
4
+ version : '3.4.15',
5
5
  default_options: ['warning_level=0', 'optimization=3'],
6
6
  )
7
7
 
@@ -11,23 +11,21 @@ ff = meson.get_compiler('fortran')
11
11
  f_args = ff.get_supported_arguments('-fPIC')
12
12
  add_project_arguments(f_args, language: 'fortran')
13
13
 
14
- py3 = import('python').find_installation()
14
+
15
+ py3 = import('python').find_installation(pure: false)
15
16
 
16
17
  numpy_include_dir = run_command(py3, ['-c', 'import numpy; print(numpy.get_include())'], check: true).stdout().strip()
17
18
  f2py_include_dir = run_command(py3, ['-c', 'import numpy.f2py; print(numpy.f2py.get_include())'], check: true).stdout().strip()
18
19
  inc_np = include_directories(numpy_include_dir, f2py_include_dir)
19
20
 
20
- f2py_source = custom_target(
21
- 'evolvebin-target',
22
- input : ['src/cosmic/src/evolv2.f', 'src/cosmic/src/comprad.f'],
23
- output : ['_evolvebinmodule.c', '_evolvebin-f2pywrappers.f'],
24
- command : [py3, '-m', 'numpy.f2py', '@INPUT@', '-m', '_evolvebin', '--lower', '@OUTDIR']
25
- )
21
+ get_hash = run_command('python', './src/cosmic/get_commit_hash.py', check: true).stdout().strip()
22
+
26
23
 
27
24
  lib_source = [
28
25
  'src/cosmic/src/hrdiag_remnant.f',
29
26
  'src/cosmic/src/assign_remnant.f',
30
27
  'src/cosmic/src/benchmarkevolv2.f',
28
+ 'src/cosmic/src/int64.f',
31
29
  'src/cosmic/src/corerd.f',
32
30
  'src/cosmic/src/comenv.f',
33
31
  'src/cosmic/src/dgcore.f',
@@ -53,7 +51,7 @@ lib_source = [
53
51
  'src/cosmic/src/hrdiag.f',
54
52
  'src/cosmic/src/star.f',
55
53
  'src/cosmic/src/zcnsts.f',
56
- 'src/cosmic/src/zfuncs.f',]
54
+ 'src/cosmic/src/zfuncs.f']
57
55
 
58
56
  # Detect operating system and set appropriate linker flags
59
57
  host_system = host_machine.system()
@@ -64,6 +62,15 @@ else
64
62
  ldflags = [] # No special flags for other systems
65
63
  endif
66
64
 
65
+
66
+ f2py_source = custom_target(
67
+ 'evolvebin-target',
68
+ input : ['src/cosmic/src/evolv2.f', 'src/cosmic/src/comprad.f'],
69
+ output : ['_evolvebinmodule.c', '_evolvebin-f2pywrappers.f'],
70
+ command : [py3, '-m', 'numpy.f2py', '@INPUT@', '-m', '_evolvebin', '--lower']
71
+ )
72
+
73
+
67
74
  evolvebin_module = py3.extension_module('_evolvebin',
68
75
  f2py_source,
69
76
  lib_source,
@@ -71,19 +78,10 @@ evolvebin_module = py3.extension_module('_evolvebin',
71
78
  include_directories: inc_np,
72
79
  link_args: ldflags,
73
80
  install : true,
74
- install_dir : py3.get_install_dir() / 'cosmic'
81
+ subdir : 'cosmic'
75
82
  )
76
83
 
77
-
78
- module_dirs = ['src/cosmic', 'src/cosmic/bse_utils',
79
- 'src/cosmic/sample', 'src/cosmic/tests']
80
-
81
- # Install modules
82
- foreach mod_dir: module_dirs
83
- install_subdir(mod_dir,
84
- install_dir: py3.get_install_dir())
85
- endforeach
86
-
87
-
88
84
  python_script = 'bin/cosmic-pop'
89
85
  install_data(python_script, install_dir: get_option('bindir'))
86
+
87
+ subdir('src/cosmic')
@@ -7,10 +7,10 @@ authors = [
7
7
  { name="Scott Coughlin" },
8
8
  { name="Michael Zevin" },
9
9
  { name="Carl L. Rodriguez" },
10
+ { name="Tom Wagg" },
10
11
  ]
11
12
  readme = "README.md"
12
-
13
-
13
+ version = "3.4.15"
14
14
  requires-python = ">=3.9"
15
15
  license = { text = "MIT License" }
16
16
  classifiers = [
@@ -21,25 +21,12 @@ classifiers = [
21
21
  "Operating System :: OS Independent",
22
22
  "Programming Language :: Python",
23
23
  ]
24
- dynamic = ["version"]
25
- dependencies = ["numpy", "scipy", "astropy", "configparser",
26
- "tqdm", "pandas", "tables", "h5py", "schwimmbad",
24
+ dependencies = ["numpy", "scipy", "astropy", "configparser",
25
+ "tqdm", "pandas", "tables", "h5py", "schwimmbad",
27
26
  "matplotlib", "importlib-metadata"]
28
27
 
29
28
 
30
- [project.optional-dependencies]
31
- test = ["pytest", "pytest-xdist", "pytest-cov", "flake8", "coverage"]
32
- docs = ["sphinx", "numpydoc", "sphinx-bootstrap-theme",
33
- "sphinxcontrib-programoutput", "sphinx-automodapi",
34
- "ipython", "sphinx_rtd_theme", "pickleshare"]
35
-
36
-
37
-
38
29
  [build-system]
39
- requires = ["meson", "meson-python", "wheel", "numpy", "setuptools"]
40
30
  build-backend = 'mesonpy'
31
+ requires = ['meson-python', 'numpy']
41
32
 
42
-
43
- # pyproject.toml
44
- [tool.setuptools]
45
- write_to = "src/cosmic/_version.py"
@@ -22,3 +22,4 @@ flake8 < 5
22
22
  pytest
23
23
  pytest-cov
24
24
  wheel
25
+ meson
@@ -21,8 +21,10 @@
21
21
  """
22
22
 
23
23
  from ._version import __version__
24
+ from ._commit_hash import COMMIT_HASH
24
25
 
25
26
  __version__ = __version__
27
+ __commithash__ = COMMIT_HASH
26
28
  __author__ = "Katie Breivik <katie.breivik@gmail.com>"
27
29
  __credits__ = [
28
30
  "Scott Coughlin <scott.coughlin@ligo.org>",
@@ -0,0 +1 @@
1
+ __version__ = "3.4.15"
@@ -0,0 +1,10 @@
1
+ python_sources = [
2
+ '__init__.py',
3
+ 'zcnsts.py',
4
+ 'zdata.py'
5
+ ]
6
+
7
+ py3.install_sources(
8
+ python_sources,
9
+ subdir: 'cosmic/bse_utils'
10
+ )
@@ -0,0 +1,15 @@
1
+ import subprocess
2
+
3
+ def get_commit_hash():
4
+ # Run git command to get the latest commit hash
5
+ result = subprocess.run(['git', 'rev-parse', 'HEAD'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
6
+ commit_hash = result.stdout.decode('utf-8').strip()
7
+ return commit_hash
8
+
9
+ def write_commit_hash_to_file(commit_hash):
10
+ with open('./src/cosmic/_commit_hash.py', 'w') as f:
11
+ f.write(f'COMMIT_HASH = "{commit_hash}"\n')
12
+
13
+ if __name__ == "__main__":
14
+ commit_hash = get_commit_hash()
15
+ write_commit_hash_to_file(commit_hash)
@@ -0,0 +1,21 @@
1
+ python_sources = [
2
+ '__init__.py',
3
+ '_commit_hash.py',
4
+ '_version.py',
5
+ 'checkstate.py',
6
+ 'evolve.py',
7
+ 'filter.py',
8
+ 'get_commit_hash.py',
9
+ 'Match.py',
10
+ 'plotting.py',
11
+ 'utils.py'
12
+ ]
13
+
14
+ py3.install_sources(
15
+ python_sources,
16
+ subdir: 'cosmic'
17
+ )
18
+
19
+ subdir('bse_utils')
20
+ subdir('sample')
21
+ subdir('tests')
@@ -0,0 +1,10 @@
1
+ python_sources = [
2
+ '__init__.py',
3
+ 'elson.py',
4
+ 'king.py'
5
+ ]
6
+
7
+ py3.install_sources(
8
+ python_sources,
9
+ subdir: 'cosmic/sample/cmc'
10
+ )
@@ -0,0 +1,13 @@
1
+ python_sources = [
2
+ '__init__.py',
3
+ 'initialbinarytable.py',
4
+ 'initialcmctable.py'
5
+ ]
6
+
7
+ py3.install_sources(
8
+ python_sources,
9
+ subdir: 'cosmic/sample'
10
+ )
11
+
12
+ subdir('cmc')
13
+ subdir('sampler')
@@ -49,6 +49,7 @@ def get_independent_sampler(
49
49
  total_mass=np.inf,
50
50
  sampling_target="size",
51
51
  trim_extra_samples=False,
52
+ q_power_law=0,
52
53
  **kwargs
53
54
  ):
54
55
  """Generates an initial binary sample according to user specified models
@@ -73,8 +74,10 @@ def get_independent_sampler(
73
74
  ecc_model : `str`
74
75
  Model to sample eccentricity; choices include: thermal, uniform, sana12
75
76
 
76
- porb_model : `str`
77
+ porb_model : `str` or `dict`
77
78
  Model to sample orbital period; choices include: log_uniform, sana12, raghavan10, moe19
79
+ or a custom power law distribution defined with a dictionary with keys "min", "max", and "slope"
80
+ (e.g. {"min": 0.15, "max": 0.55, "slope": -0.55}) would reproduce the Sana+2012 distribution
78
81
 
79
82
  qmin : `float`
80
83
  kwarg which sets the minimum mass ratio for sampling the secondary
@@ -142,6 +145,11 @@ def get_independent_sampler(
142
145
  zsun : `float`
143
146
  optional kwarg for setting effective radii, default is 0.02
144
147
 
148
+ q_power_law : `float`
149
+ Exponent for the mass ratio distribution power law, default is 0 (flat in q). Note that
150
+ q_power_law cannot be exactly -1, as this would result in a divergent distribution.
151
+
152
+
145
153
  Returns
146
154
  -------
147
155
  InitialBinaryTable : `pandas.DataFrame`
@@ -212,7 +220,7 @@ def get_independent_sampler(
212
220
  ) = initconditions.binary_select(mass1, binfrac_model=binfrac_model, **kwargs)
213
221
 
214
222
  # sample secondary masses for the single stars
215
- mass2_binaries = initconditions.sample_secondary(mass1_binaries, **kwargs)
223
+ mass2_binaries = initconditions.sample_secondary(mass1_binaries, q_power_law=q_power_law, **kwargs)
216
224
 
217
225
  # check if this batch of samples will take us over our sampling target
218
226
  if not target(mass1_binary, size,
@@ -477,7 +485,7 @@ class Sample(object):
477
485
  return u, np.sum(u)
478
486
 
479
487
  # sample secondary mass
480
- def sample_secondary(self, primary_mass, **kwargs):
488
+ def sample_secondary(self, primary_mass, q_power_law=0, **kwargs):
481
489
  """Sample a secondary mass using draws from a uniform mass ratio distribution motivated by
482
490
  `Mazeh et al. (1992) <http://adsabs.harvard.edu/abs/1992ApJ...401..265M>`_
483
491
  and `Goldberg & Mazeh (1994) <http://adsabs.harvard.edu/abs/1994ApJ...429..362G>`_
@@ -590,10 +598,7 @@ class Sample(object):
590
598
  qmin_vals[highmassIdx] = np.maximum(qmin_vals[highmassIdx], m2_min_msort/primary_mass[highmassIdx])
591
599
 
592
600
  # --- now, randomly sample mass ratios and get secondary masses
593
- secondary_mass = np.random.uniform(qmin_vals, 1) * primary_mass
594
-
595
-
596
-
601
+ secondary_mass = utils.rndm(qmin_vals, 1, q_power_law, size=len(primary_mass)) * primary_mass
597
602
  return secondary_mass
598
603
 
599
604
  def binary_select(self, primary_mass, binfrac_model=0.5, **kwargs):
@@ -799,7 +804,7 @@ class Sample(object):
799
804
  radii of the primaries.
800
805
  rad2 : array
801
806
  radii of the secondaries
802
- porb_model : string
807
+ porb_model : `str` or `dict`
803
808
  selects which model to sample orbital periods, choices include:
804
809
  log_uniform : semi-major axis flat in log space from RRLO < 0.5 up to 1e5 Rsun according to
805
810
  `Abt (1983) <http://adsabs.harvard.edu/abs/1983ARA%26A..21..343A>`_
@@ -820,6 +825,9 @@ class Sample(object):
820
825
  `Raghavan+2010 <https://ui.adsabs.harvard.edu/abs/2010ApJS..190....1R/abstract>_`
821
826
  but with different close binary fractions following
822
827
  `Moe+2019 <https://ui.adsabs.harvard.edu/abs/2019ApJ...875...61M/abstract>_`
828
+ Custom power law distribution defined with a dictionary with keys "min", "max", and "slope"
829
+ (e.g. porb_model={"min": 0.15, "max": 0.55, "slope": -0.55}) would reproduce the
830
+ Sana+2012 distribution.
823
831
  met : float
824
832
  metallicity of the population
825
833
 
@@ -900,6 +908,23 @@ class Sample(object):
900
908
  porb = 10 ** utils.rndm(a=log10_porb_min, b=log10_porb_max, g=-0.55, size=size)
901
909
  aRL_over_a = a_min / utils.a_from_p(porb,mass1,mass2)
902
910
 
911
+ elif isinstance(porb_model, dict):
912
+ # use a power law distribution for the orbital periods
913
+ params = {
914
+ "min": 0.15,
915
+ "max": 5.5,
916
+ "slope": -0.55,
917
+ }
918
+ # update the default parameters with the user-supplied ones
919
+ params.update(porb_model)
920
+
921
+ # same calculations as sana12 case (sample from a power law distribution but avoid RLOF)
922
+ log10_RL_porb = np.log10(utils.p_from_a(a_min, mass1, mass2))
923
+ params["min"] = np.full(len(a_min), params["min"])
924
+ params["min"][params["min"] < log10_RL_porb] = log10_RL_porb[params["min"] < log10_RL_porb]
925
+ porb = 10**utils.rndm(a=params["min"], b=params["max"], g=params["slope"], size=size)
926
+ aRL_over_a = a_min / utils.a_from_p(porb, mass1, mass2)
927
+
903
928
  elif porb_model == "renzo19":
904
929
  # Same here: if using CMC, set the maximum porb to the smaller of either the
905
930
  # hard/soft boundary or 5.5 (from Sana paper)
@@ -952,6 +977,7 @@ class Sample(object):
952
977
  from scipy.interpolate import interp1d
953
978
  from scipy.stats import norm
954
979
  from scipy.integrate import trapezoid
980
+
955
981
  try:
956
982
  met = kwargs.pop('met')
957
983
  except: