flodym
The Flexibe Open Dynamic Material Systems Model library provides key functionality for building material flow analysis models.
https://github.com/pik-piam/flodym
Category: Industrial Ecology
Sub Category: Life Cycle Assessment
Last synced: about 1 hour ago
JSON representation
Repository metadata
library for material flow analysis models
- Host: GitHub
- URL: https://github.com/pik-piam/flodym
- Owner: pik-piam
- License: mit
- Created: 2024-07-31T12:30:43.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-12-19T09:16:19.000Z (24 days ago)
- Last Synced: 2025-12-20T01:44:01.949Z (23 days ago)
- Language: Python
- Homepage: https://flodym.readthedocs.io
- Size: 11.5 MB
- Stars: 22
- Watchers: 2
- Forks: 6
- Open Issues: 16
- Releases: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
README.md
flodym
The flodym (Flexibe Open Dynamic Material Systems Model) library provides key functionality for building material flow analysis models, including
- the class
MFASystemacting as a template (parent class) for users to create their own material flow models - the class
FlodymArrayhandling mathematical operations between multi-dimensional arrays - different classes representing stocks accumulation, in- and outflows based on age cohort tracking and lifetime distributions. Those can be integrated in the
MFASystem. - different options for data input and export, as well as visualization
Thanks
flodym (flexible ODYM) is an adaptation of:
ODYM
Copyright (c) 2018 Industrial Ecology
author: Stefan Pauliuk, Uni Freiburg, Germany
https://github.com/IndEcol/ODYM
We gratefully acknowledge funding from the TRANSIENCE project, grant number 101137606, funded by the European Commission within the Horizon Europe Research and Innovation Programme, from the Kopernikus-Projekt Ariadne through the German Federal Ministry of Education and Research (grant no. 03SFK5A0-2), and from the PRISMA project funded by the European Commission within the Horizon Europe Research and Innovation Programme under grant agreement No. 101081604 (PRISMA).
Installation
flodym dependencies are managed with pip.
To install as a user: run python -m pip install flodym
To install as a developer:
- Clone the flodym repository using git.
- From the project main directory, run
pip install -e ".[tests,docs,examples]"to obtain all the necessary
dependencies, including those for running the tests, making the documentation, and running the examples.
Note that it is advisable to do this within a virtual environment.
Why choose flodym?
MFA models mainly consist on mathematical operations on different multi-dimensional arrays.
For example, the generation of different waste types waste might be a 3D-array defined over the dimensions time $t$, region $r$ and waste type $w$, and might be calculated from multiplying end_of_life_products (defined over time, region, and product type $p$) with a waste_share mapping from product type to waste type.
In numpy, the according matrix multiplication can be carried out nicely with the einsum function, were an index string indicates the involved dimensions:
waste = np.einsum('trp,pw->trw', end_of_life_products, waste_share)
flodym uses this function under the hood, but wraps it in a data type FlodymArray, which stores the dimensions of the array and internally manages the dimensions of different arrays involved in mathematical operations.
With this, the above example reduces to
waste[...] = end_of_life_products * waste_share
This gives a flodym-based MFA models the following properties:
- Flexibility: When changing the dimensionality of any array in your code, you only have to apply the change once, where the array is defined, instead of adapting every operation involving it. This also allows, for example, to add or remove an entire dimension from your model with minimal effort.
- Simplicity: Since dimensions are automatically managed by the library, coding array operations becomes much easier. No knowledge about the einsum function, about the dimensions of each involved array or their order are required.
- Versatility: We offer different levels of flodym use: Users can choose to use the standard methods implemented for data read-in, system setup and visualization, or only use only some of the data types like
FlodymArray, and custom methods for the rest. - Robustness: Through the use of Pydantic, the setup of the system is type-checked, highlighting errors early-on. The data read-in performs extensive checks on data sorting and completeness.
- Performance: The use of numpy ndarrays ensures low model runtimes compared with dimension matching through pandas dataframes.
How to contribute
If you'd like to contribute, the issues page lists possible extensions and improvements.
If you wish to contribute your own, just create a fork and open a PR!
Documentation
See our readthedocs page for documentation!
The notebooks in the examples folder provide usage examples of the code.
Owner metadata
- Name: Potsdam Integrated Assessment Modelling (PIAM)
- Login: pik-piam
- Email:
- Kind: organization
- Description: Tools developed for use with data and models related to PIK's research.
- Website: https://www.pik-potsdam.de/
- Location: Potsdam Institute for Climate Impact Research (PIK), Germany
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/29039634?v=4
- Repositories: 50
- Last ynced at: 2023-02-27T11:50:27.848Z
- Profile URL: https://github.com/pik-piam
GitHub Events
Total
- Create event: 13
- Release event: 6
- Issues event: 11
- Watch event: 12
- Delete event: 7
- Issue comment event: 8
- Push event: 69
- Pull request review comment event: 6
- Gollum event: 1
- Pull request review event: 30
- Pull request event: 56
- Fork event: 3
Last Year
- Create event: 13
- Release event: 6
- Issues event: 8
- Watch event: 12
- Delete event: 7
- Issue comment event: 7
- Push event: 68
- Pull request review comment event: 6
- Gollum event: 1
- Pull request review event: 30
- Pull request event: 54
- Fork event: 3
Committers metadata
Last synced: about 22 hours ago
Total Commits: 323
Total Committers: 10
Avg Commits per committer: 32.3
Development Distribution Score (DDS): 0.567
Commits in past year: 165
Committers in past year: 7
Avg Commits per committer in past year: 23.571
Development Distribution Score (DDS) in past year: 0.539
| Name | Commits | |
|---|---|---|
| Jakob Duerrwaechter | j****r@p****e | 140 |
| pre-commit-ci[bot] | 6****] | 80 |
| Sally Dacie | s****a@p****e | 51 |
| Bennet Weiss | b****s@p****e | 16 |
| Merjo | m****k@p****e | 15 |
| copilot-swe-agent[bot] | 1****t | 13 |
| Sally Dacie | s****a@L****e | 4 |
| Gergo Suto | g****o@p****e | 2 |
| SallyDa | s****e@g****m | 1 |
| Leonie Schweiger | l****r@p****e | 1 |
Committer domains:
- pik-potsdam.de: 4
- proton.me: 1
- lt1189.pik-potsdam.de: 1
- pilos.de: 1
Issue and Pull Request metadata
Last synced: 19 days ago
Total issues: 5
Total pull requests: 51
Average time to close issues: 5 months
Average time to close pull requests: 6 days
Total issue authors: 2
Total pull request authors: 7
Average comments per issue: 1.0
Average comments per pull request: 0.22
Merged pull request: 38
Bot issues: 0
Bot pull requests: 9
Past year issues: 4
Past year pull requests: 51
Past year average time to close issues: 5 months
Past year average time to close pull requests: 6 days
Past year issue authors: 2
Past year pull request authors: 7
Past year average comments per issue: 1.0
Past year average comments per pull request: 0.22
Past year merged pull request: 38
Past year bot issues: 0
Past year bot pull requests: 9
Top Issue Authors
- JakobBD (4)
- bennet21 (1)
Top Pull Request Authors
- JakobBD (34)
- pre-commit-ci[bot] (9)
- bennet21 (4)
- Copilot (1)
- Merjo (1)
- gergosuto (1)
- leonieschweiger (1)
Top Issue Labels
- enhancement (1)
- discussion (1)
Top Pull Request Labels
Package metadata
- Total packages: 1
-
Total downloads:
- pypi: 270 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 11
- Total maintainers: 1
pypi.org: flodym
- Homepage:
- Documentation: https://flodym.readthedocs.io/
- Licenses: mit
- Latest release: 0.5.3 (published 24 days ago)
- Last Synced: 2026-01-10T22:03:22.256Z (1 day ago)
- Versions: 11
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 270 Last month
-
Rankings:
- Dependent packages count: 9.761%
- Average: 32.353%
- Dependent repos count: 54.946%
- Maintainers (1)
Dependencies
- PyYAML ^6.0
- matplotlib ^3.7.1
- numpy ^1.25.0
- pandas ^2.0.2
- pickle4 ^0.0.1
- plotly ^5.18.0
- python >=3.10,<3.13
- scipy ^1.11.0
- actions/checkout v4 composite
- actions/setup-python v3 composite
- Faker ==30.8.0
- PyYAML ==6.0.2
- annotated-types ==0.7.0
- attrs ==24.2.0
- charset-normalizer ==3.4.0
- colorama ==0.4.6
- contourpy ==1.3.0
- cycler ==0.12.1
- docformatter ==1.7.5
- et-xmlfile ==1.1.0
- fastjsonschema ==2.20.0
- fonttools ==4.54.1
- iniconfig ==2.0.0
- jsonschema ==4.23.0
- jsonschema-specifications ==2024.10.1
- jupyter_core ==5.7.2
- kiwisolver ==1.4.7
- matplotlib ==3.9.2
- nbformat ==5.10.4
- numpy ==2.1.2
- openpyxl ==3.1.5
- packaging ==24.1
- pandas ==2.2.3
- pickle4 ==0.0.1
- pillow ==11.0.0
- platformdirs ==4.3.6
- plotly ==5.24.1
- pluggy ==1.5.0
- polyfactory ==2.17.0
- pydantic ==2.9.2
- pydantic_core ==2.23.4
- pyparsing ==3.2.0
- pytest ==8.3.3
- python-dateutil ==2.9.0.post0
- pytz ==2024.2
- pywin32 ==308
- referencing ==0.35.1
- rpds-py ==0.20.0
- scipy ==1.14.1
- setuptools ==75.2.0
- six ==1.16.0
- tenacity ==9.0.0
- traitlets ==5.14.3
- typing_extensions ==4.12.2
- tzdata ==2024.2
- untokenize ==0.1.1
Score: 11.542290073600132