Skip to content

Enable Python BCs in OGS Python wheels

Christoph Lehmann requested to merge chleh/ogs:pip-python-bc into master

Depends on !4318 (merged).

Many thanks to @bilke for assistance with library dependencies, testing and CI pipelines!

This MR enables the use of Python BCs and STs from OGS's Python wheels. This is a small step towards making OGS easy to use from Python, albeit a small step involving many changes.

What had to be changed?

  • Ironically, not linking to Python libs in the Python wheel build
  • Therefore, we cannot compile OGS as an executable in the wheel build. OGS will be used via @TomFischer's ogs.simulator module.
  • Accordingly, the embedded OpenGeoSys module for BCs/STs does not exist. Python BCs/STs have to use the new ogs.callbacks module, which has the same functionality, as a drop-in replacement.
  • The global project directory variable has to be cleared after each OGS simulation.
  • The global matrix and vector provider has to be cleared rather than destroyed.
  • The TCLAP command line parser must not exit the application but report the wish to exit (due to error or --help/--version flag) in another way.

Next steps

  • Run the entire ctest test suite for the wheel builds.
  • Getting rid of the global project directory variable.
  • Making the ogs.simulator module more robust. Currently it's very easy to get segfaults if you forget to check the status codes of that modules' functions.
  • Removing the global matrix and vector provider, thereby enabling multithreaded OGS invokations from Python 😵
  • Add documentation to the user guide once the ogs.simulator module has been made more robust.
  1. Feature description was added to the changelog
  2. Tests covering your feature were added?
Edited by Christoph Lehmann

Merge request reports