NOAA-OWP / ngen

Next Generation Water Modeling Engine and Framework Prototype
Other
84 stars 63 forks source link

Formulation Data Provider providing wrong data #871

Closed chp2001 closed 3 months ago

chp2001 commented 3 months ago

Hydrograph Data Provider for formulation model params is giving the wrong values for catchment data.

Current behavior

When formulations for catchments 27, 52, and 67 request areasqkm, they each receive the same area value from cat-27. (Using the sample data from the ngen repository)

Expected behavior

Each catchment should be receiving its own specific area value, not all of them receiving the same one.

Steps to replicate behavior (include URLs)

  1. Create a python BMI model.
  2. Write the formulation to request areasqkm (or area_sqkm depending on catchment data) from the hydrograph in the model's model_params.
  3. Have the model print out what value it receives.

Screenshots

image image

PhilMiller commented 3 months ago

Could you please add your realization configuration file and the screen-shot hydrofabric JSON file as attachments to this issue, and post the cmake configuration line and the command line you ran as text, so that we can easily reproduce it?

chp2001 commented 3 months ago

Certainly. This is the full data folder that I mount: sample_ngen.zip I'm running things through the NGIAB-Cloudinfra wrapper, so I don't have the cmake configuration available, but I do have the command I ran. /dmod/bin/ngen-serial ./config/catchments.geojson all ./config/nexus.geojson all ./config/realization_python.json

hellkite500 commented 3 months ago

Could you also share your python module, or a minimal reproducible example?

hellkite500 commented 3 months ago

I think I can see the root cause of this, but will need to do some extra digging to determine a solution.

chp2001 commented 3 months ago

Could you also share your python module, or a minimal reproducible example?

Here's the repository. pyflo_bmi

hellkite500 commented 3 months ago

Thanks! I was able to reproduce and do a little digging. The root cause is outlined in #872. As a quick workaround, you can explicitly list each catchment/formulation in a catchments block in the config, and it should link together each individual catchment to the correct hydrofabric data.

hellkite500 commented 3 months ago

This should be resolved on this end. You will need to coordinate an update of the NGIAB product from its maintainers, and get the latest image with this change included.