WUR-AI / WUR-AI/diffWOFOST

[Backlog Item]: Make two modules of wofost72_pp efficient

Open
#18 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Backlog item Epic 1
Dominant language
Python
Stars
25
Forks
6
Avg merge
2d 23h
Merged PRs (30d)
1

Description

After #8, we want to make the computations of Root_Dynamics and Leaf_Dynamics efficient.

Assume the general form of a module is y = f(x, p) where, for a single time step, location, and parameter set, the input x, output y, and parameters p are scalars and their shape is [1].

With vectorization, model can handle multiple locations and multiple parameter sets per time step.

A. Data array organization inside a module (think of a chunk):

The idea is to change the crop model’s data structure so it can work with input arrays of any size, scalars, 1D, 2D, 3D, and so on. Ideally, the model should take in the parameters as ndarrays (or tensors) with the same length and return ndarrays (or tensors) in response.

B. Data array organization inside Engine (think of an xarray with Dask):

Currently engine takes care of slicing data over time steps and passes it to each module. n_timestpes will be added to the input/output of the engine. The computations are time-dependent, and the parallelization (or batch processing) is done on other dimensions. see also #30

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading pcse/crop/root_dynamics.py and pcse/crop/leaf_dynamics.py, then inspect pcse/engine.py and the changes referenced by #8 and #30. Trace how one time step currently passes scalar inputs through the modules. Done means the two modules and engine support array-shaped inputs while preserving time-dependent processing across batch dimensions.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-engineering, performance
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.