Skip to content

Commit

Permalink
Docs: Fix commands given in the examples (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
adrien-berchet authored Dec 18, 2024
1 parent 7047536 commit 1e8b9d6
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 40 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/run-tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,8 @@ jobs:
- name: Get current month
id: date
run: echo "date=$(date +'%Y-%m')" >> $GITHUB_OUTPUT
- name: Cache APT Packages
# This action should only be used when you need extra system packages
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: graphviz poppler-utils
version: 1.0
execute_install_scripts: true
- name: Install APT Packages
run: sudo apt-get install graphviz poppler-utils imagemagick
- name: Cache tox and precommit environments
uses: actions/cache@v4
with:
Expand Down
12 changes: 6 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ The usual command is the following:

.. code::
synthesis_workflow <workflow>
synthesis-workflow <workflow>
You can get help and complete parameter description with the following commands:

.. code::
synthesis_workflow --help
synthesis_workflow <workflow> --help
synthesis-workflow --help
synthesis-workflow <workflow> --help
You can also run a complete ``luigi`` command in order to fine-control task parameters:

Expand All @@ -46,7 +46,7 @@ You can also run a complete ``luigi`` command in order to fine-control task para
.. note::

The ``synthesis_workflow`` command (or the complete ``luigi`` command) must be
The ``synthesis-workflow`` command (or the complete ``luigi`` command) must be
executed from a directory containing a ``luigi.cfg`` file.
A simple example of such file is given in the ``examples`` directory.

Expand All @@ -57,13 +57,13 @@ The usual command is the following:

.. code::
morph_validation -t <path to reference data> -r <path to test data> -o <output path> -c <YAML config file> --bio-compare
morph-validation -t <path to reference data> -r <path to test data> -o <output path> -c <YAML config file> --bio-compare
You can get help and complete parameter description with the following command:

.. code::
morph_validation --help
morph-validation --help
Funding & Acknowledgment
~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
1 change: 1 addition & 0 deletions requirements/test.pip
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ pytest-xdist>=3.0.2

# Pin versions for tests
matplotlib==3.6.*
pynrrd==0.4.3
seaborn==0.12.*
6 changes: 6 additions & 0 deletions src/morphval/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@

import pkg_resources

import morphval
from morphval import config
from morphval.validation_main import Validation


def get_parser():
"""Return the argument parser."""
parser = argparse.ArgumentParser()
parser.add_argument(
"--version",
action="version",
version=f"%(prog)s, version {morphval.__version__}",
)
parser.add_argument(
"-t", "--test-dir", required=True, help="full path to directory with test data"
)
Expand Down
50 changes: 25 additions & 25 deletions tests/data/in_small_O1/out/synthesis/apical_points.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,49 @@
216363698b529b4a97b750923ceb3ffd: null
4462ebfc5f915ef09cfbac6e7687a66e: null
48f165d57b00c7f4781ef86f5c8cc1ab:
- -14.394819259643555
- 194.89781188964844
- 9.01955795288086
- -14.394821166992188
- 194.8978271484375
- 9.019556999206543
4dad2986ce8349606a06e9ab85a0bcc1:
- -1.07305908203125
- -1.0730547904968262
- 195.03805541992188
- -7.569953918457031
- -7.569961071014404
5bc8fbbcbde5c0994164d8399f767c45: null
6018366cf658f7a75ed34fe53a096533: null
6513270e269e0d37f2a74de452e6b438: null
72e63ac7a95383221f70d5dc2e675fc7:
- 4.626476764678955
- 194.84230041503906
- 20.284626007080078
- 4.6264824867248535
- 194.84231567382812
- 20.28464126586914
7b89296c6dcbac5008577eb1924770d3:
- -8.819189071655273
- 194.1275177001953
- -14.387084007263184
- -8.819184303283691
- 194.12750244140625
- -14.38708782196045
8575062102fbcd4f357fbc5af71a1bfc:
- -1.843111515045166
- -1.8431235551834106
- 195.61419677734375
- 12.465193748474121
- 12.46518611907959
87751d4ca8501e2c44dcda6a797d76de:
- -3.984039545059204
- -3.9840335845947266
- 197.0111541748047
- -6.497995376586914
- -6.498000144958496
b8a1abcd1a6916c74da4f9fc3c6da5d7: null
c15521b1b3dca50a9daa37e51b591d75:
- -0.25705447793006897
- 199.17787170410156
- 11.141695022583008
- -0.2570788562297821
- 199.17788696289062
- 11.141693115234375
cd613e30d8f16adf91b7584a2265b1f5: null
d95bafc8f2a4d27bdcf4bb99f4bea973: null
db5b5fab8f4d3e27dda1494c73cf256d:
- 26.932884216308594
- 195.74429321289062
- -1.293025255203247
- 195.74427795410156
- -1.2930362224578857
e3e70682c2094cac629f6fbed82c07cd: null
e539a78bc8eff3460b12ae6ead581e57:
- 9.035844802856445
- 195.72015380859375
- 7.5418572425842285
- 9.035848617553711
- 195.7201690673828
- 7.5418620109558105
e8d79f49af6d114c4a6f188a424e617b:
- 21.528072357177734
- 21.5280704498291
- 197.24026489257812
- 9.389350891113281
- 9.38935661315918
3 changes: 3 additions & 0 deletions tests/test_O1_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ def test_ValidateSynthesis(small_O1_working_directory, data_dir):
"tolerance": 2e-3,
"absolute_tolerance": 1e-15,
},
"synthesis/apical_points.yaml": {
"tolerance": 1e-3,
},
"validation/morphology_validation_reports/validation_results.json": {
"tolerance": 2e-3,
"absolute_tolerance": 1e-12,
Expand Down
12 changes: 10 additions & 2 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,17 @@ def test_dependency_graph(self, vacuum_working_directory):
assert (root_dir / "dependency_graph.png").exists()


def test_entry_point(script_runner):
"""Test the entry point."""
def test_entry_point_synthesis_workflow(script_runner):
"""Test the entry point of synthesis-workflow."""
ret = script_runner.run("synthesis-workflow", "--version")
assert ret.success
assert ret.stdout.startswith("synthesis-workflow, version ")
assert ret.stderr == ""


def test_entry_point_morph_validation(script_runner):
"""Test the entry point of MorphVal."""
ret = script_runner.run("morph-validation", "--version")
assert ret.success
assert ret.stdout.startswith("morph-validation, version ")
assert ret.stderr == ""

0 comments on commit 1e8b9d6

Please sign in to comment.