2025-06-04 16:00:01 +00:00
|
|
|
# Example scripts
|
|
|
|
|
2025-06-06 08:48:30 +00:00
|
|
|
Examples can be looked-up in the
|
|
|
|
[documentation](https://dlr-institute-of-future-fuels.github.io/gaspype/)
|
|
|
|
rendered with results.
|
2025-06-04 16:00:01 +00:00
|
|
|
|
2025-06-06 08:48:30 +00:00
|
|
|
The gaspype examples from this directory are available in the documentation as
|
|
|
|
downloadable Jupyter Notebooks or plain python scripts with comments.
|
2025-06-04 16:00:01 +00:00
|
|
|
|
2025-06-06 08:48:30 +00:00
|
|
|
The conversion is done like the following automated by the
|
|
|
|
[docs/source/render_examples.py](../docs/source/render_examples.py) script:
|
|
|
|
``` bash
|
|
|
|
# Converting markdown with code sections to Jupyter Notebook and run it:
|
|
|
|
notedown examples/soec_methane.md --to notebook --output docs/source/_autogenerated/soec_methane.ipynb --run
|
2025-06-04 16:00:01 +00:00
|
|
|
|
2025-06-06 08:48:30 +00:00
|
|
|
# Converting the Jupyter Notebook to Markdown and a folder with image
|
|
|
|
# files placed in docs/source/_autogenerated/:
|
|
|
|
jupyter nbconvert --to markdown docs/source/_autogenerated/soec_methane.ipynb --output soec_methane.md
|
2025-06-04 16:00:01 +00:00
|
|
|
```
|
|
|
|
|
2025-06-06 08:48:30 +00:00
|
|
|
A new example Markdown file can be created from a Jupyter Notebook running
|
|
|
|
the following command:
|
|
|
|
``` bash
|
2025-06-06 11:15:34 +00:00
|
|
|
jupyter nbconvert --to markdown new_example.ipynb --NbConvertApp.use_output_suffix=False --ClearOutputPreprocessor.enabled=True --output-dir examples/ --output new_example.md
|
2025-06-06 08:48:30 +00:00
|
|
|
```
|