ciceroscm 0.0.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 (204) hide show
  1. ciceroscm-0.0.0/.bandit.yml +2 -0
  2. ciceroscm-0.0.0/.coveragerc +13 -0
  3. ciceroscm-0.0.0/.gitattributes +1 -0
  4. ciceroscm-0.0.0/.github/ISSUE_TEMPLATE/bug_report.md +30 -0
  5. ciceroscm-0.0.0/.github/ISSUE_TEMPLATE/feature_request.md +21 -0
  6. ciceroscm-0.0.0/.github/pull_request_template.md +6 -0
  7. ciceroscm-0.0.0/.github/workflows/ci-cd-workflow.yml +185 -0
  8. ciceroscm-0.0.0/.github/workflows/publish.yml +30 -0
  9. ciceroscm-0.0.0/.gitignore +137 -0
  10. ciceroscm-0.0.0/.pylintrc +30 -0
  11. ciceroscm-0.0.0/.vscode/settings.json +7 -0
  12. ciceroscm-0.0.0/CHANGELOG.rst +124 -0
  13. ciceroscm-0.0.0/LICENSE +201 -0
  14. ciceroscm-0.0.0/MANIFEST.in +2 -0
  15. ciceroscm-0.0.0/Makefile +113 -0
  16. ciceroscm-0.0.0/PKG-INFO +303 -0
  17. ciceroscm-0.0.0/README.md +247 -0
  18. ciceroscm-0.0.0/README.rst +53 -0
  19. ciceroscm-0.0.0/docs/Makefile +20 -0
  20. ciceroscm-0.0.0/docs/make.bat +35 -0
  21. ciceroscm-0.0.0/docs/source/_static/.gitkeep +0 -0
  22. ciceroscm-0.0.0/docs/source/_templates/layout.html +23 -0
  23. ciceroscm-0.0.0/docs/source/carbon_cycle_mod.rst +6 -0
  24. ciceroscm-0.0.0/docs/source/changelog.rst +1 -0
  25. ciceroscm-0.0.0/docs/source/ciceroscm.rst +6 -0
  26. ciceroscm-0.0.0/docs/source/concentrations_emissions_handler.rst +6 -0
  27. ciceroscm-0.0.0/docs/source/conf.py +222 -0
  28. ciceroscm-0.0.0/docs/source/development.rst +178 -0
  29. ciceroscm-0.0.0/docs/source/index.rst +46 -0
  30. ciceroscm-0.0.0/docs/source/input_handler.rst +6 -0
  31. ciceroscm-0.0.0/docs/source/make_plots.rst +6 -0
  32. ciceroscm-0.0.0/docs/source/perturbations.rst +6 -0
  33. ciceroscm-0.0.0/docs/source/pub_utils.rst +6 -0
  34. ciceroscm-0.0.0/docs/source/rfuns.rst +6 -0
  35. ciceroscm-0.0.0/docs/source/upwelling_diffusion_model.rst +6 -0
  36. ciceroscm-0.0.0/docs/source/usage.rst +7 -0
  37. ciceroscm-0.0.0/notebooks/CSCM_example_directinput.ipynb +1517 -0
  38. ciceroscm-0.0.0/notebooks/CSCM_example_parallel.ipynb +1718 -0
  39. ciceroscm-0.0.0/notebooks/CSCM_example_regional_aerosols.ipynb +1208 -0
  40. ciceroscm-0.0.0/notebooks/CSCM_example_structural_switch.ipynb +1206 -0
  41. ciceroscm-0.0.0/notebooks/CSCM_example_textinput.ipynb +598 -0
  42. ciceroscm-0.0.0/notebooks/CSCM_test_custom_rfunc.ipynb +1193 -0
  43. ciceroscm-0.0.0/pyproject.toml +103 -0
  44. ciceroscm-0.0.0/scripts/plot/plot_conc.py +77 -0
  45. ciceroscm-0.0.0/scripts/plot/plot_conc_compare.py +56 -0
  46. ciceroscm-0.0.0/scripts/plot/plot_conc_halocarbons_compare.py +94 -0
  47. ciceroscm-0.0.0/scripts/plot/plot_emis.py +76 -0
  48. ciceroscm-0.0.0/scripts/plot/plot_ohc.py +33 -0
  49. ciceroscm-0.0.0/scripts/plot/plot_ohc_compare.py +75 -0
  50. ciceroscm-0.0.0/scripts/plot/plot_rf.py +68 -0
  51. ciceroscm-0.0.0/scripts/plot/plot_rf_compare.py +154 -0
  52. ciceroscm-0.0.0/scripts/plot/plot_rib.py +35 -0
  53. ciceroscm-0.0.0/scripts/plot/plot_temp.py +68 -0
  54. ciceroscm-0.0.0/scripts/plot/plot_temp_compare.py +52 -0
  55. ciceroscm-0.0.0/scripts/pre_script/make_em_pertfile.py +38 -0
  56. ciceroscm-0.0.0/scripts/pre_script/make_forc_pertfile.py +42 -0
  57. ciceroscm-0.0.0/scripts/pre_script/pertem_test.txt +4 -0
  58. ciceroscm-0.0.0/scripts/pre_script/pertforc_test.txt +4 -0
  59. ciceroscm-0.0.0/scripts/pre_script/precalculate_natural_emissions.py +159 -0
  60. ciceroscm-0.0.0/scripts/run_conc.py +32 -0
  61. ciceroscm-0.0.0/scripts/run_full_change_all_pams.py +55 -0
  62. ciceroscm-0.0.0/scripts/run_full_emissions.py +23 -0
  63. ciceroscm-0.0.0/scripts/run_full_emissions_profile.py +46 -0
  64. ciceroscm-0.0.0/scripts/run_full_forcing.py +27 -0
  65. ciceroscm-0.0.0/scripts/run_full_forcing_profile.py +43 -0
  66. ciceroscm-0.0.0/scripts/run_perturbations.py +49 -0
  67. ciceroscm-0.0.0/scripts/run_scm.py +33 -0
  68. ciceroscm-0.0.0/scripts/run_ssps_local.py +47 -0
  69. ciceroscm-0.0.0/scripts/test_install.py +35 -0
  70. ciceroscm-0.0.0/setup.cfg +4 -0
  71. ciceroscm-0.0.0/src/ciceroscm/__init__.py +8 -0
  72. ciceroscm-0.0.0/src/ciceroscm/_utils.py +151 -0
  73. ciceroscm-0.0.0/src/ciceroscm/_version.py +657 -0
  74. ciceroscm-0.0.0/src/ciceroscm/carbon_cycle/__init__.py +3 -0
  75. ciceroscm-0.0.0/src/ciceroscm/carbon_cycle/carbon_cycle_abstract.py +363 -0
  76. ciceroscm-0.0.0/src/ciceroscm/carbon_cycle/carbon_cycle_mod.py +787 -0
  77. ciceroscm-0.0.0/src/ciceroscm/carbon_cycle/carbon_cycle_mod_box.py +234 -0
  78. ciceroscm-0.0.0/src/ciceroscm/carbon_cycle/common_carbon_cycle_functions.py +120 -0
  79. ciceroscm-0.0.0/src/ciceroscm/carbon_cycle/rfuns.py +291 -0
  80. ciceroscm-0.0.0/src/ciceroscm/ciceroscm.py +412 -0
  81. ciceroscm-0.0.0/src/ciceroscm/component_factory_functions.py +63 -0
  82. ciceroscm-0.0.0/src/ciceroscm/concentrations_emissions_handler.py +1064 -0
  83. ciceroscm-0.0.0/src/ciceroscm/constants.py +23 -0
  84. ciceroscm-0.0.0/src/ciceroscm/default_data/IPCC_LUCalbedo.txt +751 -0
  85. ciceroscm-0.0.0/src/ciceroscm/default_data/meanVOLCmnd_ipcc_NH.txt +751 -0
  86. ciceroscm-0.0.0/src/ciceroscm/default_data/solar_IPCC.txt +751 -0
  87. ciceroscm-0.0.0/src/ciceroscm/formattingtools/reformat_cscm_results.py +291 -0
  88. ciceroscm-0.0.0/src/ciceroscm/formattingtools/reformat_inputdata_to_cscm_format.py +135 -0
  89. ciceroscm-0.0.0/src/ciceroscm/input_handler.py +615 -0
  90. ciceroscm-0.0.0/src/ciceroscm/make_plots.py +233 -0
  91. ciceroscm-0.0.0/src/ciceroscm/parallel/__init__.py +1 -0
  92. ciceroscm-0.0.0/src/ciceroscm/parallel/_configdistro.py +369 -0
  93. ciceroscm-0.0.0/src/ciceroscm/parallel/_parallel_process.py +194 -0
  94. ciceroscm-0.0.0/src/ciceroscm/parallel/cscmparwrapper.py +222 -0
  95. ciceroscm-0.0.0/src/ciceroscm/parallel/distributionrun.py +97 -0
  96. ciceroscm-0.0.0/src/ciceroscm/perturbations.py +228 -0
  97. ciceroscm-0.0.0/src/ciceroscm/pub_utils.py +214 -0
  98. ciceroscm-0.0.0/src/ciceroscm/thermal_model/abstract_thermal_model.py +93 -0
  99. ciceroscm-0.0.0/src/ciceroscm/thermal_model/two_layer_ocean.py +201 -0
  100. ciceroscm-0.0.0/src/ciceroscm/thermal_model/upwelling_diffusion_model.py +703 -0
  101. ciceroscm-0.0.0/src/ciceroscm.egg-info/PKG-INFO +303 -0
  102. ciceroscm-0.0.0/src/ciceroscm.egg-info/SOURCES.txt +202 -0
  103. ciceroscm-0.0.0/src/ciceroscm.egg-info/dependency_links.txt +1 -0
  104. ciceroscm-0.0.0/src/ciceroscm.egg-info/requires.txt +43 -0
  105. ciceroscm-0.0.0/src/ciceroscm.egg-info/top_level.txt +1 -0
  106. ciceroscm-0.0.0/tests/conftest.py +12 -0
  107. ciceroscm-0.0.0/tests/integration/test_carbon_cycle_variables_integrated.py +219 -0
  108. ciceroscm-0.0.0/tests/integration/test_configdistro_compatibility.py +136 -0
  109. ciceroscm-0.0.0/tests/integration/test_different_decay.py +191 -0
  110. ciceroscm-0.0.0/tests/integration/test_distro_run.py +78 -0
  111. ciceroscm-0.0.0/tests/integration/test_factory_integration.py +129 -0
  112. ciceroscm-0.0.0/tests/integration/test_feedback_variable_passing.py +36 -0
  113. ciceroscm-0.0.0/tests/integration/test_flat_carbon_parameters.py +396 -0
  114. ciceroscm-0.0.0/tests/integration/test_parallel_run.py +587 -0
  115. ciceroscm-0.0.0/tests/integration/test_regional_aerosols.py +88 -0
  116. ciceroscm-0.0.0/tests/integration/test_scm_conc.py +433 -0
  117. ciceroscm-0.0.0/tests/integration/test_scm_forc.py +221 -0
  118. ciceroscm-0.0.0/tests/integration/test_scm_pertrun.py +176 -0
  119. ciceroscm-0.0.0/tests/integration/test_scm_plot.py +46 -0
  120. ciceroscm-0.0.0/tests/notebook-tests.cfg +11 -0
  121. ciceroscm-0.0.0/tests/test-data/1_year_blipp/output_conc.txt +752 -0
  122. ciceroscm-0.0.0/tests/test-data/1_year_blipp/output_em.txt +752 -0
  123. ciceroscm-0.0.0/tests/test-data/1_year_blipp/output_forc.txt +752 -0
  124. ciceroscm-0.0.0/tests/test-data/1_year_blipp/output_ohc.txt +352 -0
  125. ciceroscm-0.0.0/tests/test-data/1_year_blipp/output_rib.txt +352 -0
  126. ciceroscm-0.0.0/tests/test-data/1_year_blipp/output_sunvolc.txt +352 -0
  127. ciceroscm-0.0.0/tests/test-data/1_year_blipp/output_temp.txt +352 -0
  128. ciceroscm-0.0.0/tests/test-data/1pct_CO2/output_conc.txt +352 -0
  129. ciceroscm-0.0.0/tests/test-data/1pct_CO2/output_em.txt +352 -0
  130. ciceroscm-0.0.0/tests/test-data/1pct_CO2/output_forc.txt +352 -0
  131. ciceroscm-0.0.0/tests/test-data/1pct_CO2/output_ohc.txt +352 -0
  132. ciceroscm-0.0.0/tests/test-data/1pct_CO2/output_rib.txt +752 -0
  133. ciceroscm-0.0.0/tests/test-data/1pct_CO2/output_sunvolc.txt +352 -0
  134. ciceroscm-0.0.0/tests/test-data/1pct_CO2/output_temp.txt +352 -0
  135. ciceroscm-0.0.0/tests/test-data/1pct_CO2_no_sunvolc/output_conc.txt +752 -0
  136. ciceroscm-0.0.0/tests/test-data/1pct_CO2_no_sunvolc/output_em.txt +752 -0
  137. ciceroscm-0.0.0/tests/test-data/1pct_CO2_no_sunvolc/output_forc.txt +752 -0
  138. ciceroscm-0.0.0/tests/test-data/1pct_CO2_no_sunvolc/output_ohc.txt +352 -0
  139. ciceroscm-0.0.0/tests/test-data/1pct_CO2_no_sunvolc/output_rib.txt +352 -0
  140. ciceroscm-0.0.0/tests/test-data/1pct_CO2_no_sunvolc/output_sunvolc.txt +352 -0
  141. ciceroscm-0.0.0/tests/test-data/1pct_CO2_no_sunvolc/output_temp.txt +352 -0
  142. ciceroscm-0.0.0/tests/test-data/AR6_ERF_1750-2019.csv +271 -0
  143. ciceroscm-0.0.0/tests/test-data/CO2_1pros.txt +736 -0
  144. ciceroscm-0.0.0/tests/test-data/HTAP_reg_aerosol_RF.txt +14 -0
  145. ciceroscm-0.0.0/tests/test-data/IPCC_LUCalbedo.txt +751 -0
  146. ciceroscm-0.0.0/tests/test-data/all_zero/output_forc.txt +352 -0
  147. ciceroscm-0.0.0/tests/test-data/all_zero/output_ohc.csv +352 -0
  148. ciceroscm-0.0.0/tests/test-data/all_zero/output_ohc.txt +352 -0
  149. ciceroscm-0.0.0/tests/test-data/all_zero/output_ohc.txt~ +352 -0
  150. ciceroscm-0.0.0/tests/test-data/all_zero/output_rib.csv +352 -0
  151. ciceroscm-0.0.0/tests/test-data/all_zero/output_rib.txt +352 -0
  152. ciceroscm-0.0.0/tests/test-data/all_zero/output_temp.csv +352 -0
  153. ciceroscm-0.0.0/tests/test-data/all_zero/output_temp.txt +352 -0
  154. ciceroscm-0.0.0/tests/test-data/gases_v1RCMIP.txt +47 -0
  155. ciceroscm-0.0.0/tests/test-data/gases_vupdate_2022_AR6.txt +47 -0
  156. ciceroscm-0.0.0/tests/test-data/gases_vupdate_2024_WMO.txt +47 -0
  157. ciceroscm-0.0.0/tests/test-data/gases_vupdate_2024_WMO_added_new.txt +62 -0
  158. ciceroscm-0.0.0/tests/test-data/gws_antr.txt +268 -0
  159. ciceroscm-0.0.0/tests/test-data/land_use_erf_ar6.txt +271 -0
  160. ciceroscm-0.0.0/tests/test-data/meanVOLCmnd_ipcc_NH.txt +751 -0
  161. ciceroscm-0.0.0/tests/test-data/natemis_ch4.txt +751 -0
  162. ciceroscm-0.0.0/tests/test-data/natemis_n2o.txt +751 -0
  163. ciceroscm-0.0.0/tests/test-data/nr_test_1pct_CO2/output_forc.txt +352 -0
  164. ciceroscm-0.0.0/tests/test-data/nr_test_1pct_CO2/output_ohc.txt +352 -0
  165. ciceroscm-0.0.0/tests/test-data/nr_test_1pct_CO2/output_rib.txt +352 -0
  166. ciceroscm-0.0.0/tests/test-data/nr_test_1pct_CO2/output_temp.txt +352 -0
  167. ciceroscm-0.0.0/tests/test-data/pert_tests/output_em.txt +352 -0
  168. ciceroscm-0.0.0/tests/test-data/pert_tests/output_forc.txt +352 -0
  169. ciceroscm-0.0.0/tests/test-data/pertem_test.txt +10 -0
  170. ciceroscm-0.0.0/tests/test-data/pertforc_test.txt +7 -0
  171. ciceroscm-0.0.0/tests/test-data/solar_IPCC.txt +751 -0
  172. ciceroscm-0.0.0/tests/test-data/solar_erf_ar6.txt +271 -0
  173. ciceroscm-0.0.0/tests/test-data/ssp245_conc/output_conc.txt +352 -0
  174. ciceroscm-0.0.0/tests/test-data/ssp245_conc/output_em.txt +352 -0
  175. ciceroscm-0.0.0/tests/test-data/ssp245_conc/output_forc.txt +352 -0
  176. ciceroscm-0.0.0/tests/test-data/ssp245_conc/output_ohc.txt +352 -0
  177. ciceroscm-0.0.0/tests/test-data/ssp245_conc/output_rib.txt +352 -0
  178. ciceroscm-0.0.0/tests/test-data/ssp245_conc/output_temp.txt +352 -0
  179. ciceroscm-0.0.0/tests/test-data/ssp245_conc_RCMIP.txt +805 -0
  180. ciceroscm-0.0.0/tests/test-data/ssp245_em_RCMIP.txt +755 -0
  181. ciceroscm-0.0.0/tests/test-data/ssp245_emis/output_conc.txt +352 -0
  182. ciceroscm-0.0.0/tests/test-data/ssp245_emis/output_em.txt +352 -0
  183. ciceroscm-0.0.0/tests/test-data/ssp245_emis/output_forc.txt +352 -0
  184. ciceroscm-0.0.0/tests/test-data/ssp245_emis/output_ohc.txt +352 -0
  185. ciceroscm-0.0.0/tests/test-data/ssp245_emis/output_rib.txt +352 -0
  186. ciceroscm-0.0.0/tests/test-data/ssp245_emis/output_temp.txt +352 -0
  187. ciceroscm-0.0.0/tests/test-data/ssp245_with_regional_aerosols_em_RCMIP.txt +755 -0
  188. ciceroscm-0.0.0/tests/test-data/test_forcing.txt +736 -0
  189. ciceroscm-0.0.0/tests/test-data/test_forcing_components.txt +737 -0
  190. ciceroscm-0.0.0/tests/test-data/test_forcing_hemisplit.txt +737 -0
  191. ciceroscm-0.0.0/tests/test-data/volcanic_erf_ar6.txt +271 -0
  192. ciceroscm-0.0.0/tests/test-data/zero_forcing.txt +736 -0
  193. ciceroscm-0.0.0/tests/unit/test_carbon_cycle_mod.py +178 -0
  194. ciceroscm-0.0.0/tests/unit/test_concentrations_emissions_handler_standalone.py +28 -0
  195. ciceroscm-0.0.0/tests/unit/test_configdistro.py +78 -0
  196. ciceroscm-0.0.0/tests/unit/test_factory_functions.py +50 -0
  197. ciceroscm-0.0.0/tests/unit/test_input_handler.py +127 -0
  198. ciceroscm-0.0.0/tests/unit/test_perturbations.py +56 -0
  199. ciceroscm-0.0.0/tests/unit/test_pub_utils.py +129 -0
  200. ciceroscm-0.0.0/tests/unit/test_rfuncs.py +65 -0
  201. ciceroscm-0.0.0/tests/unit/test_two_layer_ocean.py +427 -0
  202. ciceroscm-0.0.0/tests/unit/test_upwellingDownwellingModel.py +194 -0
  203. ciceroscm-0.0.0/tests/unit/test_utils.py +65 -0
  204. ciceroscm-0.0.0/versioneer.py +2123 -0
