tcztzy / cotton2k

Simulation model for cotton
3 stars 2 forks source link
cotton python rust

Cotton2K simulation model

Cotton2K is a cotton simulation model specially adapted for irrigated cotton production in arid regions. It was originally written by Prof. Avishalom Marani and distributed under GPL, and rewrite in Rust by Tang Ziya.

These packages are distributed under GPL 3.0 or later. This version has been upgraded to run on modern OS.

Migrate from version 4.0

I use TOML as input file format and CSV as output file format. Documents coming soon.

What about Python?

I wrote a Python version before this. It works, but I have serious performance issues, it toke about 2min one single simulation, compared with 3s in C++ version. I tried to improve, but it is too difficult for me.

I provided Python API via PyO3! see bindings directory in the root of this repository.

Roadmap

  1. GUI
  2. Fix calculation errors
  3. Update formulas, grant SWAP model
  4. Refactoring all in Rust
  5. Maybe I will change model structure

Requirements

C++ compiler (clang and msvc tested), Rust toolchain (nightly tested), FORTRAN compiler and Meson build.

Additionally, you need to notice that LIBCLANG_PATH should be satisfied. This dependency will be eventually removed after C++ codes are all refactored into Rust.

Build

cargo build

Licenses