From 0e583d0cc9de44bc04723b8fdbd92e065bcb4988 Mon Sep 17 00:00:00 2001 From: Jakob Duerrwaechter Date: Wed, 12 Nov 2025 13:41:38 +0100 Subject: [PATCH 01/14] compute processes, whole implementation --- examples/example1.ipynb | 19 +- examples/example2.py | 58 ++--- examples/example3.ipynb | 10 +- examples/example5.ipynb | 14 +- flodym/__init__.py | 18 +- flodym/config.py | 87 +++++++ flodym/dimensions.py | 34 ++- flodym/flodym_arrays.py | 51 +++- flodym/flow_helper.py | 11 +- flodym/mfa_definition.py | 15 +- flodym/mfa_system.py | 126 ++++------ flodym/processes.py | 523 ++++++++++++++++++++++++++++++++++++++- flodym/stocks.py | 282 +++++++++++++++------ howtos/06_stocks.py | 4 +- 14 files changed, 1022 insertions(+), 230 deletions(-) create mode 100644 flodym/config.py diff --git a/examples/example1.ipynb b/examples/example1.ipynb index 19a098e..3251d27 100644 --- a/examples/example1.ipynb +++ b/examples/example1.ipynb @@ -68,9 +68,7 @@ "elements = Dimension(\n", " name=\"Elements\",\n", " letter=\"e\",\n", - " items=[\n", - " \"single material\",\n", - " ],\n", + " items=[\"single material\"],\n", ")\n", "dimensions = DimensionSet(dim_list=[time, elements])\n", "\n", @@ -148,9 +146,8 @@ "source": [ "class SimpleMFA(MFASystem):\n", " def compute(self):\n", - " self.flows[\"sysenv => process 1\"][...] = self.parameters[\n", - " \"D\"\n", - " ] # the elipsis slice [...] ensures the dimensionality of the flow is not changed\n", + " # the elipsis slice [...] ensures the dimensionality of the flow is not changed\n", + " self.flows[\"sysenv => process 1\"][...] = self.parameters[\"D\"]\n", " self.flows[\"process 1 => process 2\"][...] = (\n", " 1 / (1 - self.parameters[\"alpha\"]) * self.parameters[\"D\"]\n", " )\n", @@ -7953,9 +7950,9 @@ "\n", "window.Plotly = Plotly;\n", "return Plotly;\n", - "}));