Skip to main content

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:

  1. Create and activate a python environment
python -m venv .venv
.venv\Scripts\activate
  1. Install the package

You can install directly once the package is published to PyPI (not ready? use poetry):

pip install utopia-pkg
  1. 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.

Metadata

Release files for utopia-pkg 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for utopia-pkg 0.1.4
File Size Uploaded
utopia_pkg-0.1.4.tar.gz 59.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for utopia-pkg 0.1.4
File Interpreter ABI Platform
utopia_pkg-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 138.3 kB

Release files / utopia_pkg-0.1.4.tar.gz

Download URL utopia_pkg-0.1.4.tar.gz
Size 59.7 kB
Tags Source
SHA-256 checksum
How to use checksums
290a9cfe3f390e92bc51650ffa428c1b9d98d985f9f8c1cb79b6ae0fb03662d1
BLAKE2b-256 checksum
How to use checksums
c318f95c131866cd3a7305d6e5140465886ecd539138678607634fa51e23ae19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.11.13 Windows/10

Release files / utopia_pkg-0.1.4-py3-none-any.whl

Download URL utopia_pkg-0.1.4-py3-none-any.whl
Size 78.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
de86b3570491f17f2ccb1ea11f558f8cabaa73f08cb6ea785632a517c86c3e92
BLAKE2b-256 checksum
How to use checksums
00d3dbd01eb3b04595e369be422cfb4233cf2706c450d615d84eb21191fc86c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.11.13 Windows/10

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page