Skip to content

Commit dccab8a

Browse files
jcrivenaesmferrera
authored andcommitted
DOC: solve issues in documentation
1 parent 73292c8 commit dccab8a

4 files changed

Lines changed: 39 additions & 18 deletions

File tree

CONTRIBUTING.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ You can contribute in many ways:
99

1010
### Report Bugs
1111

12-
Report issues and bugs at https://github.com/equinor/fmu-config/issues
12+
Report issues and bugs at [fmu-config/issues](https://github.com/equinor/fmu-config/issues)
1313

1414
If you are reporting a bug, please include:
1515

@@ -35,8 +35,7 @@ articles, and such.
3535

3636
### Submit Feedback
3737

38-
The best way to send feedback is to file an issue
39-
at https://github.com/equinor/fmu-config/issues.
38+
The best way to send feedback is to file an issue at [fmu-config/issues](https://github.com/equinor/fmu-config/issues)
4039

4140
If you are proposing a feature:
4241

@@ -51,15 +50,13 @@ It is very important to be complient to code standards. fmu-config uses
5150
[ruff](https://pypi.org/project/ruff/),
5251
[mypy](https://mypy.readthedocs.io/en/stable/) to format and lint all code.
5352

54-
55-
### In addition:
53+
### In addition
5654

5755
- Start with documentation and tests. Think and communicate first!
5856
- Docstrings shall start and end with """ and use Google style.
5957
- Use pytest as testing engine
6058
- Code shall be be Python 3.9+ compliant
6159

62-
6360
### Linting
6461

6562
```sh
@@ -72,12 +69,13 @@ The pylint is rather strict and sometimes excpetions are needed... , but anyway
7269
python -m pylint mycode.py
7370
```
7471

75-
## Get Started!
72+
## Get Started
7673

7774
Ready to contribute? Here's how to set up `fmu-config` for local development.
7875

7976
1. Fork the `fmu-config` repo in web browser to a personal fork
8077
2. Clone your fork locally:
78+
8179
```sh
8280
git clone git@github.com:<your-user>/fmu-config.git
8381
cd fmu-config
@@ -87,6 +85,7 @@ Ready to contribute? Here's how to set up `fmu-config` for local development.
8785
This means your `origin` is now your personal fork, while the actual master
8886
is at `upstream`.
8987
3. Then create a virtual environment and install
88+
9089
```sh
9190
python -m venv <your-venv>
9291
source <your-venv>/bin/activate

docs/examples.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,19 @@ IPL example
5959
"""""""""""
6060
.. code-block:: text
6161
62-
Include("../input/global_variables/global_variables.ipl")
62+
Include("../../fmuconfig/output/global_variables.ipl")
6363
64-
FOR i FROM 1 TO TOP_LOBE.length DO
64+
FOR i FROM 1 TO TOP_LOBES.length DO
6565
Print("Reading ", TOP_LOBE[i])
6666
6767
68-
Python example
69-
""""""""""""""
68+
Python example (using yaml_load)
69+
""""""""""""""""""""""""""""""""
7070
.. code-block:: python
7171
7272
import fmu.config.utilities as utils
7373
74-
cfg = utils.yaml_load('../input/global_variables/global_variables_rms.yml')
74+
CFG = utils.yaml_load('../../fmuconfig/output/global_variables.yml')
7575
76-
for toplobe in cfg['horizons']['TOP_LOBE']:
76+
for toplobe in CFG["rms"]["horizons"]["TOP_LOBES"]:
7777
print('Working with {}'.format(toplobe))

docs/index.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,7 @@ Welcome to fmu-config's documentation!
1111
examples
1212
contributing
1313

14-
API
15-
===
1614

17-
.. toctree::
18-
19-
fmu.config/fmu.config
2015

2116
Indices and tables
2217
==================

docs/usage.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,30 @@ need to initiate the Class instance and run a few methods. Here is an example:
105105
if __name__ == "__main__":
106106
cleanup()
107107
main()
108+
109+
Using the output YAML in RMS or scripts
110+
---------------------------------------
111+
112+
.. code-block:: python
113+
114+
from fmu.config import utilities as util
115+
116+
CONFIG = "../../fmuconfig/output/global_variables.yml"
117+
118+
CFG = util.yaml_load(CONFIG)
119+
120+
121+
Loading the input YAML in RMS or scripts
122+
----------------------------------------
123+
124+
In some cases we may need to load the 'input' version of the YAML files which in fmu.config has
125+
a syntax (e.g. the ``!include`` keys) which makes it not compatible with the YAML standard.
126+
The solution then is to use a ``loader="FMU"`` key-value:
127+
128+
.. code-block:: python
129+
130+
from fmu.config import utilities as util
131+
132+
CONFIG = "../../fmuconfig/input/global_master_variables.yml"
133+
134+
CFG = util.yaml_load(CONFIG, loader="FMU")

0 commit comments

Comments
 (0)