From f571e710402c35995ad50a25c0a325a1dd4604df Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Wed, 3 Apr 2024 13:33:31 -0600 Subject: [PATCH] Show a smaller tree for final result --- docs/source/example-c.rst | 112 ++++++++++---------------------------- 1 file changed, 29 insertions(+), 83 deletions(-) diff --git a/docs/source/example-c.rst b/docs/source/example-c.rst index 4597da6..78d1150 100644 --- a/docs/source/example-c.rst +++ b/docs/source/example-c.rst @@ -28,89 +28,16 @@ create a directory to hold our work: This directory is a starting point; we'll add files and directories to it as we proceed through the example. -At the end, -the directory structure under ``example-c`` should look similar to that below. +The final directory structure of ``example-c`` should look similar to that below. .. code:: bash - example-c + example-c/ ├── babel_heatc.toml - ├── bmi-example-c - │   ├── CMakeLists.txt - │   ├── LICENSE - │   ├── README.md - │   ├── heat - │   │   ├── CMakeLists.txt - │   │   ├── bmi_heat.c - │   │   ├── bmi_heat.h - │   │   ├── bmi_main.c - │   │   ├── bmiheatc.pc.cmake - │   │   ├── heat.c - │   │   ├── heat.h - │   │   ├── heatc.pc.cmake - │   │   └── main.c - │   └── testing - │   ├── CMakeLists.txt - │   ├── config.txt - │   ├── test_conflicting_instances.c - │   ├── test_get_value.c - │   ├── test_grid_info.c - │   ├── test_initialize_from_file.c - │   ├── test_irf.c - │   ├── test_print_var_names.c - │   ├── test_reinitialize.c - │   └── test_set_value.c + ├── bmi-example-c/ ├── environment-c.yml - ├── pymt_heatc - │   ├── CHANGES.rst - │   ├── CREDITS.rst - │   ├── LICENSE.rst - │   ├── MANIFEST.in - │   ├── README.rst - │   ├── babel.toml - │   ├── build - │   │   └── HeatC - │   │   └── api.yaml - │   ├── docs - │   │   ├── Makefile - │   │   ├── _static - │   │   │   ├── logo-dark.svg - │   │   │   └── logo-light.svg - │   │   ├── api - │   │   ├── authors.rst - │   │   ├── babel.rst - │   │   ├── changelog.rst - │   │   ├── conf.py - │   │   ├── developer_install.rst - │   │   ├── environments.rst - │   │   ├── index.rst - │   │   ├── license.rst - │   │   ├── quickstart.rst - │   │   ├── updating.rst - │   │   └── usage.rst - │   ├── meson.build - │   ├── meta - │   │   └── HeatC - │   │   └── api.yaml - │   ├── noxfile.py - │   ├── pymt_heatc - │   │   ├── __init__.py - │   │   ├── _bmi.py - │   │   ├── _version.py - │   │   ├── data -> ../meta - │   │   └── lib - │   │   ├── __init__.py - │   │   └── heatc.pyx - │   ├── pyproject.toml - │   ├── requirements-build.txt - │   ├── requirements-library.txt - │   ├── requirements-testing.txt - │   ├── requirements.txt - │   └── setup.cfg - └── test - └── config.txt - - 16 directories, 60 files + ├── pymt_heatc/ + └── test/ Set up a conda environment @@ -327,8 +254,8 @@ ending with if everything has been built correctly. -Add metadata to make a *pymt* component ---------------------------------------- +Make a *pymt* component +----------------------- The final step in wrapping the *heat* model is to add metadata used by the `Python Modeling Tool`_, *pymt*. @@ -349,8 +276,13 @@ and view the current metadata: .. code:: bash - $ cd ../pymt_heatc - $ ls meta/HeatC/ + cd ../pymt_heatc + ls meta/HeatC/ + +which gives: + +.. code:: bash + api.yaml The file ``api.yaml`` is automatically generated by the *babelizer*. @@ -367,8 +299,22 @@ are given in the CSDMS Model Metadata repository. Download each of the files using the links in the list above and place them in the ``pymt_heatc/meta/HeatC`` directory alongside ``api.yaml``. +The structure of the ``meta`` directory should look like: + +.. code:: bash + + meta/ + └── HeatC/ + ├── api.yaml + ├── heat.txt + ├── info.yaml + ├── parameters.yaml + └── run.yaml + +Run the babelized model in *pymt* +................................... -Then start a Python session and show that the *heat* model +Start a Python session and show that the *heat* model can be called through *pymt*: .. code:: python