fridapy 0.1.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.
@@ -0,0 +1,32 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.egg-info/
6
+ dist/
7
+ build/
8
+ *.egg
9
+
10
+ # Generated output
11
+ output/
12
+ *.png
13
+ *.npz
14
+ !data/**/*.npz
15
+
16
+ # SoSTrades / Stella (keep data/FRIDA.isdb tracked)
17
+ FRIDA.isdb
18
+ !data/FRIDA.isdb
19
+
20
+ # IDE
21
+ .vscode/
22
+ .idea/
23
+ *.swp
24
+ *.swo
25
+
26
+ # OS
27
+ .DS_Store
28
+ Thumbs.db
29
+
30
+ # Virtual environments
31
+ .venv/
32
+ venv/
fridapy-0.1.0/LICENSE ADDED
@@ -0,0 +1,31 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 the fridapy developers
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ ---
24
+
25
+ fridapy is based on the WorldTrans FRIDA integrated assessment model
26
+ (https://github.com/metno/WorldTransFRIDA), which is distributed under the MIT
27
+ License. It builds on the SoSTrades framework (sostrades-core,
28
+ https://github.com/os-climate/sostrades-core). Reference uncertainty data is
29
+ derived from Schoenberg, W. (2025), "FRIDA v2.1 Endogenous Model Behavior (EMB)
30
+ 100000 member ensemble", Zenodo, https://doi.org/10.5281/zenodo.15396799
31
+ (CC-BY-4.0).
fridapy-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,146 @@
1
+ Metadata-Version: 2.4
2
+ Name: fridapy
3
+ Version: 0.1.0
4
+ Summary: Integrated Assessment Model, based on FRIDA, written in python using sostrades
5
+ Project-URL: Repository, https://github.com/SallyDa/fridapy
6
+ Project-URL: Issues, https://github.com/SallyDa/fridapy/issues
7
+ License: MIT License
8
+
9
+ Copyright (c) 2026 the fridapy developers
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ of this software and associated documentation files (the "Software"), to deal
13
+ in the Software without restriction, including without limitation the rights
14
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ copies of the Software, and to permit persons to whom the Software is
16
+ furnished to do so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
28
+
29
+ ---
30
+
31
+ fridapy is based on the WorldTrans FRIDA integrated assessment model
32
+ (https://github.com/metno/WorldTransFRIDA), which is distributed under the MIT
33
+ License. It builds on the SoSTrades framework (sostrades-core,
34
+ https://github.com/os-climate/sostrades-core). Reference uncertainty data is
35
+ derived from Schoenberg, W. (2025), "FRIDA v2.1 Endogenous Model Behavior (EMB)
36
+ 100000 member ensemble", Zenodo, https://doi.org/10.5281/zenodo.15396799
37
+ (CC-BY-4.0).
38
+ License-File: LICENSE
39
+ Keywords: FRIDA,climate,earth-system,integrated-assessment-model,sostrades,system-dynamics
40
+ Classifier: Development Status :: 3 - Alpha
41
+ Classifier: Intended Audience :: Science/Research
42
+ Classifier: License :: OSI Approved :: MIT License
43
+ Classifier: Operating System :: OS Independent
44
+ Classifier: Programming Language :: Python :: 3
45
+ Classifier: Programming Language :: Python :: 3.12
46
+ Classifier: Topic :: Scientific/Engineering
47
+ Requires-Python: >=3.12
48
+ Requires-Dist: numpy<3,>=1.26
49
+ Requires-Dist: pandas>=2.2
50
+ Provides-Extra: diagnostics
51
+ Requires-Dist: matplotlib>=3.9; extra == 'diagnostics'
52
+ Requires-Dist: scipy>=1.13; extra == 'diagnostics'
53
+ Description-Content-Type: text/markdown
54
+
55
+ # fridapy
56
+
57
+ A coupled climate–economy–society system-dynamics model, based on the
58
+ [WorldTrans FRIDA v2.1](https://github.com/metno/WorldTransFRIDA)
59
+ integrated assesment model and re-implemented in Python as a set of
60
+ [SoSTrades](https://github.com/os-climate/sostrades-core)
61
+ disciplines solved by an MDA (multidisciplinary analysis) coupling.
62
+ This version replicates the original FRIDA model v2.1 results, using a simplified (tuned) ocean carbon model.
63
+
64
+ ## Installation
65
+
66
+ `fridapy` depends on **`sostrades-core`**, which is not published on PyPI, so it
67
+ must be installed first from GitHub (this is *not* our package — see
68
+ [os-climate/sostrades-core](https://github.com/os-climate/sostrades-core)):
69
+
70
+ ```bash
71
+ pip install git+https://github.com/os-climate/sostrades-core.git@v5.3.4
72
+ pip install fridapy # or, from a checkout: pip install -e .
73
+ ```
74
+
75
+ Equivalently, install the pinned runtime in one step:
76
+
77
+ ```bash
78
+ pip install -r requirements.txt
79
+ pip install -e .
80
+ ```
81
+
82
+ For the diagnostic / ensemble / plotting scripts under `diagnostics/`, install the
83
+ extra:
84
+
85
+ ```bash
86
+ pip install -e ".[diagnostics]" # adds matplotlib, scipy
87
+ ```
88
+
89
+ ## Quickstart
90
+
91
+ Run the full model for a single climate case:
92
+
93
+ ```python
94
+ import numpy as np
95
+ from sostrades_core.execution_engine.execution_engine import ExecutionEngine
96
+
97
+ DISCIPLINES = [
98
+ 'Demographics', 'Economy', 'Energy', 'Emissions', 'Climate', 'LandUse',
99
+ 'GovernmentRegulations', 'BehavioralChoices', 'BehavioralChange',
100
+ 'Resources', 'SeaLevel', 'SeaLevelRiseImpacts', 'PlanetaryBoundaries',
101
+ ]
102
+ time = np.arange(1980, 2150 + 1e-9, 1.0)
103
+
104
+ study = 'fridapy'
105
+ ee = ExecutionEngine(study)
106
+ ee.select_root_process(repo='fridapy', mod_id='process')
107
+ ee.configure()
108
+
109
+ values = {f'{study}.{study}.{d}.time': time for d in DISCIPLINES}
110
+ values[f'{study}.{study}.Climate.climate_case'] = 50 # 1–100
111
+ ee.load_study_from_input_dict(values)
112
+ ee.dm.set_values_from_dict({
113
+ f'{study}.{study}.max_mda_iter': 300,
114
+ f'{study}.{study}.tolerance': 1e-3,
115
+ f'{study}.{study}.inner_mda_name': 'MDAGaussSeidel',
116
+ })
117
+ ee.execute()
118
+
119
+ gdp = ee.dm.get_value(f'{study}.Real_GDP')
120
+ ```
121
+
122
+ See [`diagnostics/usecase.py`](diagnostics/usecase.py) for a
123
+ complete 9-panel example, and
124
+ [`diagnostics/run_ensemble.py`](diagnostics/run_ensemble.py)
125
+ for ensemble runs (local or Modal).
126
+
127
+ ## Repository structure
128
+
129
+ | Path | Contents |
130
+ |---|---|
131
+ | `fridapy/disciplines/` | the 13 SoSTrades disciplines |
132
+ | `fridapy/process/` | the MDA process builder |
133
+ | `fridapy/data/` | packaged runtime reference data (forcing series, climate cases) |
134
+ | `diagnostics/` | ensemble runners, calibration, validation, plotting |
135
+ | `docs/` | design notes for each major mechanism |
136
+ | `data/` | full development dataset (Stella `FRIDA.isdb` source, calibration inputs) |
137
+
138
+ ## Data sources
139
+
140
+ The packaged `fridapy/data/` files (`frida_input_data.csv`, `climate_cases.json`)
141
+ are derived from the FRIDA v2.1 model. The FRIDA reference uncertainty envelopes used by some diagnostics come from Schoenberg, W. (2025),
142
+ *FRIDA v2.1 Endogenous Model Behavior (EMB) 100000 member ensemble*, Zenodo,
143
+ [10.5281/zenodo.15396799](https://doi.org/10.5281/zenodo.15396799) (CC-BY-4.0);
144
+ that ~270 MB archive is **not** bundled — see
145
+ [`diagnostics/analyze_ensemble.py`](diagnostics/analyze_ensemble.py)
146
+ for how to obtain it.
@@ -0,0 +1,92 @@
1
+ # fridapy
2
+
3
+ A coupled climate–economy–society system-dynamics model, based on the
4
+ [WorldTrans FRIDA v2.1](https://github.com/metno/WorldTransFRIDA)
5
+ integrated assesment model and re-implemented in Python as a set of
6
+ [SoSTrades](https://github.com/os-climate/sostrades-core)
7
+ disciplines solved by an MDA (multidisciplinary analysis) coupling.
8
+ This version replicates the original FRIDA model v2.1 results, using a simplified (tuned) ocean carbon model.
9
+
10
+ ## Installation
11
+
12
+ `fridapy` depends on **`sostrades-core`**, which is not published on PyPI, so it
13
+ must be installed first from GitHub (this is *not* our package — see
14
+ [os-climate/sostrades-core](https://github.com/os-climate/sostrades-core)):
15
+
16
+ ```bash
17
+ pip install git+https://github.com/os-climate/sostrades-core.git@v5.3.4
18
+ pip install fridapy # or, from a checkout: pip install -e .
19
+ ```
20
+
21
+ Equivalently, install the pinned runtime in one step:
22
+
23
+ ```bash
24
+ pip install -r requirements.txt
25
+ pip install -e .
26
+ ```
27
+
28
+ For the diagnostic / ensemble / plotting scripts under `diagnostics/`, install the
29
+ extra:
30
+
31
+ ```bash
32
+ pip install -e ".[diagnostics]" # adds matplotlib, scipy
33
+ ```
34
+
35
+ ## Quickstart
36
+
37
+ Run the full model for a single climate case:
38
+
39
+ ```python
40
+ import numpy as np
41
+ from sostrades_core.execution_engine.execution_engine import ExecutionEngine
42
+
43
+ DISCIPLINES = [
44
+ 'Demographics', 'Economy', 'Energy', 'Emissions', 'Climate', 'LandUse',
45
+ 'GovernmentRegulations', 'BehavioralChoices', 'BehavioralChange',
46
+ 'Resources', 'SeaLevel', 'SeaLevelRiseImpacts', 'PlanetaryBoundaries',
47
+ ]
48
+ time = np.arange(1980, 2150 + 1e-9, 1.0)
49
+
50
+ study = 'fridapy'
51
+ ee = ExecutionEngine(study)
52
+ ee.select_root_process(repo='fridapy', mod_id='process')
53
+ ee.configure()
54
+
55
+ values = {f'{study}.{study}.{d}.time': time for d in DISCIPLINES}
56
+ values[f'{study}.{study}.Climate.climate_case'] = 50 # 1–100
57
+ ee.load_study_from_input_dict(values)
58
+ ee.dm.set_values_from_dict({
59
+ f'{study}.{study}.max_mda_iter': 300,
60
+ f'{study}.{study}.tolerance': 1e-3,
61
+ f'{study}.{study}.inner_mda_name': 'MDAGaussSeidel',
62
+ })
63
+ ee.execute()
64
+
65
+ gdp = ee.dm.get_value(f'{study}.Real_GDP')
66
+ ```
67
+
68
+ See [`diagnostics/usecase.py`](diagnostics/usecase.py) for a
69
+ complete 9-panel example, and
70
+ [`diagnostics/run_ensemble.py`](diagnostics/run_ensemble.py)
71
+ for ensemble runs (local or Modal).
72
+
73
+ ## Repository structure
74
+
75
+ | Path | Contents |
76
+ |---|---|
77
+ | `fridapy/disciplines/` | the 13 SoSTrades disciplines |
78
+ | `fridapy/process/` | the MDA process builder |
79
+ | `fridapy/data/` | packaged runtime reference data (forcing series, climate cases) |
80
+ | `diagnostics/` | ensemble runners, calibration, validation, plotting |
81
+ | `docs/` | design notes for each major mechanism |
82
+ | `data/` | full development dataset (Stella `FRIDA.isdb` source, calibration inputs) |
83
+
84
+ ## Data sources
85
+
86
+ The packaged `fridapy/data/` files (`frida_input_data.csv`, `climate_cases.json`)
87
+ are derived from the FRIDA v2.1 model. The FRIDA reference uncertainty envelopes used by some diagnostics come from Schoenberg, W. (2025),
88
+ *FRIDA v2.1 Endogenous Model Behavior (EMB) 100000 member ensemble*, Zenodo,
89
+ [10.5281/zenodo.15396799](https://doi.org/10.5281/zenodo.15396799) (CC-BY-4.0);
90
+ that ~270 MB archive is **not** bundled — see
91
+ [`diagnostics/analyze_ensemble.py`](diagnostics/analyze_ensemble.py)
92
+ for how to obtain it.
@@ -0,0 +1,3 @@
1
+ """fridapy — Integrated Assessment Model, based on FRIDA, written in python using sostrades"""
2
+
3
+ __version__ = "0.1.0"