Skip to content

Commit

Permalink
Add RST syntax check to CI (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
berland authored Nov 19, 2020
1 parent 79b2902 commit 164b6f9
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 8 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/fmu-ensemble.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,12 @@ jobs:
pip install .
- name: 📦 Install test dependencies
run: pip install .[tests]
run: pip install .[tests,docs]

- name: 🧾 List all installed packages
run: pip freeze

- name: 🕵️ Check code style
if: matrix.python-version != '2.7'
run: |
black --check src/ tests/test_*.py setup.py
flake8 src tests/*.py
Expand All @@ -66,6 +65,12 @@ jobs:
pytest tests/
pip install .[parquet]
pytest tests/test_virtualensemble.py
- name: Syntax check on RST documentation
run: rstcheck -r docs/

- name: Build docs
run: |
sphinx-apidoc -H "API for fmu.ensemble" -o ./docs ./src/fmu
python setup.py build_sphinx
touch build/sphinx/html/.nojekyll
Expand Down
7 changes: 4 additions & 3 deletions docs/advancedusage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,11 @@ VirtualRealization object from an Ensemble object. If we want only the
aggregated table for our particular custom function, we can aggregate the
ensemble only for that particular datatype:

.. code-block:: python
.. code-block:: ipython
mean_realization = ensemble.agg("mean", keylist="zonestats.csv")
mean_realization.get_df("zonestats.csv")
In [1]: mean_realization = ensemble.agg("mean", keylist="zonestats.csv")
In [2]: mean_realization.get_df("zonestats.csv")
Out [2]:
ZONE PERMX VOLUME Z PORV
0 LowerReek 1105.552718 6.070259e+08 1599.113406 109885776.0
1 MidReek 966.315122 9.608399e+08 1586.559663 161875872.0
Expand Down
9 changes: 9 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,12 @@ test = pytest

[tool:pytest]
addopts = --verbose -x

[build_sphinx]
all-files = 1
warning-is-error = 1

[rstcheck]
ignore_directives=argparse,automodule
# This looks like a bug in rstcheck:
ignore_messages=Hyperlink target .* is not referenced
17 changes: 14 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,22 @@
"pylint",
"pytest>=2.9.2",
"pyyaml>=5.1",
"sphinx>=1.4.8",
"sphinx_rtd_theme>=0.4.1",
]

EXTRAS_REQUIRE = {"tests": TEST_REQUIREMENTS, "parquet": ["pyarrow"]}
DOCS_REQUIREMENTS = [
"ipython",
"rstcheck",
"sphinx",
"sphinx-argparse",
"sphinx_rtd_theme",
]


EXTRAS_REQUIRE = {
"tests": TEST_REQUIREMENTS,
"docs": DOCS_REQUIREMENTS,
"parquet": ["pyarrow"],
}

setup(
name="fmu-ensemble",
Expand Down

0 comments on commit 164b6f9

Please sign in to comment.