Ouranosinc / raven-hydro

A Python-based installer using scikit-build-core for the hydrologic modelling framework Raven
Apache License 2.0
4 stars 0 forks source link

Use RavenHydroFramework from official GitHub source #24

Closed Zeitsperre closed 7 months ago

Zeitsperre commented 8 months ago

Pull Request Checklist:

What kind of change does this PR introduce?

Does this PR introduce a breaking change?

Yes. The copied source files have been removed. There is more integration with the actual project source files.

Zeitsperre commented 7 months ago

@huard

I've spent way too much time on this today. Here's what I've figured out:

I've been trying to read up on ways of passing the objects from RavenMain.cpp to all other files, but I have no idea if that's even what we want. I get the impression that the problem has to do with scopes (perhaps vanilla cmake is a lot less strict about ensuring that files are included explicitly?).

@analytophile am I on the right track here?

huard commented 7 months ago

@Zeitsperre

I suspect this is a false lead. Your installation setup works on master, and the code compiles fine using the original cmakelist. I believe there is a quirk related to the source files location introduced in the git fetch mechanism that we need to identify. I'll take a look later this week.

Zeitsperre commented 7 months ago

Seems to be working! The only issue I can see is that the model reports a non-fatal error:

 3.8.0 w/ netCDF
============== Early Gracefully Exit ==============
Error Statement: Version check
Error Code: 7
---------------------------------------------------

@huard any idea what that could be?

EDIT: It's nothing. Looks like it's simply the exit code for SIMULATION_DONE:


enum exitcode
{
  BAD_DATA,       ///< For bad input provided by user (requires immediate exit from program)
  BAD_DATA_WARN,  ///< For bad input provided by user (requires shutdown prior to simulation)
  RUNTIME_ERR,    ///< For runtime error (bad programming)
  FILE_OPEN_ERR,  ///< For bad file open (requires immediate exit)
  RAVEN_OPEN_ERR, ///< for bad RavenErrors.txt file open
  STUB,           ///< Stub function
  OUT_OF_MEMORY,  ///< When out of memory
  SIMULATION_DONE ///< Upon completion of the simulation
};
Zeitsperre commented 7 months ago

Needed to set the fetch-depth for setuptools_scm. See: https://github.com/pypa/setuptools_scm/issues/414