Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
672c53b
new component generic_imitation, please test using the script in stud…
mensch72 Nov 18, 2021
86fa736
version with improved documentation and possibility to override param…
mensch72 Nov 19, 2021
262f92c
changed .gitignore to ignore built docs
mensch72 Nov 19, 2021
31fec4b
again
mensch72 Nov 19, 2021
b7fdb57
deleted built docs
mensch72 Nov 19, 2021
f251d8e
in the process of extending it further
mensch72 Nov 20, 2021
e446a7e
added imi_imitate_<key> hook
mensch72 Nov 20, 2021
0d0559a
still debugging the extended version
mensch72 Nov 20, 2021
dafc540
added line profiling and corresponding config option.
mensch72 Nov 20, 2021
b0547bf
sped up a little. lesson learned: always use choice(number) instead o…
mensch72 Nov 20, 2021
cb86b08
generic_imitation ready for testing.
mensch72 Nov 24, 2021
6cc2423
Merge branch 'issue_152' into imitation_component
mensch72 Dec 10, 2021
f8a7a8c
copan:CORE dummy component for lpjml coupling
luaschwarz Mar 11, 2022
3d64543
Update interface.py
zugnachpankow Mar 11, 2022
015e577
add dummy model and dummy coupling
Mar 11, 2022
01d18eb
Merge branch 'imitation_component' into couple_lpjml
Mar 11, 2022
1eb9bdb
add cell id lists, bug fixes, runs now!
Mar 11, 2022
81598f8
fix other component update process, clean up code and to-dos
Mar 16, 2022
beb1418
test
luaschwarz May 12, 2022
b550f07
adjust array shapes
zugnachpankow May 12, 2022
ca158cf
first steps including pycoupler
luaschwarz May 24, 2022
fde2160
variable name adjustments, further pycoupler incl.
luaschwarz Aug 9, 2022
5a026b0
last year fixes pre-first-coupled-run
luaschwarz Aug 9, 2022
1648124
first ideas on decision making and lpj integration
luaschwarz Feb 1, 2023
877b0d6
lpjml and reg-DM component updates
luaschwarz Apr 12, 2023
5abf648
first steps towards social-only model
luaschwarz Apr 19, 2023
0d5bb18
non-running runner
luaschwarz Apr 20, 2023
44e5a02
runscript 0.1
luaschwarz Apr 24, 2023
7d5693a
debug runner wednesday 26
luaschwarz Apr 26, 2023
d333f20
first commit!
jnnsbrr May 9, 2023
cc8602a
avoid nested, relative imports replaced by absolute imports for clear…
jnnsbrr May 9, 2023
999b250
debug imports and reformulate lpjml model_component
jnnsbrr May 15, 2023
d49fa69
add Earth entity to handle coupling and instancing of coupling cell i…
jnnsbrr May 17, 2023
02f81e7
add improved studies script for run_reg_decisions
jnnsbrr May 17, 2023
c3d84b3
fix views instead of copies when instancing cells from earth
jnnsbrr May 17, 2023
1bd5c55
adding world
luaschwarz May 17, 2023
425925c
earth entitiy as world entity
jnnsbrr Jun 6, 2023
aa2cc6c
use networkx for neighbourhood
jnnsbrr Jun 7, 2023
02ccdb2
Merge pull request #7 from luaschwarz/couple_lpjml_dev
jnnsbrr Jun 7, 2023
47d299a
merge with head
luaschwarz Jun 7, 2023
2c5eca0
fix nx
jnnsbrr Jun 7, 2023
dd432ba
Merge branch 'couple_lpjml' of github.com:luaschwarz/pycopancore into…
jnnsbrr Jun 7, 2023
2917102
frust
luaschwarz Jun 7, 2023
d79a5a2
Merge branch 'couple_lpjml' of github.com:luaschwarz/pycopancore into…
luaschwarz Jun 7, 2023
79e6b0e
fix model
jnnsbrr Jun 7, 2023
9f8d04e
culture to individual
jnnsbrr Jun 7, 2023
cdc32f5
order properties and methods
jnnsbrr Jun 7, 2023
a26ca0f
switching back to copan folder
luaschwarz Jun 8, 2023
2de74d7
Merge branch 'couple_lpjml' of github.com:luaschwarz/pycopancore into…
luaschwarz Jun 8, 2023
9ba7e1e
create and move config.yaml, progress for init farmers
jnnsbrr Jun 17, 2023
a1dc715
debug whole model
jnnsbrr Jun 19, 2023
9da7ade
debug model
jnnsbrr Jun 20, 2023
e4af2f5
debug run script
jnnsbrr Jun 21, 2023
2b24cf2
make it work withouth the runner
jnnsbrr Jun 21, 2023
01ab21e
Merge branch 'couple_lpjml_individuals' into couple_lpjml
jnnsbrr Jun 21, 2023
8ede73f
adjust run script
jnnsbrr Jun 21, 2023
d70102d
test with_tillage print_statement, rename script to run_inseeds.py
jnnsbrr Jun 21, 2023
0d46827
adjust inseeds run script, allow for regridding with countries, inclu…
jnnsbrr Jun 30, 2023
54a0cff
add writing output
jnnsbrr Jul 5, 2023
7162d2c
latest changes
jnnsbrr Jul 19, 2023
1d535b2
runscript copy with spinup
luaschwarz Jul 19, 2023
936d8d0
Merge branch 'couple_lpjml' of github.com:luaschwarz/pycopancore into…
luaschwarz Jul 19, 2023
6707a30
first attempt to reduce switching between (no)till
luaschwarz Jul 20, 2023
21e4e7e
introdurce switch time and debug behaviour write to input
jnnsbrr Jul 24, 2023
968d3b5
merge changes
jnnsbrr Jul 24, 2023
b2c5bed
fix lpjml cell, update plot script
jnnsbrr Nov 7, 2023
44cae71
keine ahnung
luaschwarz Nov 7, 2023
22827c4
merge changes
luaschwarz Nov 7, 2023
414a5d5
small script adjustments for new lpjml master
jnnsbrr Nov 10, 2023
66521ae
plot to pdf edits
luaschwarz Nov 13, 2023
2c08e3c
Merge branch 'couple_lpjml' of github.com:luaschwarz/pycopancore into…
luaschwarz Nov 13, 2023
fba3d61
add visualizations, global run script, debug for global runs and make…
jnnsbrr Nov 16, 2023
18928f2
Merge branch 'couple_lpjml' of github.com:luaschwarz/pycopancore into…
jnnsbrr Nov 16, 2023
ff3e145
changes in tpb and decision making frequency
luaschwarz Nov 16, 2023
655f372
merge incoming
luaschwarz Nov 17, 2023
91a1699
moving avg of soilc and cropyield
jnnsbrr Nov 17, 2023
9b3cd20
some comments and to-dos for luana
luaschwarz Nov 29, 2023
7a4ec81
Merge branch 'couple_lpjml' of github.com:luaschwarz/pycopancore into…
luaschwarz Nov 29, 2023
288ff29
run script luana fix
luaschwarz Dec 8, 2023
61d0cb2
reset tpb model and correct yield/soilc comparison
jnnsbrr Dec 8, 2023
f20475a
merge changes
jnnsbrr Dec 8, 2023
7d3608a
Remove sigmoid for heaviside
luaschwarz Dec 12, 2023
291bc2a
add recent changes
jnnsbrr Feb 7, 2024
38e385e
merge with heaviside (not merged)
jnnsbrr Feb 7, 2024
1f5aba4
all soil agr layer carbon fractions used, not fast only
jnnsbrr May 21, 2024
2de932c
compatibility with latest LPJmL version 5.8.14 and adding cell area
jnnsbrr Jun 7, 2024
2f8d68f
Delete .vscode/launch.json
jnnsbrr Jun 7, 2024
cccd129
delete vscode folder
jnnsbrr Jun 7, 2024
0c6e06a
reduce study scripts to work only as examples
jnnsbrr Jun 7, 2024
b7b268d
documenting and consistent naming
jnnsbrr Jun 7, 2024
df7876a
Update comments in individual.py
luaschwarz Jun 14, 2024
30a5984
Removed old comments in interface.py
luaschwarz Jun 14, 2024
605ed7f
Removed weights from interface.py
luaschwarz Jun 14, 2024
0c6db9e
streamline naming in world.py
luaschwarz Jun 17, 2024
377d307
streamline naming in individual.py
luaschwarz Jun 17, 2024
d2513e5
streamline naming __init__.py
luaschwarz Jun 17, 2024
340d0a8
streamline naming interface.py
luaschwarz Jun 17, 2024
d994dae
Streamline naming in model.py
luaschwarz Jun 17, 2024
215cb67
Merge pull request #9 from luaschwarz/couple_lpjml
jnnsbrr Jun 18, 2024
da872f6
fixes for inseeds, pik hpc and latest LPJmL and pycoupler version
jnnsbrr Jul 4, 2024
1c5330b
delete htm´l
Jul 5, 2024
c6dbcab
merge changes and debug
Jul 5, 2024
536f6d5
Merge branch 'inseeds-master'
Jul 5, 2024
d705965
add authors and incrementation for inseeds publication
Jul 5, 2024
19364f4
pioneers/traditionalist and fix zero comparison
jnnsbrr Oct 4, 2024
354dbe4
merge changes
jnnsbrr Oct 4, 2024
630df02
reduce pycopan:core to CORE, other projects go to pycopan-more and in…
jnnsbrr Nov 21, 2024
709ebae
make pycopancore compatible with testing lpjml component from other l…
jnnsbrr Nov 22, 2024
b25cbec
move lpjml component to own repo pycopanlpjml, make model logics more…
jnnsbrr Nov 27, 2024
943ab8d
Merge pull request #11 from jnnsbrr/master
jnnsbrr Nov 28, 2024
2033462
adjustments according to pull request
jnnsbrr Jan 24, 2025
4a97c88
Merge pull request #12 from jnnsbrr/master
jnnsbrr Jan 24, 2025
e529608
delete remaining unfisnished generic imitation work
jnnsbrr Jan 28, 2025
f09d71d
Merge pull request #13 from jnnsbrr/master
jnnsbrr Jan 28, 2025
9b5b766
adjust date
jnnsbrr Jan 28, 2025
3d81353
Merge pull request #14 from jnnsbrr/master
jnnsbrr Jan 28, 2025
8b5aa96
remove culture from world since its now part of a social_system and n…
jnnsbrr Jan 29, 2025
ed7f917
Merge pull request #15 from jnnsbrr/master
jnnsbrr Jan 29, 2025
dd2ad9d
readd util
jnnsbrr Feb 17, 2025
502dcd9
Merge pull request #16 from jnnsbrr/master
jnnsbrr Feb 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ eggs/
.eggs/
lib/
lib64/
.vscode/
parts/
sdist/
var/
Expand Down Expand Up @@ -71,6 +72,7 @@ docs/_build/
_build/*
_build


# PyBuilder
target/

Expand Down
16 changes: 14 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ cff-version: 1.2.0
message: If you use this software, please cite it using the metadata from this file.
type: software
title: 'pycopancore: Reference implementation of the copan:CORE World-Earth modelling framework'
version: 0.7.0
date-released: '2024-07-04'
version: 0.8.0
date-released: '2025-01-28'
abstract: The pycopancore package is a python implementation of the copan:CORE
modeling framework as described in this paper. The framework is designed to
allow an easy implementation of World-Earth (i.e., global social-ecological)
Expand All @@ -14,6 +14,18 @@ abstract: The pycopancore package is a python implementation of the copan:CORE
stochastic and deterministic events and therefore allows to compare different
model and component types and implementations.
authors:
- family-names: Breier
given-names: Jannes
email: jannesbr@pik-potsdam.de
orcid: 0000-0002-9055-6904
- family-names: Schwarz
given-names: Luana
email: lschwarz@pik-potsdam.de
orcid: 0000-0003-1726-1509
- family-names: Hotz
given-names: Ronja
email: ronja.hotz@kit.edu
orcid: 0000-0003-3425-268X
- family-names: Bechthold
given-names: Max
email: maxbecht@pik-potsdam.de
Expand Down
5 changes: 3 additions & 2 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ SPHINXOPTS = -E -a
SPHINXBUILD = sphinx-build
PYREVERSE = pyreverse
APIDOC = sphinx-apidoc
APIDOCOPTS = -l -d 2 -e -P -M -f -o ./docs/_api
SPHINX_APIDOC_OPTIONS=members,undoc-members,private-members,special-members,inherited-members,show-inheritance
DOT = dot
PAPER =
Expand Down Expand Up @@ -61,7 +62,7 @@ clean:
.PHONY: html
html:
@echo "Creating auto-generated documentation from source"
cd ..; $(APIDOC) --implicit-namespaces -f -o ./docs/_api ./pycopancore/ ./pycopancore/model_components/base/__init__.py ./pycopancore/model_components/seven_dwarfs/__init__.py
cd ..; $(APIDOC) $(APIDOCOPTS) --implicit-namespaces ./pycopancore/ #./pycopancore/model_components/base/__init__.py ./pycopancore/model_components/seven_dwarfs/__init__.py
@echo
@echo "Sphinx-apidoc is done, building directories"
$(SPHINXBUILD) -b html -v $(ALLSPHINXOPTS) $(BUILDDIR)/html
Expand All @@ -71,7 +72,7 @@ html:
.PHONY: api
api:
@echo
cd ..; $(APIDOC) -f -o ./docs/_api ./pycopancore/
cd ..; $(APIDOC) $(APIDOCOPTS) ./docs/_api ./pycopancore/

.PHONY : uml
uml:
Expand Down
23 changes: 12 additions & 11 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

# Napoleon settings
napoleon_numpy_docstring = True
napoleon_google_docstring = False
napoleon_google_docstring = True
napoleon_include_special_with_doc = True
# more info at http://www.sphinx-doc.org/en/stable/ext/
# napoleon.html#module-sphinx.ext.napoleon
Expand All @@ -54,14 +54,15 @@

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = ['.rst', '.md']
#source_suffix = '.rst'

# The encoding of source files.
#source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'
root_doc = 'index'

# General information about the project.
project = u'pycopancore'
Expand Down Expand Up @@ -100,15 +101,15 @@
#default_role = None

# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
add_function_parentheses = True

# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
add_module_names = False

# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
show_authors = True

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
Expand Down Expand Up @@ -185,19 +186,19 @@
html_domain_indices = True

# If false, no index is generated.
#html_use_index = True
html_use_index = True

# If true, the index is split into individual pages for each letter.
#html_split_index = False
html_split_index = True

# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
html_show_sourcelink = True

# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
html_show_sphinx = True

# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
html_show_copyright = True

# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Contents:
.. TODO: move introduction to inside this page so that it is more immediately available for reading?

.. toctree::
:maxdepth: 1
:maxdepth: 3
:titlesonly:

introduction
Expand Down
8 changes: 0 additions & 8 deletions examples/__init__.py

This file was deleted.

12 changes: 1 addition & 11 deletions pycopancore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,4 @@
#
# URL: <http://www.pik-potsdam.de/copan/software>
# Contact: core@pik-potsdam.de
# License: BSD 2-clause license

from .data_model import *
Comment thread
jnnsbrr marked this conversation as resolved.
from .process_types import *
from .runners import *
from .util import *

from .model_components import base

__url__ = "http://www.pik-potsdam.de/copan/software"
__version__ = "0.1.0"
# License: BSD 2-clause license
70 changes: 70 additions & 0 deletions pycopancore/data_model/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,73 @@
"""
==========
Data model
==========

**************************
Variable naming convention
**************************

We suggest to use rather descriptive variable names that make the relevant
dimension clear in the following fashion:

* Variables that represent integer cardinalities should be called **numbers**
(possibly abbreviated as `n`, `no`, or `num`) or **counts**.

* Extensive variables of simple physical dimension should be called **stocks**,
e.g. `atmospheric_carbon_stock` of dimension `carbon` and default unit `GtC`,
or `physical_capital_stock` of dimension `monetary_value` and default unit `dollars`.

* Intensive variables of simple physical dimension should *not* be called 'stocks'
to distinguish them from extensive variables. E.g. `surface_air_temperature`
of dimension `temperature` and default unit `kelvins`.

* Variables that represent a stock per surface area, volume, or mass should be
called **densities**, e.g., `vegetation_carbon_density` in `GtC/m2` or
`energy_density_of_wood` in `MJ/kg`.

* Variables that represent (changes of) stocks per time or time derivatives of stocks
should be called **flows**, e.g. `photosynthesis_carbon_flow` of dimension
`carbon/time` and default unit `GtC/yr`, or `income_flow` of dimension `money/time`
and default unit `dollars/yr`.

* Variables that represent flows per surface area should be called **fluxes**,
e.g. `sensible_heat_flux` of dimension `energy/time/area` and default unit
`W/m^2`.

* Variables of dimension `time` that represent specific unique time points
should be called **time_points** or **dates**, e.g., `net_zero_date`.

* Variables of dimension `time` that represent amounts of time *between*
time points should be called **delays**, **intervals**, **durations**,
**periods**, **ages**, etc., or sometimes just **times**.
e.g. `business_cycle_period` or `Individual.age`.

* Variables of dimension `1/time` referring to periodic occurrences should be
called **frequencies**, i.e., `voting_frequency`.

* Other variables of dimension `1/time` should be called **rates**, e.g.
`equilibration_rate`, `discount_rate`, `depreciation_rate`, `diffusion_rate`.
Variables of other dimension than `1/time`, in particular fractions or ratios,
should *not* be called 'rates'.

* Dimensionless variables between 0 and 1 that represent parts of a whole
should be called **fractions** or **shares**, e.g. `dirty_fraction` or
`fossil_energy_share`.

* Dimensionless variables that represent the relative size of one quantity as
compared to another quantity of the same dimension should be called **ratios**,
e.g., `cost_benefit_ratio`.

* Variables representing the derivative of one quantity w.r.t. another quantity
(other than time) should be called **sensitivities**, e.g.
`temperature_sensitivity_of_photosynthesis`.

* Variables representing the derivative of the *logarithm* of one quantity w.r.t.
the logarithm of another quantity should be called **elasticities**, e.g.
`labor_elasticity_of_fossil_energy_production`.
"""


# This file is part of pycopancore.
#
# Copyright (C) 2016-2017 by COPAN team at Potsdam Institute for Climate
Expand Down
4 changes: 2 additions & 2 deletions pycopancore/data_model/dimensional_quantity.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
# Contact: core@pik-potsdam.de
# License: BSD 2-clause license

from . import dimension
from . import unit as U
from pycopancore.data_model import dimension
from pycopancore.data_model import unit as U


class DimensionalQuantity(object):
Expand Down
1 change: 0 additions & 1 deletion pycopancore/data_model/master_data_model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,3 @@
from .group import Group as group
from .group import Group

from .. import unity
10 changes: 7 additions & 3 deletions pycopancore/data_model/master_data_model/cell.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,20 @@
# Contact: core@pik-potsdam.de
# License: BSD 2-clause license

from . import ENV, MET
from . import square_kilometers
from pycopancore.data_model.master_data_model.environment \
import Environment as ENV
from pycopancore.data_model.master_data_model.metabolism \
import Metabolism as MET
from pycopancore.data_model.master_data_model.dimensions_and_units \
import DimensionsAndUnits as DAU


class Cell:

# natural:

land_area = ENV.land_area.copy()
land_area.default = 1 * square_kilometers
land_area.default = 1 * DAU.km2
atmospheric_carbon = ENV.atmospheric_carbon.copy()
surface_air_temperature = ENV.surface_air_temperature.copy()
ocean_carbon = ENV.ocean_carbon.copy()
Expand Down
5 changes: 2 additions & 3 deletions pycopancore/data_model/master_data_model/culture.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
# Contact: core@pik-potsdam.de
# License: BSD 2-clause license

from .. import Variable

from networkx import DiGraph, Graph

from .. import unity
from pycopancore.data_model.variable import Variable
from pycopancore.data_model.unit import unity


class Culture:
Expand Down
Loading