@@ -0,0 +1,2 @@
1
+ exclude_dirs:
2
+ - ciceroscm/_version.py
@@ -0,0 +1,13 @@
1
+ [run]
2
+ branch = True
3
+ source = ciceroscm
4
+ omit = *_version.py,*testing.py
5
+
6
+ [report]
7
+ fail_under = 90
8
+ exclude_lines =
9
+ if self.debug:
10
+ pragma: no cover
11
+ raise NotImplementedError
12
+ if __name__ == .__main__.:
13
+ ignore_errors = True
@@ -0,0 +1 @@
1
+ src/cicero-scm/_version.py export-subst
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: Bug Report
3
+ about: Write a report to help us improve
4
+
5
+ ---
6
+
7
+ **Describe the bug**
8
+
9
+ A clear and concise description of what the bug is, in particular:
10
+
11
+ - What did you do?
12
+ - What actually happened?
13
+ - What did you expect to happen?
14
+
15
+ **Failing Test**
16
+
17
+ Please put code (ideally in the form of a unit test) which fails below
18
+
19
+ **Screenshots**
20
+
21
+ If applicable, add screenshots to help explain your problem.
22
+
23
+ **System (please complete the following information):**
24
+
25
+ - OS: [e.g. Windows, Linux, macOS]
26
+ - Python and openscm commit/version [e.g. Python 3.5]
27
+
28
+ **Additional context**
29
+
30
+ Add any other context about the problem here.
@@ -0,0 +1,21 @@
1
+ ---
2
+ name: Feature Request
3
+ about: Suggest an idea for this project
4
+
5
+ ---
6
+
7
+ **Is your feature request related to a problem? Please describe.**
8
+
9
+ A clear and concise description of what the problem is. E.g. It's annoying that I always have to [...]
10
+
11
+ **Describe the solution you'd like**
12
+
13
+ A clear and concise description of the solution you would like to see.
14
+
15
+ **Describe alternatives you've considered**
16
+
17
+ A clear and concise description of any alternative solutions or features you've considered.
18
+
19
+ **Additional context**
20
+
21
+ Add any other context or screenshots about the feature request here.
@@ -0,0 +1,6 @@
1
+ <Please replace this paragraph by a description of what this PR does and alter the TODO-list below to what applies here. Please make a 'draft PR' to begin and then only mark it as ready for review once all the relevant points are done.>
2
+
3
+ - [ ] Tests added
4
+ - [ ] Documentation added
5
+ - [ ] Example added (in the documentation, to an existing notebook, or in a new notebook)
6
+ - [ ] Description in ``CHANGELOG.rst`` added (single line such as: ``(`#XX <https://github.com/ciceroOslo/ciceroscm/pull/XX>`_) Added feature which does something``)
@@ -0,0 +1,185 @@
1
+ name: CiceroSCM-Runner CI-CD
2
+ on:
3
+ push:
4
+ branches:
5
+ - main
6
+ tags:
7
+ - 'v*'
8
+ pull_request:
9
+
10
+ jobs:
11
+ linting-and-docs:
12
+
13
+ runs-on: ubuntu-latest
14
+ strategy:
15
+ matrix:
16
+ python-version: ['3.12']
17
+
18
+ steps:
19
+ - name: Checkout repository
20
+ uses: actions/checkout@v4
21
+ - name: Setup python
22
+ uses: actions/setup-python@v1
23
+ with:
24
+ python-version: ${{ matrix.python-version }}
25
+ - name: Install dev dependencies
26
+ # why pandas 1.1.5 breaks pylint, I do not know
27
+ run: |
28
+ pip install --upgrade pip wheel
29
+ pip install -e .[dev]
30
+ - name: Formatting and linters
31
+ run: |
32
+ black --version
33
+ black --check src tests --exclude ciceroscm/_version.py
34
+ isort --version
35
+ isort --check-only --quiet --recursive src tests
36
+ pydocstyle --version
37
+ pydocstyle src
38
+ bandit --version
39
+ bandit -c .bandit.yml -r src
40
+ ruff version
41
+ ruff check src tests
42
+ pylint --version
43
+ pylint src
44
+ # Muting docs for now, will try to make transition to other package manager for this eventually
45
+ #- name: Build docs
46
+ # treat warnings as errors (-W)...
47
+ # ...but not when being nitpicky (-n)
48
+ #run: |
49
+ #sphinx-build -M html docs/source docs/build -qW
50
+ # Muted coverage-test for now
51
+ #sphinx-build -M html docs/source docs/build -Eqn -b coverage
52
+ #if [[ -s docs/build/html/python.txt ]]
53
+ #then
54
+ # echo
55
+ # echo \"Error: Documentation missing:\"
56
+ # echo
57
+ # cat docs/build/html/python.txt
58
+ # exit 1
59
+ #fi
60
+
61
+ build:
62
+ runs-on: ubuntu-latest
63
+ strategy:
64
+ matrix:
65
+ os: ["ubuntu-latest", "macos-latest", "windows-latest"]
66
+
67
+ python-version: ['3.12', '3.10', '3.11']
68
+ env:
69
+ MIN_COVERAGE: 90
70
+
71
+ steps:
72
+ - name: Checkout repository
73
+ uses: actions/checkout@v4
74
+ - name: Setup python
75
+ uses: actions/setup-python@v1
76
+ with:
77
+ python-version: ${{ matrix.python-version }}
78
+ - name: Install test dependencies
79
+ run: |
80
+ pip install --upgrade pip wheel
81
+ pip install -e .[tests,models]
82
+ - name: Test with pytest
83
+ run: |
84
+ pytest tests -r a --cov=ciceroscm --cov-report='' --cov-fail-under=$MIN_COVERAGE
85
+
86
+ test-notebooks:
87
+ runs-on: ubuntu-latest
88
+ strategy:
89
+ matrix:
90
+ python-version: ['3.12', '3.10', '3.11']
91
+ steps:
92
+ - name: Checkout repository
93
+ uses: actions/checkout@v4
94
+ - name: Setup python
95
+ uses: actions/setup-python@v1
96
+ with:
97
+ python-version: ${{ matrix.python-version }}
98
+ - name: Install notebook dependencies
99
+ run: |
100
+ pip install --upgrade pip wheel
101
+ pip install -e .[tests,models,notebooks]
102
+ - name: Test notebooks with nbval
103
+ run: |
104
+ pytest notebooks -r a --nbval-lax --sanitize-with tests/notebook-tests.cfg --no-cov
105
+ - name: Test notebooks strictly
106
+ if: matrix.python-version == '3.12'
107
+ run: |
108
+ pytest notebooks -r a --nbval --nbval-sanitize-with tests/notebook-tests.cfg --no-cov
109
+
110
+
111
+ test-install:
112
+
113
+ needs: [build,linting-and-docs]
114
+ runs-on: ubuntu-latest
115
+ strategy:
116
+ matrix:
117
+ python-version: ['3.12', '3.10', '3.11']
118
+ steps:
119
+ - name: Checkout repository
120
+ uses: actions/checkout@v4
121
+ - name: Setup python
122
+ uses: actions/setup-python@v1
123
+ with:
124
+ python-version: ${{ matrix.python-version }}
125
+ - name: Install
126
+ run: |
127
+ pip install --upgrade pip wheel
128
+ pip install .
129
+ - name: Test installation
130
+ run: |
131
+ pip list
132
+ python scripts/test_install.py
133
+
134
+ # Commenting this out for now till we figure out how to do distributions with
135
+ # newer type of package manager
136
+ #create-dist:
137
+
138
+ #needs: [build,linting-and-docs]
139
+
140
+ # runs-on: ubuntu-latest
141
+ # strategy:
142
+ # matrix:
143
+ # python-version: ['3.12']
144
+
145
+ # steps:
146
+ # - name: Checkout repository
147
+ # uses: actions/checkout@v4
148
+ # - name: Setup python
149
+ # uses: actions/setup-python@v1
150
+ # with:
151
+ # python-version:
152
+ # - name: Install dependencies
153
+ # run: |
154
+ # pip install --upgrade pip wheel
155
+ # pip install -e .[dev]
156
+ # - name: Create package
157
+ # run: |
158
+ # python sdist bdist_wheel --universal
159
+ # twine check dist/*
160
+ # - uses: actions/upload-artifact@v4
161
+ # with:
162
+ # name: dist
163
+ # path: dist
164
+
165
+
166
+ #deploy-pypi:
167
+
168
+ # needs: [test-install,create-dist]
169
+ # if: startsWith(github.ref, 'refs/tags/v')
170
+ # runs-on: ubuntu-latest
171
+ # strategy:
172
+ # matrix:
173
+ # python-version: ['3.12']
174
+
175
+ # steps:
176
+ # - uses: actions/download-artifact@v4
177
+ # with:
178
+ # name: dist
179
+ # path: dist
180
+ # - name: Publish package to PyPI
181
+ # uses: pypa/gh-action-pypi-publish@release/v1
182
+ # with:
183
+ # user: __token__
184
+ # NBNB next line is missing two curly brackets at the end
185
+ # password: ${{ secrets.pypi_api_token
@@ -0,0 +1,30 @@
1
+ name: Upload Python Package to PyPI when a Release is Created
2
+
3
+ on: workflow_dispatch
4
+ # release:
5
+ # types: [created]
6
+
7
+ jobs:
8
+ pypi-publish:
9
+ name: Publish release to PyPI
10
+ runs-on: ubuntu-latest
11
+ environment:
12
+ name: pypi
13
+ url: https://pypi.org/p/ciceroscm
14
+ permissions:
15
+ id-token: write
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - name: Set up Python
19
+ uses: actions/setup-python@v4
20
+ with:
21
+ python-version: "3.12"
22
+ - name: Install dependencies
23
+ run: |
24
+ python -m pip install --upgrade pip wheel setuptools build twine
25
+ pip install -e .[dev]
26
+ - name: Build package
27
+ run: |
28
+ python -m build
29
+ - name: Publish package distributions to PyPI
30
+ uses: pypa/gh-action-pypi-publish@v1.13.0
@@ -0,0 +1,137 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # Tempfiles
7
+ *~
8
+ *#
9
+ *.png
10
+
11
+ # C extensions
12
+ *.so
13
+
14
+ # Distribution / packaging
15
+ .Python
16
+ build/
17
+ develop-eggs/
18
+ dist/
19
+ downloads/
20
+ eggs/
21
+ .eggs/
22
+ lib/
23
+ lib64/
24
+ parts/
25
+ sdist/
26
+ var/
27
+ wheels/
28
+ pip-wheel-metadata/
29
+ share/python-wheels/
30
+ *.egg-info/
31
+ .installed.cfg
32
+ *.egg
33
+ MANIFEST
34
+
35
+ # PyInstaller
36
+ # Usually these files are written by a python script from a template
37
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
38
+ *.manifest
39
+ *.spec
40
+
41
+ # Installer logs
42
+ pip-log.txt
43
+ pip-delete-this-directory.txt
44
+
45
+ # Unit test / coverage reports
46
+ htmlcov/
47
+ .tox/
48
+ .nox/
49
+ .coverage
50
+ .coverage.*
51
+ .cache
52
+ nosetests.xml
53
+ coverage.xml
54
+ *.cover
55
+ *.py,cover
56
+ .hypothesis/
57
+ .pytest_cache/
58
+
59
+ # Translations
60
+ *.mo
61
+ *.pot
62
+
63
+ # Django stuff:
64
+ *.log
65
+ local_settings.py
66
+ db.sqlite3
67
+ db.sqlite3-journal
68
+
69
+ # Flask stuff:
70
+ instance/
71
+ .webassets-cache
72
+
73
+ # Scrapy stuff:
74
+ .scrapy
75
+
76
+ # Sphinx documentation
77
+ docs/_build/
78
+
79
+ # PyBuilder
80
+ target/
81
+
82
+ # Jupyter Notebook
83
+ .ipynb_checkpoints
84
+
85
+ # IPython
86
+ profile_default/
87
+ ipython_config.py
88
+
89
+ # pyenv
90
+ .python-version
91
+
92
+ # pipenv
93
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
94
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
95
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
96
+ # install all needed dependencies.
97
+ #Pipfile.lock
98
+
99
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
100
+ __pypackages__/
101
+
102
+ # Celery stuff
103
+ celerybeat-schedule
104
+ celerybeat.pid
105
+
106
+ # SageMath parsed files
107
+ *.sage.py
108
+
109
+ # Environments
110
+ .env
111
+ .venv
112
+ env/
113
+ venv/
114
+ ENV/
115
+ env.bak/
116
+ venv.bak/
117
+
118
+ # Spyder project settings
119
+ .spyderproject
120
+ .spyproject
121
+
122
+ # Rope project settings
123
+ .ropeproject
124
+
125
+ # mkdocs documentation
126
+ /site
127
+
128
+ # mypy
129
+ .mypy_cache/
130
+ .dmypy.json
131
+ dmypy.json
132
+
133
+ # Pyre type checker
134
+ .pyre/
135
+
136
+ # Vscode
137
+ .vscode/
@@ -0,0 +1,30 @@
1
+ [MASTER]
2
+ ignore=_version.py
3
+ load-plugins=
4
+ pylint.extensions.bad_builtin,
5
+ pylint.extensions.check_elif,
6
+ pylint.extensions.docparams,
7
+ pylint.extensions.overlapping_exceptions,
8
+ pylint.extensions.redefined_variable_type
9
+
10
+ # As a temporary workaround for https://github.com/PyCQA/pylint/issues/4577
11
+ init-hook = "import astroid; astroid.context.InferenceContext.max_inferred = 500"
12
+
13
+ [MESSAGES CONTROL]
14
+ disable=
15
+ # handled by black
16
+ format,
17
+ import-error,
18
+ fixme
19
+
20
+ [SIMILARITIES]
21
+ min-similarity-lines=7
22
+ ignore-comments=no
23
+ ignore-docstrings=yes
24
+ ignore-imports=yes
25
+
26
+ [FORMAT]
27
+ good-names=i,j,k,nt,yr,it,dt,rf,dT_glob,dT_NH,dT_SH,dT_glob_air,dT_glob_NH_air,dT_glob_SH_air,dT_glob_sea,q,dT_glob_NH_sea,dT_glob_SH_sea,dSL,dSL_ice,dSL_thermal,fs,fn,s,t,p0,p,t0,w,dz,tn,ts,z0,a,b,c,aa,bb,z,dn,ds,im,lm
28
+
29
+ # Maximum number of characters on a single line.
30
+ max-line-length=90
@@ -0,0 +1,7 @@
1
+ {
2
+ "python.testing.pytestArgs": [
3
+ "tests"
4
+ ],
5
+ "python.testing.unittestEnabled": false,
6
+ "python.testing.pytestEnabled": true
7
+ }
@@ -0,0 +1,124 @@
1
+ Changelog
2
+ =========
3
+
4
+ All notable changes to this project will be documented in this file.
5
+
6
+ The format is based on `Keep a Changelog <https://keepachangelog.com/en/1.0.0/>`_, and this project adheres to `Semantic Versioning <https://semver.org/spec/v2.0.0.html>`_.
7
+
8
+ The changes listed in this file are categorised as follows:
9
+
10
+ - Added: new features
11
+ - Changed: changes in existing functionality
12
+ - Deprecated: soon-to-be removed features
13
+ - Removed: now removed features
14
+ - Fixed: any bug fixes
15
+ - Security: in case of vulnerabilities.
16
+
17
+ [Unreleased]
18
+ ---------------------------
19
+ ### Added
20
+ - Deployment workflow to publish package to PyPI on manual trigger
21
+
22
+ [Version 2.0.1]
23
+ ---------------------------
24
+ ### Added
25
+
26
+ ### Changed
27
+
28
+ ### Fixed
29
+
30
+ - Ensure code can run when ozone is not changing, avoiding divide by zero.
31
+ - Ensure calculation of airborne fraction gives nans when cumulative emissions are zero.
32
+ - Fix bug affecting backward compatibility with not sending explicit carbon_cycle argument to concentrations_emissions_handler
33
+
34
+ ### Removed
35
+
36
+ [Version 2.0.0]
37
+ ---------------------------
38
+
39
+ ### Changed
40
+ - Simplified Tropospheric Ozone forcing calculation, using the same calculation throughout both before and after emstart
41
+ (previous implementation relied on fossil fuel CO2 concentration likely for historical reasons of missing data).
42
+
43
+ ### Added
44
+
45
+ - Option to chunk configuration distributions to allow for millions of member runs without killing memory
46
+ - Option to output ozone and stratospheric water vapour effective radiative forcing in parallel run
47
+ - _config_distro can now write distribution files with full setup metadata, and Distroconfig can read in files with or with out shared metadata.
48
+ - New structural switch functionality to allow for different structural configurations to be run for both carbon cycle and thermal model.
49
+ - A simplified box carbon model and a simplified two-layer ocean model as structural options.
50
+ - Option to run with regionally split aerosol species, also including functionality to make gaspamfile that supports this from forcing txt file.
51
+
52
+ ### Fixed
53
+
54
+ - Skip precaclulation of empty concentrations matrix if emstart >= nyend
55
+ - Carbon cycle output functioninng for concentrations runs
56
+ - Parallel concentrations run pass back-calculated emissions series when prompted for Emissions|CO2
57
+ - Fix so standalone concentrations_emissions_handler will run without explicitly sending carbon cycle model argument, ensuring backward compatibility.
58
+
59
+ ### Removed
60
+ - Removed old calibrator code, as calibration is now done in a separate repository.
61
+ - fnso (fraction of Northern hemisphere ocean to Southern hemisphere ocean) parameter removed from upwelling diffusion model. This parameter should be derived from the ratio between foan and foas, and not be something that can be set separately.
62
+
63
+ [Version 1.5.0]
64
+ ---------------------------
65
+
66
+ ### Changed
67
+
68
+ - Change so that non-changing gases are precalculated before a run in concentrations_emissions_handler.py to speed up and avoid looping over every component and looking up in pandas every timestep
69
+ - Removed use of scmdata, and changed parallel output to be pandas to offload extra dependencies
70
+ - Moved carbon cycle functionality out of concentrations_emissions_handler.py to separate module carbon_cycle_mod.py
71
+ - Changed methodology for parametrised decay functions for biotic decay (rb_function) and mixed layer pulse response rs_function, imposing a few more consistency criteria on them and makeing them changable by a dictionary for each with keys "coeffs" and "timescales" with values that should be lists or np.arrays of coefficient and timescale values
72
+ - Upgrade infrasturucture for development
73
+ - Output data / output files no longer include empty columns for species that don't make sense (landuse albedo emissions, concentrations for aerosols like BC etc)
74
+ - Aerosol forcing is no longer scaled to a reference year, but is per change in annual emissions, this also changes aerosol forcing parameter values and units
75
+ - Added NMVOC, NH3 and NOx as forcing aerosols
76
+ - Changed default gaspam unit for SO2 to Tg_SO2 rather than Tg_S
77
+ - Carbon cycle parameters now passed in a separate dictionary
78
+ - Simplifying _config_distro
79
+
80
+
81
+ ### Added
82
+
83
+ - Functionality to feedback current temperature change to the carbon cycle and have simple temperature feedback
84
+ - Functionality to back calculate CO2 emissions from concentrations
85
+ - Functionality to calculate carbon fluxes to ocean and land
86
+ - Functionality to calculate airborne fraction
87
+ - Functionality to output new carbon cycle information
88
+ - Functionality to output new carbon cycle information in parallel runs
89
+ - Changeable parameter for the depth of the mixed_layer ocean seen by the carbon cycle
90
+ - Newer gaspam files
91
+ - Light check for emissions and gaspam file compatibility
92
+ - Changeable ocean efficacy parameter to the upwelling diffusion model
93
+ - Carbon cycle temperature feedbacks for mixed_layer ocean depth (sigmoid decline),
94
+ - Land primary production (optimum increase and threshold dampening decline) and
95
+ - Ocean solubility (exponential scaling to limit)
96
+
97
+
98
+ ### Fixed
99
+
100
+ - Removed `jupyter nbextension` from `Makefile` causing install errors
101
+ - Locked numpy in requirements to below version 2 to work with scmdata for now
102
+ - Fix error in flat N2O assumption in natural precalculate_natural_emissions.py script
103
+ - Change logging messages for misisng parameters from warning to info
104
+ - Fix bug in file cutting for read_inputfile in input_handler
105
+ - Temporarily mute docs generation with sphinx on github as it is not working, plan to work in different method
106
+ - Temporarily mute distribution generation, plan to work this back in with more updated package manager
107
+
108
+ [Versions 1.1.1 and v1.1.0]
109
+ ---------------------------
110
+
111
+ ### Added
112
+
113
+ - Support for flat natural emissions for NO2 and CH4 from gaspamfile as defaults
114
+ - Update script to make natural emissions for NO2 and CH4 using ODE solution
115
+ - Updates to default vulcanoe and solar forcing timeseries
116
+ - Rationalising _band implementation using library for speed and readibility
117
+ - Clearing out unused density realated methods
118
+ - Made the fertilisation factor beta_f part a changeable parameter
119
+ - Parallelisation wrapper for parallel runs
120
+ - Config distributions support to make parameter distributions
121
+ - Distrobution runner to run over distributions in parallel
122
+ - Calibrator to make calibrated set of configurations based on calibration data
123
+ - Made automatic plots more polished looking
124
+ - Taking out unused parts from gaspam-file