package to run the UTOPIA unit world model to estimate mass and particle distribution of microplastics in a unit world model composed of 17 compartments covering air, water, soil and sediments. Results are given for 5 size fractions ranging from hundreds of nanometers to milimiters and 4 aggregation states. Exposure indicators such as persistence and characteristic travel distance are also given as outputs.
Project description
utopia_package
Package to run the UTOPIA unit world model, a process-based mass balance model that estimates mass and particle number distributions of microplastics in a unit world model composed of 17 compartments covering air, water, soil and sediments though steady state solution of a 340 coupled first-order differential equations. Results are given for 5 size fractions ranging from hundreds of nanometers to milimiters and 4 aggregation states. Exposure indicators such as overall persistence and residence time are also given as outputs. Sensitivity and uncertainty analysis are possible using the Monaco Monte Carlo framework
This package version is based on the original UTOPIA model (see [https://github.com/microplastics-cluster/UTOPIA_model]). It has been refactored for package use and includes updated process formulations and parameterizations. The package version also includes shape functionalities where users can run the model for spheres and fibers.
Installation
Before installing and testing the package, it is highly recommended to set up a virtual environment, this can be made as follows:
- Create and activate a python environment
python -m venv .venv
.venv\Scripts\activate
- Install the package
You can install directly once the package is published to PyPI (not ready? use poetry):
pip install utopia-pkg
- To verify the installation:
import utopia
print(utopia.__version__)
Quick Start
You can run the UTOPIA model either:
- From Jupyter notebooks (recommended for new users — see docs/), or
- Using the provided example script (docs/run_utopia_example.py).
Run the example python script
After installation, you can execute the model using the provided example script:
poetry run python docs/run_utopia_example.py
This script:
- Loads example configuration and data (data/default_config.json and data/default_data.json),
- Initializes and runs the UTOPIA model,
- Checks the mass balance (Difference inflow-outflow),
- Processes the results,
- Prints exposure indicators and mass and particle number distribution figures.
If successful, you should see printed summaries of model results in your terminal and output files printed such as the mentioned plots.
Run the model interactively using the step by step guide jupyter notebook
The notebooks in docs/ provide guided examples that explain each step, configuration parameter, and output indicator in detail.
Explore the following tutorials:
-Generic utopia step by step guide -Fiber specific step by step guide -Sensitivity and Uncertainty analysis tutorial
Contributing
Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.
License and authorship
Developed by Prado Domercq with contributions from Xiaoyu Zhang
Transferred to microplastics-cluster for continued collaborative development and maintenance
utopia is licensed under the terms of the MIT license.
Acknowledgements
Thanks to the European Chemical Industry Council Long-Range Research Initiative (Cefic-LRI) for providing funding for this work, under project number ECO56.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file utopia_pkg-0.1.4.tar.gz.
File metadata
- Download URL: utopia_pkg-0.1.4.tar.gz
- Upload date:
- Size: 59.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.11.13 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
290a9cfe3f390e92bc51650ffa428c1b9d98d985f9f8c1cb79b6ae0fb03662d1
|
|
| MD5 |
a17b291be0fd2b4b487c2e4a5c295e2b
|
|
| BLAKE2b-256 |
c318f95c131866cd3a7305d6e5140465886ecd539138678607634fa51e23ae19
|
File details
Details for the file utopia_pkg-0.1.4-py3-none-any.whl.
File metadata
- Download URL: utopia_pkg-0.1.4-py3-none-any.whl
- Upload date:
- Size: 78.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.11.13 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de86b3570491f17f2ccb1ea11f558f8cabaa73f08cb6ea785632a517c86c3e92
|
|
| MD5 |
75b0e89cba07da1a9658d0381f43f1c3
|
|
| BLAKE2b-256 |
00d3dbd01eb3b04595e369be422cfb4233cf2706c450d615d84eb21191fc86c9
|