Skip to content

AgriculturalModelExchangeInitiative/PyCrop2ML

Repository files navigation

Pycrop2ml

Documentation Status CodeQL Status

A Python library to generate components from Crop2ML declarative language.

For more information, refer to the documentation.

Installation

Using conda

conda install -c amei -c openalea3 -c conda-forge pycropml

Usage

From Platforms to Crop2ML

cyml -c name_of_the_component_repository absolute_path_of_the_output source_language_or_platform

From Crop2ML to Platforms

cyml -p name_of_the_Crop2ML_package target_language_or_platform

Testing

Run the test suite using pytest or unittest:

Using pytest

# Run all tests
python -m pytest test/cyml/test_cyml_operations.py -v

# Run a specific test class
python -m pytest test/cyml/test_cyml_operations.py::TestCyMLOperations -v

# Run a single test
python -m pytest test/cyml/test_cyml_operations.py::TestCyMLOperations::test_modulo_operation -v

Using unittest

cd test/cyml
python -m unittest test_cyml_operations