diffsky 0.1.0__tar.gz → 0.1.2__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 (200) hide show
  1. {diffsky-0.1.0 → diffsky-0.1.2}/.github/workflows/linting.yml +1 -1
  2. diffsky-0.1.2/.github/workflows/monthly-warning-test.yml +58 -0
  3. {diffsky-0.1.0 → diffsky-0.1.2}/.github/workflows/tests.yml +6 -2
  4. diffsky-0.1.2/.github/workflows/tests_cron.yml +88 -0
  5. diffsky-0.1.2/CHANGES.rst +13 -0
  6. {diffsky-0.1.0 → diffsky-0.1.2}/PKG-INFO +10 -10
  7. {diffsky-0.1.0 → diffsky-0.1.2}/README.rst +5 -5
  8. {diffsky-0.1.0 → diffsky-0.1.2}/diffsky/__init__.py +2 -0
  9. diffsky-0.1.2/diffsky/_version.py +1 -0
  10. diffsky-0.1.2/diffsky/burstpop/__init__.py +11 -0
  11. diffsky-0.1.2/diffsky/burstpop/diagnostics/plot_fburstpop.py +60 -0
  12. diffsky-0.1.2/diffsky/burstpop/diagnostics/tests/test_plot_fburstpop.py +15 -0
  13. diffsky-0.1.2/diffsky/burstpop/diffburstpop.py +87 -0
  14. diffsky-0.1.2/diffsky/burstpop/diffqburstpop.py +97 -0
  15. diffsky-0.1.2/diffsky/burstpop/fburstpop.py +139 -0
  16. diffsky-0.1.2/diffsky/burstpop/freqburst.py +141 -0
  17. diffsky-0.1.2/diffsky/burstpop/freqburst_mono.py +156 -0
  18. diffsky-0.1.2/diffsky/burstpop/tburstpop.py +172 -0
  19. diffsky-0.1.2/diffsky/burstpop/tests/test_diffburstpop.py +116 -0
  20. diffsky-0.1.2/diffsky/burstpop/tests/test_diffqburstpop.py +129 -0
  21. diffsky-0.1.2/diffsky/burstpop/tests/test_fburstpop.py +114 -0
  22. diffsky-0.1.2/diffsky/burstpop/tests/test_freqburst.py +121 -0
  23. diffsky-0.1.2/diffsky/burstpop/tests/test_freqburst_mono.py +162 -0
  24. diffsky-0.1.2/diffsky/burstpop/tests/test_tburstpop.py +268 -0
  25. diffsky-0.1.2/diffsky/dustpop/__init__.py +3 -0
  26. diffsky-0.1.2/diffsky/dustpop/avpop.py +128 -0
  27. diffsky-0.1.2/diffsky/dustpop/avpop_flex.py +248 -0
  28. diffsky-0.1.2/diffsky/dustpop/avpop_mono.py +210 -0
  29. diffsky-0.1.2/diffsky/dustpop/deltapop.py +130 -0
  30. diffsky-0.1.2/diffsky/dustpop/diagnostics/plot_avpop_flex.py +175 -0
  31. diffsky-0.1.2/diffsky/dustpop/diagnostics/plot_funopop_simple.py +60 -0
  32. diffsky-0.1.2/diffsky/dustpop/diagnostics/tests/test_plot_avpop_flex.py +18 -0
  33. diffsky-0.1.2/diffsky/dustpop/diagnostics/tests/test_plot_funopop_simple.py +15 -0
  34. diffsky-0.1.2/diffsky/dustpop/funopop.py +298 -0
  35. diffsky-0.1.2/diffsky/dustpop/funopop_simple.py +147 -0
  36. diffsky-0.1.2/diffsky/dustpop/funopop_ssfr.py +101 -0
  37. diffsky-0.1.2/diffsky/dustpop/sbl18_dust.py +33 -0
  38. diffsky-0.1.2/diffsky/dustpop/sbl18_dust_kernels.py +121 -0
  39. diffsky-0.1.2/diffsky/dustpop/sbl18_dustpop.py +174 -0
  40. diffsky-0.1.2/diffsky/dustpop/tests/test_avpop.py +115 -0
  41. diffsky-0.1.2/diffsky/dustpop/tests/test_avpop_flex.py +162 -0
  42. diffsky-0.1.2/diffsky/dustpop/tests/test_avpop_mono.py +246 -0
  43. diffsky-0.1.2/diffsky/dustpop/tests/test_deltapop.py +112 -0
  44. diffsky-0.1.2/diffsky/dustpop/tests/test_funopop_model.py +130 -0
  45. diffsky-0.1.2/diffsky/dustpop/tests/test_funopop_simple.py +104 -0
  46. diffsky-0.1.2/diffsky/dustpop/tests/test_funopop_ssfr.py +103 -0
  47. diffsky-0.1.2/diffsky/dustpop/tests/test_sbl18_dustpop.py +37 -0
  48. diffsky-0.1.2/diffsky/dustpop/tests/test_tw_dust_kernels.py +17 -0
  49. diffsky-0.1.2/diffsky/dustpop/tests/test_tw_dustpop.py +37 -0
  50. diffsky-0.1.2/diffsky/dustpop/tests/test_tw_dustpop_new.py +143 -0
  51. diffsky-0.1.2/diffsky/dustpop/tw_dust.py +33 -0
  52. diffsky-0.1.2/diffsky/dustpop/tw_dust_kernels.py +141 -0
  53. diffsky-0.1.2/diffsky/dustpop/tw_dustpop.py +174 -0
  54. diffsky-0.1.2/diffsky/dustpop/tw_dustpop_new.py +174 -0
  55. diffsky-0.1.2/diffsky/experimental/__init__.py +0 -0
  56. diffsky-0.1.2/diffsky/experimental/dspspop/__init__.py +0 -0
  57. {diffsky-0.1.0 → diffsky-0.1.2}/diffsky/experimental/dspspop/boris_dust.py +28 -5
  58. {diffsky-0.1.0 → diffsky-0.1.2}/diffsky/experimental/dspspop/burstshapepop.py +11 -10
  59. {diffsky-0.1.0 → diffsky-0.1.2}/diffsky/experimental/dspspop/dust_deltapop.py +3 -6
  60. {diffsky-0.1.0 → diffsky-0.1.2}/diffsky/experimental/dspspop/dustpop.py +5 -3
  61. {diffsky-0.1.0 → diffsky-0.1.2}/diffsky/experimental/dspspop/lgavpop.py +3 -7
  62. {diffsky-0.1.0 → diffsky-0.1.2}/diffsky/experimental/dspspop/lgfburstpop.py +3 -6
  63. {diffsky-0.1.0 → diffsky-0.1.2}/diffsky/experimental/dspspop/photpop.py +13 -9
  64. diffsky-0.1.2/diffsky/experimental/dspspop/tests/__init__.py +0 -0
  65. diffsky-0.1.2/diffsky/experimental/dspspop/tests/test_boris_dust.py +36 -0
  66. {diffsky-0.1.0 → diffsky-0.1.2}/diffsky/experimental/dspspop/tests/test_burstshapepop.py +18 -11
  67. diffsky-0.1.2/diffsky/experimental/tests/__init__.py +0 -0
  68. diffsky-0.1.2/diffsky/mass_functions/__init__.py +6 -0
  69. diffsky-0.1.2/diffsky/mass_functions/ccshmf_model.py +97 -0
  70. diffsky-0.1.2/diffsky/mass_functions/fitting_utils/README.rst +1 -0
  71. diffsky-0.1.2/diffsky/mass_functions/fitting_utils/__init__.py +0 -0
  72. diffsky-0.1.2/diffsky/mass_functions/fitting_utils/fit_ccshmf.py +53 -0
  73. diffsky-0.1.2/diffsky/mass_functions/fitting_utils/fit_ccshmf_kernels.py +45 -0
  74. diffsky-0.1.2/diffsky/mass_functions/fitting_utils/fit_hmf_kernels.py +44 -0
  75. diffsky-0.1.2/diffsky/mass_functions/fitting_utils/fit_hmf_model.py +51 -0
  76. diffsky-0.1.2/diffsky/mass_functions/fitting_utils/fitting_helpers.py +182 -0
  77. diffsky-0.1.2/diffsky/mass_functions/fitting_utils/tests/__init__.py +0 -0
  78. diffsky-0.1.2/diffsky/mass_functions/fitting_utils/tests/test_fit_ccshmf.py +57 -0
  79. diffsky-0.1.2/diffsky/mass_functions/fitting_utils/tests/test_fit_ccshmf_kernels.py +28 -0
  80. diffsky-0.1.2/diffsky/mass_functions/fitting_utils/tests/test_fit_hmf_kernels.py +28 -0
  81. diffsky-0.1.2/diffsky/mass_functions/fitting_utils/tests/test_fit_hmf_model.py +84 -0
  82. diffsky-0.1.2/diffsky/mass_functions/hmf_model.py +146 -0
  83. diffsky-0.1.2/diffsky/mass_functions/io_utils/README.txt +2 -0
  84. diffsky-0.1.2/diffsky/mass_functions/io_utils/__init__.py +0 -0
  85. diffsky-0.1.2/diffsky/mass_functions/io_utils/loader.py +33 -0
  86. diffsky-0.1.2/diffsky/mass_functions/io_utils/smdpl_helpers.py +38 -0
  87. diffsky-0.1.2/diffsky/mass_functions/kernels/__init__.py +0 -0
  88. diffsky-0.1.2/diffsky/mass_functions/kernels/ccshmf_kernels.py +44 -0
  89. diffsky-0.1.2/diffsky/mass_functions/kernels/hmf_kernels.py +42 -0
  90. diffsky-0.1.2/diffsky/mass_functions/kernels/tests/__init__.py +0 -0
  91. diffsky-0.1.2/diffsky/mass_functions/kernels/tests/test_ccshmf_kernels.py +12 -0
  92. diffsky-0.1.2/diffsky/mass_functions/kernels/tests/test_hmf_kernels.py +12 -0
  93. diffsky-0.1.2/diffsky/mass_functions/mc_diffmah_tpeak.py +192 -0
  94. diffsky-0.1.2/diffsky/mass_functions/mc_hosts.py +79 -0
  95. diffsky-0.1.2/diffsky/mass_functions/mc_subhalo_catalog.py +129 -0
  96. diffsky-0.1.2/diffsky/mass_functions/mc_subs.py +104 -0
  97. diffsky-0.1.2/diffsky/mass_functions/mc_tinfall.py +65 -0
  98. diffsky-0.1.2/diffsky/mass_functions/measure_ccshmf.py +63 -0
  99. diffsky-0.1.2/diffsky/mass_functions/measure_hmf.py +22 -0
  100. diffsky-0.1.2/diffsky/mass_functions/smhm_kernels/__init__.py +0 -0
  101. diffsky-0.1.2/diffsky/mass_functions/smhm_kernels/tests/__init__.py +0 -0
  102. diffsky-0.1.2/diffsky/mass_functions/smhm_kernels/tests/test_threeroll_smhm.py +112 -0
  103. diffsky-0.1.2/diffsky/mass_functions/smhm_kernels/threeroll_kernels.py +102 -0
  104. diffsky-0.1.2/diffsky/mass_functions/smhm_kernels/threeroll_smhm.py +77 -0
  105. diffsky-0.1.2/diffsky/mass_functions/tests/__init__.py +0 -0
  106. diffsky-0.1.2/diffsky/mass_functions/tests/test_ccshmf.py +92 -0
  107. diffsky-0.1.2/diffsky/mass_functions/tests/test_hmf_model.py +74 -0
  108. diffsky-0.1.2/diffsky/mass_functions/tests/test_mc_diffmah_tpeak.py +26 -0
  109. diffsky-0.1.2/diffsky/mass_functions/tests/test_mc_hosts.py +41 -0
  110. diffsky-0.1.2/diffsky/mass_functions/tests/test_mc_subhalo_catalog.py +21 -0
  111. diffsky-0.1.2/diffsky/mass_functions/tests/test_mc_subs.py +130 -0
  112. diffsky-0.1.2/diffsky/mass_functions/tests/test_mc_tinfall.py +56 -0
  113. diffsky-0.1.2/diffsky/mass_functions/tests/test_measure_hmf.py +32 -0
  114. diffsky-0.1.2/diffsky/mass_functions/tests/testing_data/README.txt +2 -0
  115. diffsky-0.1.2/diffsky/mass_functions/tests/testing_data/__init__.py +0 -0
  116. diffsky-0.1.2/diffsky/mass_functions/tests/testing_data/smdpl_cshmf_cuml_redshift_0.00_lgmhost_12.32.txt +50 -0
  117. diffsky-0.1.2/diffsky/mass_functions/tests/testing_data/smdpl_cshmf_cuml_redshift_0.00_lgmhost_13.00.txt +50 -0
  118. diffsky-0.1.2/diffsky/mass_functions/tests/testing_data/smdpl_cshmf_cuml_redshift_0.00_lgmhost_13.55.txt +50 -0
  119. diffsky-0.1.2/diffsky/mass_functions/tests/testing_data/smdpl_cshmf_cuml_redshift_0.00_lgmhost_14.08.txt +50 -0
  120. diffsky-0.1.2/diffsky/mass_functions/tests/testing_data/smdpl_cshmf_cuml_redshift_1.00_lgmhost_12.31.txt +50 -0
  121. diffsky-0.1.2/diffsky/mass_functions/tests/testing_data/smdpl_cshmf_cuml_redshift_1.00_lgmhost_12.99.txt +50 -0
  122. diffsky-0.1.2/diffsky/mass_functions/tests/testing_data/smdpl_cshmf_cuml_redshift_1.00_lgmhost_13.51.txt +50 -0
  123. diffsky-0.1.2/diffsky/mass_functions/tests/testing_data/smdpl_cshmf_cuml_redshift_1.00_lgmhost_14.05.txt +50 -0
  124. diffsky-0.1.2/diffsky/mass_functions/tests/testing_data/smdpl_hmf_cuml_redshift_0.05.txt +48 -0
  125. diffsky-0.1.2/diffsky/mass_functions/tests/testing_data/smdpl_hmf_cuml_redshift_1.00.txt +47 -0
  126. diffsky-0.1.2/diffsky/mass_functions/tests/testing_data/smdpl_hmf_cuml_redshift_2.14.txt +44 -0
  127. diffsky-0.1.2/diffsky/mass_functions/tests/testing_data/smdpl_hmf_cuml_redshift_3.95.txt +45 -0
  128. diffsky-0.1.2/diffsky/mass_functions/upweighting/__init__.py +0 -0
  129. diffsky-0.1.2/diffsky/mass_functions/upweighting/namedtuple_cat_utils.py +40 -0
  130. diffsky-0.1.2/diffsky/mass_functions/upweighting/tests/__init__.py +0 -0
  131. diffsky-0.1.2/diffsky/mass_functions/upweighting/tests/test_mc_gen_upweighting.py +203 -0
  132. diffsky-0.1.2/diffsky/mass_functions/upweighting/upweighting.py +56 -0
  133. diffsky-0.1.2/diffsky/mass_functions/utils.py +29 -0
  134. diffsky-0.1.2/diffsky/sbl18_photgrad.py +282 -0
  135. diffsky-0.1.2/diffsky/sumstats/__init__.py +0 -0
  136. diffsky-0.1.2/diffsky/sumstats/diffndhist.py +168 -0
  137. diffsky-0.1.2/diffsky/sumstats/smhm.py +43 -0
  138. diffsky-0.1.2/diffsky/sumstats/tests/__init__.py +0 -0
  139. diffsky-0.1.2/diffsky/sumstats/tests/test_smhm.py +19 -0
  140. diffsky-0.1.2/diffsky/systematics/__init__.py +0 -0
  141. diffsky-0.1.2/diffsky/systematics/ssp_errors.py +110 -0
  142. diffsky-0.1.2/diffsky/systematics/tests/__init__.py +0 -0
  143. diffsky-0.1.2/diffsky/systematics/tests/test_ssp_errors.py +108 -0
  144. diffsky-0.1.2/diffsky/tests/__init__.py +0 -0
  145. diffsky-0.1.2/diffsky/tests/test_dependencies.py +9 -0
  146. {diffsky-0.1.0 → diffsky-0.1.2}/diffsky/tests/test_diffsky_setup.py +1 -1
  147. diffsky-0.1.2/diffsky/tests/test_sbl18_photgrad.py +31 -0
  148. diffsky-0.1.2/diffsky/tests/test_tw_photgrad.py +205 -0
  149. diffsky-0.1.2/diffsky/tests/test_utils.py +26 -0
  150. diffsky-0.1.2/diffsky/tests/testing_data/__init__.py +0 -0
  151. diffsky-0.1.2/diffsky/tw_photgrad.py +258 -0
  152. diffsky-0.1.2/diffsky/tw_utils.py +145 -0
  153. diffsky-0.1.2/diffsky/utils.py +69 -0
  154. {diffsky-0.1.0 → diffsky-0.1.2}/diffsky.egg-info/PKG-INFO +10 -10
  155. diffsky-0.1.2/diffsky.egg-info/SOURCES.txt +191 -0
  156. diffsky-0.1.2/diffsky.egg-info/requires.txt +6 -0
  157. {diffsky-0.1.0 → diffsky-0.1.2}/diffsky.egg-info/top_level.txt +0 -1
  158. diffsky-0.1.2/docs/source/demo_diffmahpop_t_peak.ipynb +169 -0
  159. diffsky-0.1.2/docs/source/demos.rst +8 -0
  160. {diffsky-0.1.0 → diffsky-0.1.2}/docs/source/index.rst +1 -0
  161. diffsky-0.1.2/docs/source/installation.rst +31 -0
  162. {diffsky-0.1.0 → diffsky-0.1.2}/docs/source/rtd_environment.yaml +2 -2
  163. {diffsky-0.1.0 → diffsky-0.1.2}/pyproject.toml +7 -5
  164. diffsky-0.1.2/requirements.txt +6 -0
  165. diffsky-0.1.0/CHANGES.rst +0 -3
  166. diffsky-0.1.0/diffsky/_version.py +0 -1
  167. diffsky-0.1.0/diffsky/tests/test_utils.py +0 -13
  168. diffsky-0.1.0/diffsky/utils.py +0 -16
  169. diffsky-0.1.0/diffsky.egg-info/SOURCES.txt +0 -54
  170. diffsky-0.1.0/diffsky.egg-info/requires.txt +0 -6
  171. diffsky-0.1.0/docs/source/installation.rst +0 -48
  172. diffsky-0.1.0/requirements.txt +0 -6
  173. {diffsky-0.1.0 → diffsky-0.1.2}/.coveragerc +0 -0
  174. {diffsky-0.1.0 → diffsky-0.1.2}/.git_archival.txt +0 -0
  175. {diffsky-0.1.0 → diffsky-0.1.2}/.gitattributes +0 -0
  176. {diffsky-0.1.0 → diffsky-0.1.2}/.gitignore +0 -0
  177. {diffsky-0.1.0 → diffsky-0.1.2}/.readthedocs.yml +0 -0
  178. {diffsky-0.1.0 → diffsky-0.1.2}/LICENSE.rst +0 -0
  179. {diffsky-0.1.0/diffsky/experimental → diffsky-0.1.2/diffsky/burstpop/diagnostics}/__init__.py +0 -0
  180. {diffsky-0.1.0/diffsky/experimental/dspspop → diffsky-0.1.2/diffsky/burstpop/diagnostics/tests}/__init__.py +0 -0
  181. {diffsky-0.1.0/diffsky/experimental/dspspop → diffsky-0.1.2/diffsky/burstpop}/tests/__init__.py +0 -0
  182. {diffsky-0.1.0 → diffsky-0.1.2}/diffsky/diffndhist.py +0 -0
  183. {diffsky-0.1.0/diffsky/experimental/tests → diffsky-0.1.2/diffsky/dustpop/diagnostics}/__init__.py +0 -0
  184. {diffsky-0.1.0/diffsky → diffsky-0.1.2/diffsky/dustpop/diagnostics}/tests/__init__.py +0 -0
  185. {diffsky-0.1.0/diffsky/tests/testing_data → diffsky-0.1.2/diffsky/dustpop/tests}/__init__.py +0 -0
  186. {diffsky-0.1.0 → diffsky-0.1.2}/diffsky/experimental/dspspop/nagaraj22_dust.py +0 -0
  187. {diffsky-0.1.0 → diffsky-0.1.2}/diffsky/experimental/dspspop/tests/test_attavpop.py +0 -0
  188. {diffsky-0.1.0 → diffsky-0.1.2}/diffsky/experimental/dspspop/tests/test_dustdeltapop.py +0 -0
  189. {diffsky-0.1.0 → diffsky-0.1.2}/diffsky/experimental/dspspop/tests/test_lgfburstpop.py +0 -0
  190. {diffsky-0.1.0 → diffsky-0.1.2}/diffsky/experimental/dspspop/tests/test_photpop.py +0 -0
  191. {diffsky-0.1.0 → diffsky-0.1.2}/diffsky/experimental/photometry_interpolation.py +0 -0
  192. {diffsky-0.1.0 → diffsky-0.1.2}/diffsky/experimental/tests/test_photometry_interpolation.py +0 -0
  193. {diffsky-0.1.0 → diffsky-0.1.2}/diffsky/tests/test_diffndhist.py +0 -0
  194. {diffsky-0.1.0 → diffsky-0.1.2}/diffsky.egg-info/dependency_links.txt +0 -0
  195. {diffsky-0.1.0 → diffsky-0.1.2}/docs/Makefile +0 -0
  196. {diffsky-0.1.0 → diffsky-0.1.2}/docs/make.bat +0 -0
  197. {diffsky-0.1.0 → diffsky-0.1.2}/docs/source/citation.rst +0 -0
  198. {diffsky-0.1.0 → diffsky-0.1.2}/docs/source/conf.py +0 -0
  199. {diffsky-0.1.0 → diffsky-0.1.2}/setup.cfg +0 -0
  200. {diffsky-0.1.0 → diffsky-0.1.2}/setup.py +0 -0
