🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

mater

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mater

Multi-regional Assessment of Technologies, Energy and Resources

0.12.2
PyPI
Maintainers
1

MATER

Metabolic Analysis for Transdisciplinary Ecological Research

[TOC]

📋 Requirements

  • Python 3.12 or higher

We recommend using one virtual environment per Python project to manage dependencies and maintain isolation. You can use a package manager like uv to help you with library dependencies and virtual environments.

📦 Install the Mater Package

Install the mater package via pip:

pip install mater

⚙️ Run a Simulation

The mater command line interface (CLI) makes it easy to run simulations. Ensure the required Excel input file (chose a compatible version) is located in the root of your working directory.

Run the following command to start a simulation from your excel file:

mater run -i <YOUR_INPUT_FILE_NAME>

📊 Visualize Variables

Simulation results are stored locally in Parquet (.mater) files.

Output variables description

Output variableUnitDefinitionExample
control_flow<object_unit>/timeObject footprint demand before trade between locationsNumber of cars consumed in China (included the imported ones)
extraneous_flow<object_unit>/timeObject consumption or coproductionC02 coproduced (+ value) and coal consumed (- value) by the electricity production process of a coal power plant
in_use_stock<object_unit>Object in use stockNumber of cars in use
old_stock<object_unit>Object stock in landfillNumber of end of life cars unrecycled
process<process_unit>/timeNumber of process made by an objectTransportation process (km/year) made by cars
recycling_flow<object_unit>/timeQuantity of recycled objectsRecycled end of life cars
reference_intensity_of_use<process_unit>/<object_unit>/timeIntensity of useNumber of km per year made by a car
reference_stock<object_unit>How many objects should be in the in use stockInstalled power plant capacity to fulfill the electricity demand
secondary_production<object_unit>/timeCoproduction due to recycling processesQuantity of steel recycled (coproduce by recycling) in a year
self_disposal_flow<object_unit>/timeEnd of life flowNumber of cars that cannot work anymore
traded_control_flow<object_unit>/timeObject supply after trade between locationsNumber of cars produced in China (included the exported ones)

User Interface

Results can be visualize in a built-in user interface. Go to the directory containing the result folder and use the following command :

mater plot -o <YOUR_RESULT_FOLDER_NAME>

Accessing the Results from a Python Script

Below is an example Python script using pandas and matplotlib to plot specific simulation results. Each folder in the output directory corresponds to a variable that can be loaded with pandas.

# Import the MATER package and matplotlib.pyplot
import matplotlib.pyplot as plt
from mater import Mater

# Create a Mater instance
model = Mater()

# Select the output directory where the run results are stored
model.set_output_dir()  # Defaults to the working directory

# Set the run directory name
model.set_run_name("run0")

# Get a variable
in_use_stock = model.get("in_use_stock")

# Transform the dataframe and plot the results
in_use_stock.groupby(level=["location", "object"]).sum().T.plot()
plt.show()

This example demonstrates how to access and plot variables from simulation outputs. Adjust the code to fit your analysis needs.

🤝 Contributing

We welcome contributions to the MATER project! To get started, please refer to the CONTRIBUTING file for detailed guidelines.

📚 Online Documentation

For more information, refer to the official MATER documentation.

Keywords

ecological

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts