Skip to main content

Library to train and run the CENTURY (Soil Organic Matter) model

Project description

CenturyPy

CenturyPy is a Python library for training and running the Century (Soil Organic Matter) model. For more information about Century, take a look at this link.

This is the first version of the library and only simulates the dynamic for the carbon.

Installation

Use the package manager pip to install centurypy.

pip install centurypy

Usage

from centurypy import CenturyPy

# define the model, the first parameter is the file with the samples's data.
# the second parameter is a dictionary containing the initial conditions 
# from where the samples were taken
model = CenturyPy('./data.csv',{
    "necromasa": 2140,  # Necromass
    "acto": 50.04,      # Initial value for the Active container
    "leno": 2250,       # Initial value for the Slow container
    "paso": 19150,      # initial value for the Pasive container
    "respo": 0,         # initial value for the Respiration
    "ln": 0.33,         # Lignin
    "frala": 0.33,      # Fine soil fraction
})


# begin training, default 500 generations
model.fit_model()

# in case you want more precission, you can define 
# the number of generations using an integer
model.fit_model(1000)

# or using the parameter's name
model.fit_model(generations = 1000)

# by default, the library draws a chart containing the result of the training, in case you 
# don't want to show that chart, you can disable it using the second parameter as follows
model.fit_model(generations = 500, chart = False)

The supported intput's file format is colon separated CSV (,). The content of that file must be the sample's data without the headers. It must have only three columns, the first one represents the time when the sample was taken, the second one represents the value for the active container and the last one represents the value for the respiration.

An example is shown bellow:

     1, 243, 118.52
     2, 192, 512.245
     3, 240, 840.725
     4, 235, 1396.19
     5, 314, 1895.14625
     8, 241, 2195.29625
    11, 213, 2509.59625
    18, 185, 2892.02125
    25, 177, 3147.39625
    30, 114, 3203.66125

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Author

This library was developed by Gerardo Vivas. Any questions about it have no doubt in contact me by email vivas.fermin24@gmail.com

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

centurypy-1.0.5.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

centurypy-1.0.5-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file centurypy-1.0.5.tar.gz.

File metadata

  • Download URL: centurypy-1.0.5.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.3

File hashes

Hashes for centurypy-1.0.5.tar.gz
Algorithm Hash digest
SHA256 06527da5d5c5b337d3fe359b6b57528db82a3f185366af27a136bcea3e09bf32
MD5 3f908727f3e871ed7b48f97b5471812e
BLAKE2b-256 9f20177de1f0582d1169cabdfbb306bf6cb485400a9844ced7a914bcc921a061

See more details on using hashes here.

File details

Details for the file centurypy-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: centurypy-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.3

File hashes

Hashes for centurypy-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 73c37c5b1ba31fb2f2d577643bb7084b51031614ba6c68d2147981ebc5746cee
MD5 8e131512e9cb6da8a35a60631c372fc7
BLAKE2b-256 d127142ae24a3587791498970211ce2865f85851967d36286b0e4369b281c6f6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page