@@ -16,7 +16,7 @@ jobs:
16
16
 
17
17
  - uses: conda-incubator/setup-miniconda@v2
18
18
  with:
19
- python-version: 3.9
19
+ python-version: 3.11
20
20
  channels: conda-forge,defaults
21
21
  channel-priority: strict
22
22
  show-channel-urls: true
@@ -0,0 +1,58 @@
1
+ name: Test for Warnings
2
+
3
+ on:
4
+ workflow_dispatch: null
5
+ schedule:
6
+ # Runs "First of every month at 3:15am Central"
7
+ - cron: '15 8 1 * *'
8
+
9
+ jobs:
10
+ tests:
11
+ name: tests
12
+ runs-on: "ubuntu-latest"
13
+
14
+ steps:
15
+ - uses: actions/checkout@v2
16
+ with:
17
+ fetch-depth: 0
18
+
19
+ - uses: conda-incubator/setup-miniconda@v2
20
+ with:
21
+ python-version: 3.11
22
+ channels: conda-forge,defaults
23
+ channel-priority: strict
24
+ show-channel-urls: true
25
+ miniforge-version: latest
26
+ miniforge-variant: Mambaforge
27
+ use-mamba: true
28
+
29
+ - name: configure conda and install code
30
+ # Test against current main branch of all diff+ dependencies
31
+ shell: bash -l {0}
32
+ run: |
33
+ conda config --set always_yes yes
34
+ mamba install --quiet \
35
+ --file=requirements.txt
36
+ mamba install -y -q \
37
+ flake8 \
38
+ pytest \
39
+ pytest-xdist \
40
+ pytest-cov \
41
+ pip \
42
+ setuptools \
43
+ "setuptools_scm>=7,<8" \
44
+ matplotlib \
45
+ python-build
46
+ pip uninstall diffmah --yes
47
+ pip uninstall diffstar --yes
48
+ pip uninstall dsps --yes
49
+ pip install --no-deps git+https://github.com/ArgonneCPAC/diffmah.git
50
+ pip install --no-deps git+https://github.com/ArgonneCPAC/diffstar.git
51
+ pip install --no-deps git+https://github.com/ArgonneCPAC/dsps.git
52
+ python -m pip install --no-build-isolation --no-deps -e .
53
+
54
+ - name: test that no warnings are raised
55
+ shell: bash -l {0}
56
+ run: |
57
+ export PYTHONWARNINGS=error
58
+ pytest -v diffsky --cov --cov-report=xml
@@ -1,4 +1,4 @@
1
- name: tests
1
+ name: test-latest-diffstuff-releases
2
2
 
3
3
  on:
4
4
  push:
@@ -18,7 +18,7 @@ jobs:
18
18
 
19
19
  - uses: conda-incubator/setup-miniconda@v2
20
20
  with:
21
- python-version: 3.9
21
+ python-version: 3.11
22
22
  channels: conda-forge,defaults
23
23
  channel-priority: strict
24
24
  show-channel-urls: true
@@ -27,6 +27,7 @@ jobs:
27
27
  use-mamba: true
28
28
 
29
29
  - name: configure conda and install code
30
+ # Test against conda-forge for all dependencies except use main branch for dsps
30
31
  shell: bash -l {0}
31
32
  run: |
32
33
  conda config --set always_yes yes
@@ -40,7 +41,10 @@ jobs:
40
41
  pip \
41
42
  setuptools \
42
43
  "setuptools_scm>=7,<8" \
44
+ matplotlib \
43
45
  python-build
46
+ pip uninstall dsps --yes
47
+ pip install --no-deps git+https://github.com/ArgonneCPAC/dsps.git
44
48
  python -m pip install --no-build-isolation --no-deps -e .
45
49
 
46
50
  - name: test
@@ -0,0 +1,88 @@
1
+ name: test-main-branch-diffstuff
2
+
3
+ on:
4
+ workflow_dispatch: null
5
+ schedule:
6
+ # Runs "every Monday & Thursday at 3:05am Central"
7
+ - cron: '5 8 * * 1,4'
8
+ push:
9
+ branches:
10
+ - main
11
+ pull_request: null
12
+
13
+ jobs:
14
+ tests:
15
+ name: tests
16
+ runs-on: "ubuntu-latest"
17
+
18
+ steps:
19
+ - uses: actions/checkout@v2
20
+ with:
21
+ fetch-depth: 0
22
+
23
+ - uses: conda-incubator/setup-miniconda@v2
24
+ with:
25
+ python-version: 3.11
26
+ channels: conda-forge,defaults
27
+ channel-priority: strict
28
+ show-channel-urls: true
29
+ miniforge-version: latest
30
+ miniforge-variant: Mambaforge
31
+ use-mamba: true
32
+
33
+ - name: configure conda and install code
34
+ # Test against current main branch of all diff+ dependencies
35
+ shell: bash -l {0}
36
+ run: |
37
+ conda config --set always_yes yes
38
+ mamba install --quiet \
39
+ --file=requirements.txt
40
+ mamba install -y -q \
41
+ flake8 \
42
+ pytest \
43
+ pytest-xdist \
44
+ pytest-cov \
45
+ pip \
46
+ setuptools \
47
+ "setuptools_scm>=7,<8" \
48
+ matplotlib \
49
+ python-build
50
+ pip uninstall diffmah --yes
51
+ pip uninstall diffstar --yes
52
+ pip uninstall dsps --yes
53
+ pip install --no-deps git+https://github.com/ArgonneCPAC/diffmah.git
54
+ pip install --no-deps git+https://github.com/ArgonneCPAC/diffstar.git
55
+ pip install --no-deps git+https://github.com/ArgonneCPAC/dsps.git
56
+ python -m pip install --no-build-isolation --no-deps -e .
57
+
58
+ - name: test
59
+ shell: bash -l {0}
60
+ run: |
61
+ pytest -v diffsky --cov --cov-report=xml
62
+
63
+ - name: Upload coverage reports to Codecov
64
+ uses: codecov/codecov-action@v3
65
+
66
+ - name: test versions
67
+ shell: bash -el {0}
68
+ run: |
69
+ pip uninstall diffsky --yes
70
+ [[ $(python setup.py --version) != "0.0.0" ]] || exit 1
71
+
72
+ rm -rf dist/*
73
+ python setup.py sdist
74
+ pip install --no-deps --no-build-isolation dist/*.tar.gz
75
+ pushd ..
76
+ python -c "import diffsky; assert diffsky.__version__ != '0.0.0'"
77
+ popd
78
+ pip uninstall diffsky --yes
79
+
80
+ rm -rf dist/*
81
+ python -m build --sdist . --outdir dist
82
+ pip install --no-deps --no-build-isolation dist/*.tar.gz
83
+ pushd ..
84
+ python -c "import diffsky; assert diffsky.__version__ != '0.0.0'"
85
+ popd
86
+ pip uninstall diffsky --yes
87
+
88
+ python -m pip install -v --no-deps --no-build-isolation -e .
@@ -0,0 +1,13 @@
1
+ 0.1.2 (2024-10-25)
2
+ -------------------
3
+ - Update calls to diffmah v0.6.1 and diffstar v0.3.2
4
+
5
+
6
+ 0.1.1 (2023-10-04)
7
+ -------------------
8
+ - Update calls to dsps v0.3.4
9
+
10
+
11
+ 0.1.0 (2023-10-03)
12
+ -------------------
13
+ - First release. Compatible with diffstar v0.2.1 and dsps v0.3.3.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: diffsky
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: Library for differentiable generation of synthetic skies
5
5
  Author-email: Andrew Hearin <ahearin@anl.gov>
6
6
  License: BSD 3-Clause License
@@ -35,28 +35,28 @@ License: BSD 3-Clause License
35
35
 
36
36
  Project-URL: home, https://github.com/ArgonneCPAC/diffsky
37
37
  Classifier: Programming Language :: Python :: 3
38
- Requires-Python: >=3.9
38
+ Requires-Python: >=3.11
39
39
  Description-Content-Type: text/x-rst
40
40
  License-File: LICENSE.rst
41
41
  Requires-Dist: numpy
42
42
  Requires-Dist: jax
43
- Requires-Dist: h5py
44
- Requires-Dist: diffmah
45
- Requires-Dist: diffstar
43
+ Requires-Dist: diffmah>=0.6.1
44
+ Requires-Dist: diffstar>=0.3.2
46
45
  Requires-Dist: dsps
46
+ Requires-Dist: h5py
47
47
 
48
48
  diffsky
49
49
  ============
50
50
 
51
- Code for producing mock catalogs based on
51
+ Diffsky is a python library based on JAX for producing mock catalogs based on
52
52
  `diffstar <https://diffstar.readthedocs.io/en/latest/>`_
53
53
  and `dsps <https://dsps.readthedocs.io/en/latest/>`_.
54
54
 
55
55
  Installation
56
56
  ------------
57
- The latest release of diffsky is available for installation with pip or conda::
57
+ The latest release of diffsky is available for installation with pip or conda-forge::
58
58
 
59
- $ conda install diffsky
59
+ $ conda install -c conda-forge diffsky
60
60
 
61
61
 
62
62
  To install diffsky into your environment from the source code::
@@ -67,9 +67,9 @@ To install diffsky into your environment from the source code::
67
67
 
68
68
  Conda environment
69
69
  ~~~~~~~~~~~~~~~~~
70
- For a typical development environment in conda::
70
+ For a typical development environment in conda-forge::
71
71
 
72
- $ conda create -n diffsky_env python=3.9 numpy jax pytest ipython jupyter matplotlib scipy h5py diffmah diffstar dsps diffsky
72
+ $ conda create -c conda-forge -n diffsky_env python=3.11 numpy jax pytest ipython jupyter matplotlib scipy h5py diffmah diffstar dsps diffsky
73
73
 
74
74
 
75
75
  Documentation
@@ -1,15 +1,15 @@
1
1
  diffsky
2
2
  ============
3
3
 
4
- Code for producing mock catalogs based on
4
+ Diffsky is a python library based on JAX for producing mock catalogs based on
5
5
  `diffstar <https://diffstar.readthedocs.io/en/latest/>`_
6
6
  and `dsps <https://dsps.readthedocs.io/en/latest/>`_.
7
7
 
8
8
  Installation
9
9
  ------------
10
- The latest release of diffsky is available for installation with pip or conda::
10
+ The latest release of diffsky is available for installation with pip or conda-forge::
11
11
 
12
- $ conda install diffsky
12
+ $ conda install -c conda-forge diffsky
13
13
 
14
14
 
15
15
  To install diffsky into your environment from the source code::
@@ -20,9 +20,9 @@ To install diffsky into your environment from the source code::
20
20
 
21
21
  Conda environment
22
22
  ~~~~~~~~~~~~~~~~~
23
- For a typical development environment in conda::
23
+ For a typical development environment in conda-forge::
24
24
 
25
- $ conda create -n diffsky_env python=3.9 numpy jax pytest ipython jupyter matplotlib scipy h5py diffmah diffstar dsps diffsky
25
+ $ conda create -c conda-forge -n diffsky_env python=3.11 numpy jax pytest ipython jupyter matplotlib scipy h5py diffmah diffstar dsps diffsky
26
26
 
27
27
 
28
28
  Documentation
@@ -1,5 +1,7 @@
1
1
  """
2
2
  """
3
+
3
4
  # flake8: noqa
4
5
 
5
6
  from ._version import __version__
7
+ from .mass_functions.mc_diffmah_tpeak import mc_subhalos
@@ -0,0 +1 @@
1
+ __version__ = '0.1.2'
@@ -0,0 +1,11 @@
1
+ """
2
+ """
3
+ # flake8: noqa
4
+
5
+ from .diffburstpop import (
6
+ DEFAULT_DIFFBURSTPOP_PARAMS,
7
+ DEFAULT_DIFFBURSTPOP_U_PARAMS,
8
+ calc_bursty_age_weights_from_diffburstpop_params,
9
+ get_bounded_diffburstpop_params,
10
+ get_unbounded_diffburstpop_params,
11
+ )
@@ -0,0 +1,60 @@
1
+ """
2
+ """
3
+
4
+ import numpy as np
5
+ from matplotlib import pyplot as plt
6
+
7
+ from ..fburstpop import DEFAULT_FBURSTPOP_PARAMS, get_lgfburst_from_fburstpop_params
8
+
9
+
10
+ def make_fburstpop_comparison_plot(
11
+ params,
12
+ params2=DEFAULT_FBURSTPOP_PARAMS,
13
+ fname=None,
14
+ label1=r"${\rm new\ model}$",
15
+ label2=r"${\rm default\ model}$",
16
+ ):
17
+ """Make basic diagnostic plot of the model for Fburst
18
+
19
+ Parameters
20
+ ----------
21
+ params : namedtuple
22
+ Instance of fburstpop.FburstPopParams
23
+
24
+ params2 : namedtuple, optional
25
+ Instance of fburstpop.FburstPopParams
26
+ Default is set by DEFAULT_FBURSTPOP_PARAMS
27
+
28
+ fname : string, optional
29
+ filename of the output figure
30
+
31
+ """
32
+ nsm, nsfr = 250, 250
33
+ logsm_grid = np.linspace(7, 12, nsm)
34
+ logssfr_grid = np.linspace(-13, -8, nsfr)
35
+
36
+ X, Y = np.meshgrid(logsm_grid, logssfr_grid)
37
+
38
+ Z = get_lgfburst_from_fburstpop_params(params, X, Y)
39
+ Z2 = get_lgfburst_from_fburstpop_params(params2, X, Y)
40
+
41
+ fig, axes = plt.subplots(1, 2, figsize=(10, 4))
42
+ (ax0, ax1) = axes
43
+
44
+ pcm0 = ax0.pcolor(X, Y, Z, cmap="coolwarm_r", vmin=-4.5, vmax=-2.1)
45
+ fig.colorbar(pcm0, ax=ax0)
46
+
47
+ pcm1 = ax1.pcolor(X, Y, Z2, cmap="coolwarm_r", vmin=-4.5, vmax=-2.1)
48
+ fig.colorbar(pcm1, ax=ax1, label=r"${\rm lgFburst}$")
49
+ for ax in axes:
50
+ xlabel = ax.set_xlabel(r"$\log_{10}M_{\star}/M_{\odot}$")
51
+ ylabel = ax0.set_ylabel(r"${\rm \log_{10}sSFR}$")
52
+
53
+ ax0.set_title(label1)
54
+ ax1.set_title(label2)
55
+
56
+ if fname is not None:
57
+ fig.savefig(
58
+ fname, bbox_extra_artists=[xlabel, ylabel], bbox_inches="tight", dpi=200
59
+ )
60
+ return fig
@@ -0,0 +1,15 @@
1
+ """
2
+ """
3
+
4
+ import os
5
+
6
+ from ..plot_fburstpop import DEFAULT_FBURSTPOP_PARAMS, make_fburstpop_comparison_plot
7
+
8
+ _THIS_DRNAME = os.path.dirname(os.path.abspath(__file__))
9
+
10
+
11
+ def test_make_freqburst_comparison_plot():
12
+ fn = os.path.join(_THIS_DRNAME, "dummy.png")
13
+ make_fburstpop_comparison_plot(DEFAULT_FBURSTPOP_PARAMS, fname=fn)
14
+ assert os.path.isfile(fn)
15
+ os.remove(fn)
@@ -0,0 +1,87 @@
1
+ """
2
+ """
3
+ from collections import namedtuple
4
+
5
+ from dsps.sfh.diffburst import BurstParams, calc_bursty_age_weights
6
+ from jax import jit as jjit
7
+
8
+ from .fburstpop import (
9
+ DEFAULT_FBURSTPOP_PARAMS,
10
+ get_bounded_fburstpop_params,
11
+ get_lgfburst_from_fburstpop_params,
12
+ get_unbounded_fburstpop_params,
13
+ )
14
+ from .tburstpop import (
15
+ DEFAULT_TBURSTPOP_PARAMS,
16
+ get_bounded_tburstpop_params,
17
+ get_tburst_params_from_tburstpop_params,
18
+ get_unbounded_tburstpop_params,
19
+ )
20
+
21
+ DiffburstPopParams = namedtuple(
22
+ "DiffburstPopParams", ["fburstpop_params", "tburstpop_params"]
23
+ )
24
+ DEFAULT_DIFFBURSTPOP_PARAMS = DiffburstPopParams(
25
+ DEFAULT_FBURSTPOP_PARAMS, DEFAULT_TBURSTPOP_PARAMS
26
+ )
27
+ _BURSTPOP_UPNAMES = [
28
+ key.replace("params", "u_params") for key in DEFAULT_DIFFBURSTPOP_PARAMS._fields
29
+ ]
30
+ DiffburstPopUParams = namedtuple("DiffburstPopUParams", _BURSTPOP_UPNAMES)
31
+
32
+
33
+ @jjit
34
+ def get_bounded_diffburstpop_params(u_params):
35
+ u_fburstpop_params, u_tburstpop_params = u_params
36
+ bounded_tburstpop_params = get_bounded_tburstpop_params(u_tburstpop_params)
37
+ bounded_fburstpop_params = get_bounded_fburstpop_params(u_fburstpop_params)
38
+ diffburstpop_params = DiffburstPopParams(
39
+ bounded_fburstpop_params, bounded_tburstpop_params
40
+ )
41
+ return diffburstpop_params
42
+
43
+
44
+ @jjit
45
+ def get_unbounded_diffburstpop_params(params):
46
+ fburstpop_params, tburstpop_params = params
47
+ unbounded_fburstpop_params = get_unbounded_fburstpop_params(fburstpop_params)
48
+ unbounded_tburstpop_params = get_unbounded_tburstpop_params(tburstpop_params)
49
+ diffburstpop_u_params = DiffburstPopUParams(
50
+ unbounded_fburstpop_params, unbounded_tburstpop_params
51
+ )
52
+ return diffburstpop_u_params
53
+
54
+
55
+ @jjit
56
+ def calc_bursty_age_weights_from_diffburstpop_params(
57
+ diffburstpop_params, logsm, logssfr, ssp_lg_age_gyr, smooth_age_weights
58
+ ):
59
+ lgfburst = get_lgfburst_from_fburstpop_params(
60
+ diffburstpop_params.fburstpop_params, logsm, logssfr
61
+ )
62
+
63
+ tburst_params = get_tburst_params_from_tburstpop_params(
64
+ diffburstpop_params.tburstpop_params, logsm, logssfr
65
+ )
66
+ lgyr_peak, lgyr_max = tburst_params
67
+ burst_params = BurstParams(lgfburst, lgyr_peak, lgyr_max)
68
+
69
+ age_weights = calc_bursty_age_weights(
70
+ burst_params, smooth_age_weights, ssp_lg_age_gyr
71
+ )
72
+
73
+ return age_weights, burst_params
74
+
75
+
76
+ def calc_bursty_age_weights_from_diffburstpop_u_params(
77
+ diffburstpop_u_params, logsm, logssfr, ssp_lg_age_gyr, smooth_age_weights
78
+ ):
79
+ diffburstpop_params = get_bounded_diffburstpop_params(diffburstpop_u_params)
80
+ args = diffburstpop_params, logsm, logssfr, ssp_lg_age_gyr, smooth_age_weights
81
+ age_weights, burst_params = calc_bursty_age_weights_from_diffburstpop_params(*args)
82
+ return age_weights, burst_params
83
+
84
+
85
+ DEFAULT_DIFFBURSTPOP_U_PARAMS = DiffburstPopUParams(
86
+ *get_unbounded_diffburstpop_params(DEFAULT_DIFFBURSTPOP_PARAMS)
87
+ )
@@ -0,0 +1,97 @@
1
+ """
2
+ """
3
+
4
+ from collections import namedtuple
5
+
6
+ from dsps.sfh.diffburst import BurstParams, calc_bursty_age_weights
7
+ from jax import jit as jjit
8
+
9
+ from .fburstpop import (
10
+ DEFAULT_FBURSTPOP_PARAMS,
11
+ get_bounded_fburstpop_params,
12
+ get_lgfburst_from_fburstpop_params,
13
+ get_unbounded_fburstpop_params,
14
+ )
15
+ from .freqburst import (
16
+ DEFAULT_FREQBURST_PARAMS,
17
+ get_bounded_freqburst_params,
18
+ get_unbounded_freqburst_params,
19
+ )
20
+ from .tburstpop import (
21
+ DEFAULT_TBURSTPOP_PARAMS,
22
+ get_bounded_tburstpop_params,
23
+ get_tburst_params_from_tburstpop_params,
24
+ get_unbounded_tburstpop_params,
25
+ )
26
+
27
+ DiffburstPopParams = namedtuple(
28
+ "DiffburstPopParams", ["freqburst_params", "fburstpop_params", "tburstpop_params"]
29
+ )
30
+ DEFAULT_DIFFBURSTPOP_PARAMS = DiffburstPopParams(
31
+ DEFAULT_FREQBURST_PARAMS, DEFAULT_FBURSTPOP_PARAMS, DEFAULT_TBURSTPOP_PARAMS
32
+ )
33
+ _BURSTPOP_UPNAMES = [
34
+ key.replace("params", "u_params") for key in DEFAULT_DIFFBURSTPOP_PARAMS._fields
35
+ ]
36
+ DiffburstPopUParams = namedtuple("DiffburstPopUParams", _BURSTPOP_UPNAMES)
37
+
38
+
39
+ @jjit
40
+ def get_bounded_diffburstpop_params(u_params):
41
+ u_freqburst_params, u_fburstpop_params, u_tburstpop_params = u_params
42
+ bounded_freqburst_params = get_bounded_freqburst_params(u_freqburst_params)
43
+ bounded_tburstpop_params = get_bounded_tburstpop_params(u_tburstpop_params)
44
+ bounded_fburstpop_params = get_bounded_fburstpop_params(u_fburstpop_params)
45
+ diffburstpop_params = DiffburstPopParams(
46
+ bounded_freqburst_params, bounded_fburstpop_params, bounded_tburstpop_params
47
+ )
48
+ return diffburstpop_params
49
+
50
+
51
+ @jjit
52
+ def get_unbounded_diffburstpop_params(params):
53
+ freqburst_params, fburstpop_params, tburstpop_params = params
54
+ unbounded_freqburst_params = get_unbounded_freqburst_params(freqburst_params)
55
+ unbounded_fburstpop_params = get_unbounded_fburstpop_params(fburstpop_params)
56
+ unbounded_tburstpop_params = get_unbounded_tburstpop_params(tburstpop_params)
57
+ diffburstpop_u_params = DiffburstPopUParams(
58
+ unbounded_freqburst_params,
59
+ unbounded_fburstpop_params,
60
+ unbounded_tburstpop_params,
61
+ )
62
+ return diffburstpop_u_params
63
+
64
+
65
+ @jjit
66
+ def calc_bursty_age_weights_from_diffburstpop_params(
67
+ diffburstpop_params, logsm, logssfr, ssp_lg_age_gyr, smooth_age_weights
68
+ ):
69
+ lgfburst = get_lgfburst_from_fburstpop_params(
70
+ diffburstpop_params.fburstpop_params, logsm, logssfr
71
+ )
72
+
73
+ tburst_params = get_tburst_params_from_tburstpop_params(
74
+ diffburstpop_params.tburstpop_params, logsm, logssfr
75
+ )
76
+ lgyr_peak, lgyr_max = tburst_params
77
+ burst_params = BurstParams(lgfburst, lgyr_peak, lgyr_max)
78
+
79
+ age_weights = calc_bursty_age_weights(
80
+ burst_params, smooth_age_weights, ssp_lg_age_gyr
81
+ )
82
+
83
+ return age_weights, burst_params
84
+
85
+
86
+ def calc_bursty_age_weights_from_diffburstpop_u_params(
87
+ diffburstpop_u_params, logsm, logssfr, ssp_lg_age_gyr, smooth_age_weights
88
+ ):
89
+ diffburstpop_params = get_bounded_diffburstpop_params(diffburstpop_u_params)
90
+ args = diffburstpop_params, logsm, logssfr, ssp_lg_age_gyr, smooth_age_weights
91
+ age_weights, burst_params = calc_bursty_age_weights_from_diffburstpop_params(*args)
92
+ return age_weights, burst_params
93
+
94
+
95
+ DEFAULT_DIFFBURSTPOP_U_PARAMS = DiffburstPopUParams(
96
+ *get_unbounded_diffburstpop_params(DEFAULT_DIFFBURSTPOP_PARAMS)
97
+ )