PCSE
A framework developed for implementing crop simulation models developed in Wageningen.
https://github.com/ajwdewit/pcse
Category: Consumption
Sub Category: Agriculture and Nutrition
Keywords from Contributors
charts data-profiling stocks control convolutional-neural-networks unit-testing generative-adversarial-network pypi feature-flag feature-toggle
Last synced: about 18 hours ago
JSON representation
Repository metadata
Repository for the Python Crop Simulation Environment
- Host: GitHub
- URL: https://github.com/ajwdewit/pcse
- Owner: ajwdewit
- License: other
- Created: 2013-09-16T19:29:23.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2025-03-21T09:59:32.000Z (about 1 month ago)
- Last Synced: 2025-04-17T23:51:42.177Z (10 days ago)
- Language: Python
- Size: 96.4 MB
- Stars: 219
- Watchers: 30
- Forks: 141
- Open Issues: 1
- Releases: 4
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
README.rst
Python Crop Simulation Environment - PCSE ========================================= PCSE is a framework developed for implementing crop simulation models developed in Wageningen. Many of the Wageningen crop simulation models were originally developed in FORTRAN77 or using the FORTRAN Simulation Translator (`FST`_). Although this approach has yielded high quality models with high numerical performance, the inherent limitations of models written in FORTRAN is also becoming increasingly evident: * The structure of the models is often rather monolithic and the different parts are very tightly coupled. Replacing parts of the model with another simulation approach is not easy. * The models rely on file-based I/O which is difficult to change. For example, interfacing with databases is complicated in FORTRAN. * In general, with low-level languages like FORTRAN, simple things already take many lines of code and mistakes are easily made, particularly by agronomists and crop scientist that have limited experience in developing or adapting software. To overcome many of the limitations above, the Python Crop Simulation Environment (PCSE) was developed which provides an environment for developing simulation models as well as a number of implementations of crop simulation models. PCSE is written in pure python code which makes it more flexible, easier to modify and extensible allowing easy interfacing with databases, graphical user interfaces, visualization tools and numerical/statistical packages. PCSE has several interesting features: * Implementation in pure python with dependencies only on popular packages available from the Python Package Index (PyPI) (`SQLAlchemy`, `PyYAML`, `pandas`, `Openpyxl`, `xlrd`, `requests` and `numpy`) * Modular design allowing you to add or change components relatively quickly with a simple but powerful approach to communicate variables between modules. * Similar to `FST`_, it enforces good model design by explicitly separating parameters, rate variables and state variables. Moreover PCSE takes care of the module initialization, calculation of rates of changes, updating of state variables and actions needed to finalize the simulation. * Input/Output is completely separated from the simulation model itself. Therefore PCSE models can easily read from and write to text files, databases and scientific formats such as HDF or NetCDF. * Tools are available for reading parameter and weather files from existing models to have as much backward compatibility as possible. * An `AgroManager` module which allows to define the agromanagement actions that happen on a farmers field. Such actions can be specified as events based on time or model state. * Built-in testing of program modules ensuring integrity of the system. To contribute to PCSE, you can fork your own copy at https://github.com/ajwdewit/pcse Full documentation is available on http://pcse.readthedocs.io Testing PCSE ------------ The PCSE package has some built-in tests that can used to test if any PCSE installation is producing the correct outputs:: >>> pcse.test() runTest (pcse.tests.test_abioticdamage.Test_FROSTOL) ... ok runTest (pcse.tests.test_partitioning.Test_DVS_Partitioning) ... ok runTest (pcse.tests.test_evapotranspiration.Test_PotentialEvapotranspiration) ... ok runTest (pcse.tests.test_wofost.TestWaterlimitedWinterWheat) ... ok ... runTest (pcse.tests.test_wofost.TestWaterlimitedGrainMaize) ... ok runTest (pcse.tests.test_wofost.TestPotentialPotato) ... ok runTest (pcse.tests.test_wofost80.TestWOFOST80_Potential_WinterWheat) ... ok runTest (pcse.tests.test_wofost80.TestWOFOST80_WaterLimited_WinterWheat) ... ok ---------------------------------------------------------------------- Ran 32 tests in 39.809s OK If the model output matches the expected output the test will report 'OK', otherwise an error will be produced with a detailed traceback on where the problem occurred. Note that the results may deviate from the output above when tests were added or removed. On top of the built-in tests, a larger suite of tests is available in the git repository of PCSE. The latter also includes tests of the LINGRA model which are not included in the internal tests. The tests can be execute through the `tests` package:: (py3_pcse) $ python -m tests runTest (tests.run_tests./home/wit015/Sources/python/pcse/tests/test_data/test_potentialproduction_wofost72_01.yaml) ... ok runTest (tests.run_tests./home/wit015/Sources/python/pcse/tests/test_data/test_potentialproduction_wofost72_11.yaml) ... ok runTest (tests.run_tests./home/wit015/Sources/python/pcse/tests/test_data/test_potentialproduction_wofost72_21.yaml) ... ok runTest (tests.run_tests./home/wit015/Sources/python/pcse/tests/test_data/test_potentialproduction_wofost72_31.yaml) ... ok runTest (tests.run_tests./home/wit015/Sources/python/pcse/tests/test_data/test_potentialproduction_wofost72_41.yaml) ... ok runTest (tests.run_tests./home/wit015/Sources/python/pcse/tests/test_data/test_waterlimitedproduction_wofost72_01.yaml) ... ok runTest (tests.run_tests./home/wit015/Sources/python/pcse/tests/test_data/test_waterlimitedproduction_wofost72_11.yaml) ... ok runTest (tests.run_tests./home/wit015/Sources/python/pcse/tests/test_data/test_waterlimitedproduction_wofost72_21.yaml) ... ok runTest (tests.run_tests./home/wit015/Sources/python/pcse/tests/test_data/test_waterlimitedproduction_wofost72_31.yaml) ... ok runTest (tests.run_tests./home/wit015/Sources/python/pcse/tests/test_data/test_waterlimitedproduction_wofost72_41.yaml) ... ok runTest (tests.run_tests./home/wit015/Sources/python/pcse/tests/test_data/test_LINGRA_Belgium-Michamps-1986_PP.yaml) ... ok runTest (tests.run_tests./home/wit015/Sources/python/pcse/tests/test_data/test_LINGRA_Netherlands-Zegveld-1986_PP.yaml) ... ok runTest (tests.run_tests./home/wit015/Sources/python/pcse/tests/test_data/test_LINGRA_Belgium-Michamps-1986_WLP.yaml) ... ok runTest (tests.run_tests./home/wit015/Sources/python/pcse/tests/test_data/test_LINGRA_Netherlands-Zegveld-1986_WLP.yaml) ... ok runTest (tests.run_tests./home/wit015/Sources/python/pcse/tests/test_data/test_LINGRA_Belgium-Michamps-1986_NWLP.yaml) ... ok runTest (tests.run_tests./home/wit015/Sources/python/pcse/tests/test_data/test_LINGRA_Netherlands-Zegveld-1986_NWLP.yaml) ... ok ---------------------------------------------------------------------- Ran 16 tests in 101.956s OK By default this runs a limited selection of tests. The full test suite can be run with:: (py3_pcse) $ python -m tests --full But this will take at least 30 minutes to complete. Comparing PCSE models against experiments ----------------------------------------- Starting with PCSE 5.5, there is an additional folder `exp` inside the repository which contains experimental data which can be used to compare the results from a PCSE model against. Experiments are collected in an 'experimental collection' which contains references to experiments that belong together. For example, all experiments for potato for a given variety. Currently, the available experiments are limited to grassland for the LINGRA model and consist of two collections. One for grassland under irrigated conditions and one for rain-fed conditions. Tt is expected that more experimental data will be collected and stored here in order to have a reference set to compare model results. Running the experiments is similar to running the unit tests:: (py3_pcse) $ python -m exp Writing expriment results to: /tmp/exp_results Processing collection for Rye grass: Potential - Processing experiment: LINGRA_FAO/LINGRA_FAO_experiment_000_UK2_1982.yaml - Processing experiment: LINGRA_FAO/LINGRA_FAO_experiment_004_SW1_1983.yaml - Processing experiment: LINGRA_FAO/LINGRA_FAO_experiment_006_SW1_1984.yaml ... This will generate figures of simulated vs observed data in order to assess how the model performs against experimental data. In the future, this will be extended to include a report with error values. .. _FST: http://models.pps.wur.nl/sites/models.pps.wur.nl/files/FST%203.pdf
Owner metadata
- Name: Allard de Wit
- Login: ajwdewit
- Email:
- Kind: user
- Description:
- Website:
- Location: Wageningen, The Netherlands
- Twitter:
- Company: Wageningen Environmental Research, Wageningen-UR
- Icon url: https://avatars.githubusercontent.com/u/5472566?u=93f05d77dc1ff825ccaa72e8d595ffbaf2a47c17&v=4
- Repositories: 23
- Last ynced at: 2024-06-11T16:21:28.210Z
- Profile URL: https://github.com/ajwdewit
GitHub Events
Total
- Issues event: 14
- Watch event: 25
- Issue comment event: 18
- Push event: 4
- Pull request event: 2
- Fork event: 16
Last Year
- Issues event: 14
- Watch event: 25
- Issue comment event: 18
- Push event: 4
- Pull request event: 2
- Fork event: 16
Committers metadata
Last synced: 8 days ago
Total Commits: 657
Total Committers: 17
Avg Commits per committer: 38.647
Development Distribution Score (DDS): 0.486
Commits in past year: 73
Committers in past year: 3
Avg Commits per committer in past year: 24.333
Development Distribution Score (DDS) in past year: 0.438
Name | Commits | |
---|---|---|
Allard de Wit | a****t@w****l | 338 |
Herman Berghuijs | h****s@w****l | 226 |
hoek008 | s****k@w****l | 38 |
unknown | w****5@D****l | 10 |
Ivan Orzan | i****n@g****m | 10 |
Zacharias Steinmetz | s****z@p****e | 7 |
Marek Petrik | m****k@p****s | 6 |
ajwdewit | w****5@L****l | 6 |
fanquake | f****e@g****m | 3 |
Julien Malard | j****d@m****a | 2 |
solid | 1****3@q****m | 2 |
Christian Clauss | c****s@m****m | 2 |
Abraham Gomez | a****6@a****u | 2 |
Wit | w****5@D****l | 2 |
Michiel Kallenberg | 1 | |
Hiske Overweg | h****g@w****l | 1 |
Olivier Burggraaff | o****f@g****m | 1 |
Committer domains:
- wur.nl: 4
- d7420007.wurnet.nl: 1
- asu.edu: 1
- me.com: 1
- qq.com: 1
- mail.mcgill.ca: 1
- l0138164.wurnet.nl: 1
- petrik.us: 1
- posteo.de: 1
- d0111769.wurnet.nl: 1
Issue and Pull Request metadata
Last synced: 2 days ago
Total issues: 69
Total pull requests: 32
Average time to close issues: about 1 month
Average time to close pull requests: about 1 month
Total issue authors: 54
Total pull request authors: 17
Average comments per issue: 2.58
Average comments per pull request: 1.25
Merged pull request: 18
Bot issues: 0
Bot pull requests: 0
Past year issues: 14
Past year pull requests: 1
Past year average time to close issues: about 2 months
Past year average time to close pull requests: 30 days
Past year issue authors: 12
Past year pull request authors: 1
Past year average comments per issue: 2.0
Past year average comments per pull request: 2.0
Past year merged pull request: 1
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- sqwev (3)
- brsilvarec (3)
- shuaijieshen (2)
- gausie (2)
- agnaru (2)
- githublijian (2)
- NickAlexander18 (2)
- AlChen94 (2)
- iMarang (2)
- ncaspari (2)
- sunkq1 (2)
- lwq-star (2)
- krsnapaudel (2)
- codename5281 (1)
- pedroalencar1 (1)
Top Pull Request Authors
- julienmalard (4)
- zsteinmetz (3)
- fanquake (3)
- michielkallenberg (3)
- marekpetrik (3)
- sbhoek (3)
- HiskeOverweg (2)
- burggraaff (2)
- cclauss (1)
- ajwdewit (1)
- isupit (1)
- Jiang2019Code (1)
- sbe123 (1)
- hbja (1)
- LeaTresch (1)
Top Issue Labels
Top Pull Request Labels
Package metadata
- Total packages: 1
-
Total downloads:
- pypi: 1,140 last-month
- Total dependent packages: 1
- Total dependent repositories: 10
- Total versions: 25
- Total maintainers: 1
pypi.org: pcse
Framework for developing crop simulation models, includes an implementation of the WOFOST and LINTUL crop simulation models and the LINGRA grassland simulation model.
- Homepage: http://github.com/ajwdewit/pcse/
- Documentation: https://pcse.readthedocs.io/
- Licenses: EUPL
- Latest release: 6.0.9 (published 3 months ago)
- Last Synced: 2025-04-26T14:35:07.309Z (2 days ago)
- Versions: 25
- Dependent Packages: 1
- Dependent Repositories: 10
- Downloads: 1,140 Last month
-
Rankings:
- Forks count: 4.356%
- Dependent repos count: 4.669%
- Stargazers count: 5.724%
- Average: 6.638%
- Dependent packages count: 7.303%
- Downloads: 11.136%
- Maintainers (1)
Dependencies
- PyYAML >=3.11
- SQLAlchemy >=0.8.0
- numpy >=1.6.0
- openpyxl >=3.0
- pandas >=0.20
- requests >=2.0.0
- traitlets-pcse ==5.0.0.dev
- PyYAML >=5.1
- SQLAlchemy >=1.3.0
- openpyxl >=3.0.0
- pandas >=0.25
- requests >=2.0.0
- traitlets-pcse ==5.0.0.dev
Score: 15.276095731664416