Mat-dp
Mat-dp: An open-source Python model for analysing material demand projections and their environmental implications, which result from building low-carbon systems. - Published in JOSS (2022)
Science Score: 93.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 4 DOI reference(s) in README and JOSS metadata -
✓Academic publication links
Links to: joss.theoj.org -
○Committers with academic emails
-
○Institutional organization owner
-
✓JOSS paper metadata
Published in Journal of Open Source Software
Keywords
Scientific Fields
Repository
Mat-dp core cotains the key methods used in the broader Mat-dp model. Mat-dp aims to deliver user-friendly and open-access software to study the environmental implications of materials used for building low-carbon systems.
Basic Info
- Host: GitHub
- Owner: Mat-dp
- License: other
- Language: Python
- Default Branch: master
- Homepage: https://client.dreamingspires.dev/mat_dp_core/
- Size: 409 KB
Statistics
- Stars: 9
- Watchers: 1
- Forks: 6
- Open Issues: 7
- Releases: 1
Topics
Metadata Files
README.md
Mat-dp core
Material Demand Projections Model
Welcome to the Mat-dp core. This repo represents the core of the Mat-dp project, which aims to deliver user-friendly and open-access software to study the environmental implications of materials used for building low-carbon systems.
Installation and launch
You can find mat-dp-core in PyPi. You can then install it using:
pip install mat-dp-core
There is an examples folder you can access either navigating to it or using the following command:
cd examples
You can then run examples, such as the pizza box example called test.py
Concepts
Definitions
The following terms will be used frequently:
Resource - A resource to be produced or consumed, such as steel or aluminium.
Process - A process which produces and/or consumes resources.
Constraint - A condition the system is placed under.
Run Ratio Constraint - A constraint that fixes the ratio of runs between two processes - e.g. wind and solar will run at a ratio of 1:2.
Resource Constraint - A constraint on the amount of resource produced, e.g. we must produce at least 10 energy.
Run Eq Constraint - A constraint that specifies the number of runs a process must make.
Objective - The objective function is the property of the system which will be minimised. This could be something like the number of runs of the system, or the total cost.
Measurement - a measurement taken of the solved system, determining the
Usage - High Level
Introduction
The below describes a practical example of using MAT-dp. Imagine...
- Pizza boxes are made from cardboard and recycled cardboard. (process/resource)
- There are different processes for making them, which have different ratios of
cardboard:recycled_cardboard. (process) - We wish to priorites the process that uses the most recycled cardboard, but not so as to eliminate the less efficient version. (ratio constraint)
- We then, rather inefficiently, burn them to produce energy. (process)
- We must produce at least 8 kWh of energy to survive the frosty winters. (resource constraint)
- We wish to only generate the minimum amount of cardboard and pizza boxes. (objective)
- How many pizza boxes must we burn to survive? (measurement) ## Step 1: Define resources
Firstly we must define all the resources we wish to use, with their name and units.
```py from matdpcore import Resources
resources = Resources() cardboard = resources.create("cardboard", unit="m2") recycledcardboard = resources.create("recycledcardboard", unit="m2") pizzabox = resources.create("pizzabox") energy = resources.create("energy", unit="kWh") ```
Step 2: Define processes
We must now take these resources and use them to define our processes. These are defined by a name and the resources that they produce and consume.
py
from mat_dp_core import Processes
processes = Processes()
cardboard_producer = processes.create("cardboard producer", (cardboard, +1))
recycled_cardboard_producer = processes.create(
"recycled cardboard producer", (recycled_cardboard, +1)
)
pizza_box_producer = processes.create(
"pizza box producer",
(recycled_cardboard, -0.5),
(cardboard, -2),
(pizza_box, 1),
)
recycled_pizza_box_producer = processes.create(
"recycled pizza box producer",
(recycled_cardboard, -3),
(cardboard, -1),
(pizza_box, 1),
)
power_plant = processes.create("power plant", (pizza_box, -1), (energy, 4))
energy_grid = processes.create("energy grid", (energy, -2))
Step 3: Define constraints
Now we need to define the constraints of the problem. We want to specify we take equal amounts of pizza boxes from each producer (Run ratio constraint), and that we only require 8 kWh of energy (Resource constraint):
py
from mat_dp_core import EqConstraint
constraints = [
EqConstraint(
"recycled pizza box ratio",
pizza_box_producer - recycled_pizza_box_producer,
0,
),
EqConstraint("required energy", energy_grid, 8),
]
Step 4: Define an objective function
Once we've established all of our constraints, we must define an objective function. The below example specifies we minimise the total number of runs:
```py
Minimise total number of runs
objective = ( cardboardproducer + recycledcardboardproducer + pizzaboxproducer + recycledpizzaboxproducer + powerplant + energygrid ) ```
Step 5: Make a measurement
We must now measure the number of pizza boxes to burn.
```py from matdpcore import Measure
measurement = Measure(resources, processes, constraints, objective)
print(measurement.resource(resource = pizza_box))
``` For a more stylised version of the print statement, the following may be used:
```py
for process in measurement.resource(resource=pizza_box): print(str(process[0].name).ljust(50) + ": " + str(round(process[1], 1)))
```
Visualising the documentation
To view the documentation in html format, go to this website or run the documentation through mkdocs using the following command at the root of the repository:
poetry run mkdocs serve
Contributing to Mat-dp
Contributions are welcome!
If you see something that needs to be improved, open an issue in the respective section of the repository. If you have questions, need assistance or need better instructions for contributing, please get in touch via e-mail mentioning "Mat-dp" in the subject.
Developers of mat-dp-core need to make changes using poetry with the following instructions:
Please install poetry- please see here
Then, install mat-dp-core with:
poetry add mat-dp-core
To install all the project dependencies
poetry install
Then go the examples folder
cd examples
Then run the pizza box example to test everything works.
poetry run python3 test.py
For any questions on how to use the software, please refer to the documentation. It contains useful definitions and examples of using the software. Please contact us by e-mail for any other support requried.
Owner
- Name: Mat-dp
- Login: Mat-dp
- Kind: organization
- Email: eng-refficiency-enquiries@o365.cam.ac.uk
- Repositories: 2
- Profile: https://github.com/Mat-dp
Mat-dp stands for Material Demand Projections. It is a model to study the environmental implications of materials used for building low-carbon systems.
JOSS Publication
Mat-dp: An open-source Python model for analysing material demand projections and their environmental implications, which result from building low-carbon systems.
Tags
materials python low carbon material efficiency material demand environmental implications embodied emissionsGitHub Events
Total
Last Year
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| mark-todd | m****d@h****k | 105 |
| Elliott Hughes | e****e@g****m | 30 |
| Karla Cervantes Barron | k****r@g****m | 23 |
| Edd Salkield | e****d@s****k | 7 |
| Arfon Smith | a****n | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 14
- Total pull requests: 16
- Average time to close issues: about 2 months
- Average time to close pull requests: 6 days
- Total issue authors: 7
- Total pull request authors: 5
- Average comments per issue: 1.5
- Average comments per pull request: 0.0
- Merged pull requests: 15
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- mark-todd (4)
- MoLi7 (3)
- robbiemorrison (2)
- nick-gorman (2)
- elliott-huge (1)
- glatterf42 (1)
- willu47 (1)
Pull Request Authors
- mark-todd (12)
- willu47 (2)
- arfon (1)
- elliott-huge (1)
- kcerva (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 10 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 2
- Total maintainers: 1
pypi.org: mat-dp-core
- Documentation: https://mat-dp-core.readthedocs.io/
- License: MIT
-
Latest release: 0.1.1
published over 3 years ago
Rankings
Maintainers (1)
Dependencies
- atomicwrites 1.4.0 develop
- attrs 21.4.0 develop
- autoflake 1.4 develop
- black 21.12b0 develop
- cfgv 3.3.1 develop
- click 8.1.3 develop
- colorama 0.4.5 develop
- coverage 6.4.1 develop
- distlib 0.3.4 develop
- execnet 1.9.0 develop
- filelock 3.7.1 develop
- ghp-import 2.1.0 develop
- identify 2.5.1 develop
- importlib-metadata 4.12.0 develop
- iniconfig 1.1.1 develop
- isort 5.10.1 develop
- jinja2 3.1.2 develop
- markdown 3.3.7 develop
- markupsafe 2.1.1 develop
- mergedeep 1.3.4 develop
- mkdocs 1.3.0 develop
- mkdocs-material 8.3.8 develop
- mkdocs-material-extensions 1.0.3 develop
- mypy-extensions 0.4.3 develop
- nodeenv 1.7.0 develop
- packaging 21.3 develop
- pathspec 0.9.0 develop
- platformdirs 2.5.2 develop
- pluggy 1.0.0 develop
- pre-commit 2.19.0 develop
- py 1.11.0 develop
- pyflakes 2.4.0 develop
- pygments 2.12.0 develop
- pymdown-extensions 9.5 develop
- pyparsing 3.0.9 develop
- pytest 6.2.5 develop
- pytest-asyncio 0.14.0 develop
- pytest-cov 2.12.1 develop
- pytest-forked 1.4.0 develop
- pytest-xdist 2.5.0 develop
- python-dateutil 2.8.2 develop
- pyyaml 6.0 develop
- pyyaml-env-tag 0.1 develop
- six 1.16.0 develop
- toml 0.10.2 develop
- tomli 1.2.3 develop
- typing-extensions 4.2.0 develop
- virtualenv 20.15.1 develop
- watchdog 2.1.9 develop
- zipp 3.8.0 develop
- numpy 1.23.0
- scipy 1.8.1
- autoflake ^1.4 develop
- black ^21.9b0 develop
- isort ^5.9.3 develop
- mkdocs ^1.2.3 develop
- mkdocs-material ^8.1.7 develop
- pre-commit ^2.15.0 develop
- pytest ^6.0 develop
- pytest-asyncio ^0.14.0 develop
- pytest-cov ^2.11.1 develop
- pytest-xdist ^2.2.1 develop
- numpy ^1.23.0
- python >=3.9,<3.10
- scipy ^1.7.1
- actions/checkout v2 composite
- actions/upload-artifact v1 composite
- openjournals/openjournals-draft-action master composite
