Skip to content

Commit

Permalink
Small update to project documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Bruskiewich committed Jun 8, 2023
1 parent fe766ce commit 779f7cd
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 12 deletions.
27 changes: 16 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ For script usage, type:
./trapi_validator.py --help
```

The script allows

(*) Thank you Eric Deutsch for the prototype code for this script

## Running tests
Expand All @@ -81,10 +79,25 @@ Run the tests with coverage report:
poetry run pytest --cov
```

Note that [poetry automatically uses any existing virtual environment](https://python-poetry.org/docs/basic-usage/#using-your-virtual-environment), but you can otherwise also enter the one that is created by poetry by default:

```shell
poetry shell
# run your commands, e.g. the web service module
exit # exit the poetry shell
```

The use of the Poetry shell command allows for running of the tests without the `poetry run` prefix. We will continue in this manner.

```bash
% poetry shell
(reasoner-validator-py3.9) % pytest --cov
```

Run the tests with detailed coverage report in a HTML page:

```bash
poetry run pytest --cov --cov-report html
pytest --cov --cov-report html
```

Serve the report on http://localhost:3000:
Expand Down Expand Up @@ -163,14 +176,6 @@ The service may be run directly as a Python module. The web services module may
python -m api.main
```

Note that [poetry automatically uses any existing virtual environment](https://python-poetry.org/docs/basic-usage/#using-your-virtual-environment), but you can otherwise also enter the one that is created by poetry by default:

```shell
poetry shell
# run your commands, e.g. the web service module
exit # exit the poetry shell
```

Go to http://localhost/docs to see the service documentation and to use the simple UI to input TRAPI messages for validation.

### Typical Output
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# -- Project information -----------------------------------------------------

project = 'Reasoner Validator'
copyright = '2022, Richard Bruskiewich; 2020-21, Patrick Wang'
copyright = '2022-23, Richard Bruskiewich; 2020-21, Patrick Wang'
author = 'Richard Bruskiewich and Patrick Wang'


Expand Down
21 changes: 21 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ Checkout then setup dependencies and the standard virtual environment using poet
git checkout https://github.com/NCATSTranslator/reasoner-validator.git
cd reasoner-validator
poetry install
poetry shell
These operations install the software and creates a virtual operation for running the software in a simple fashion.

You can optionally, `use a tool like pyenv to set your local shell Python version to a 3.9 release <https://python-poetry.org/docs/managing-environments/>`_ prior to the poetry installation.

Expand Down Expand Up @@ -203,6 +206,23 @@ Python API
Refer to the `reasoner_validator package unit tests <https://github
.com/NCATSTranslator/reasoner-validator/blob/master/tests>`_ for additional guidance on how to use the Python API.


Running Validation against an ARS UUID Result(*) or using a Local TRAPI Request Query
=====================================================================================

A local script trapi_validator.py is available to run TRAPI Response validation against either a PK (UUID)
indexed query result of the Biomedical Knowledge Translator "Autonomous Relay System" (ARS), a local JSON Response
text file or a locally triggered _ad hoc_ query Request against an directly specified TRAPI endpoint.

Note that it is best run within a **`poetry shell`** created by **`poetry install`**.

For script usage, type:

.. code-block:: bash
./trapi_validator.py --help
Validation Run as a Web Service
===============================

Expand Down Expand Up @@ -260,6 +280,7 @@ The service may be run directly as a Python module after certain dependencies ar
.. code-block:: bash
poetry install
poetry shell
The module may afterwards be run, as follows:

Expand Down

0 comments on commit 779f7cd

Please sign in to comment.