diff --git a/README.md b/README.md index 835764c..da28e05 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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: @@ -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 diff --git a/docs/conf.py b/docs/conf.py index 03420e9..da13822 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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' diff --git a/docs/index.rst b/docs/index.rst index 91efbbc..1d42031 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -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 `_ prior to the poetry installation. @@ -203,6 +206,23 @@ Python API Refer to the `reasoner_validator package unit 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 =============================== @@ -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: