inlab-geo/espresso

Using a plugin architecture for all Espresso contributions

Opened this issue · 1 comments

Currently, we've packaged all the contributions together with Espresso core and released all of them together as geo-espresso.

It would be ideal if we utilise a plugin architecture (where all Espresso problems are "plugins" of Espresso core), and decouple installation and dependency issues from individual contributor projects.

The ultimate goal of this change will be: instead of pip install geo-espresso, users in the future can choose what inference problem they would like to install, e.g.

$ pip install geo-espresso
$ python
>>> import espresso
>>> my_problem = espresso.SurfaceWaveTomography()  # error
--- ERROR ---
    $ pip install geo-espresso-surface-wave-tomography
>>> exit()
$ pip install geo-espresso-surface-wave-tomography
$ python
>>> import espresso
>>> my_problem = espresso.SurfaceWaveTomography()  # success

Here is a reference checklist, but feel free to adjust as needed:

  • Change in the existing build system (e.g. root level pyproject.toml)
  • espresso_machine/new_contribution/ (templates need changes, and https://github.com/scientific-python/cookie can be a good starting point)
  • Update existing problem examples
  • espresso_machine/build_package/build.py (a few steps need changes, including versioning configuration, folder structure for contributions, init files with try except for each problem class, etc.)
  • espresso_machine/build_package/test_examples.py --pre
  • espresso_machine/build_package/test_examples.py --post
  • espresso_machine/build_package/check_requires.py (requirements are now contributed folder's responsibility so potentially this test could be dropped)
  • Remove espress_machine/versioning/. (we would rely on build script to remove .core from the versioningit configuration)
  • Changes in documentation generation (especially user guide and developer guide)
  • Changes in inlab explorer parser

An improvement on top of this pull request: have some minimal examples included in the core package (pure Python, no complex dependencies).