Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
alchem0x2A committed Jan 17, 2024
1 parent b1433d9 commit af288aa
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,21 @@ schema used by the API at sparc.sparc_json_api.default_json_api
```

The schema file is generated from SPARC's LaTeX documentation. In
upcoming releases of `SPARC-X-API`, we're aiming to provide users
the flexibility to use their own custom schema files. This would be
upcoming releases of `SPARC-X-API`, we're aiming to provide users the
flexibility to use their own custom schema files. This would be
particularly useful for those who might be testing a development
branch of SPARC.
branch of SPARC. By default, the JSON schema is packaged under
`sparc/sparc_json_api` directory. If you have another version of SPARC
source code, you can set the environment variable `$SPARC_DOC_PATH` to
the directory containing the LaTeX codes for the documentation, such
as `<SPARC-source-code-root>/doc/.LaTeX`. If you obtain `sparc-x` from
the conda method as mentioned above, By default, the JSON schema is
packaged under `sparc/sparc_json_api` directory. If you have another
version of SPARC source code, you can set the environment variable
`$SPARC_DOC_PATH` is automatically set to
`<conda-env-root>/share/doc/sparc/.LaTeX`. Setting up the environment
variable `$SPARC_DOC_PATH` helps loading the correct JSON schame that
is compatible with your SPARC binary code.

### C) SPARC Command Configuration

Expand Down
7 changes: 4 additions & 3 deletions tests/test_api_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ def test_sparc_api(monkeypatch):
older_ver = locate_api(doc_path=curdir / "sparc-latex-doc-202302").sparc_version
assert older_ver is None
# Specify SPARC_DOC_PATH
monkeypatch.setenv("SPARC_DOC_PATH",
(curdir / "sparc-latex-doc-202302").resolve().as_posix()
monkeypatch.setenv(
"SPARC_DOC_PATH", (curdir / "sparc-latex-doc-202302").resolve().as_posix()
)
older_version = locate_api().sparc_version
assert older_version is None
Expand All @@ -29,8 +29,9 @@ def test_sparc_api(monkeypatch):
def test_sparc_params():
if "SPARC_DOC_PATH" not in os.environ:
pytest.skip(msg="No $SPARC_DOC_PATH set. Skip")

from sparc.utils import locate_api

# Use the default api with SPARC_DOC_PATH
api = locate_api()
if api.sparc_version is None:
Expand Down
1 change: 1 addition & 0 deletions tests/test_read_all_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def test_read_all_tests():
from sparc.io import read_sparc
from sparc.utils import locate_api
import os

print("SPARC_DOC_PATH is: ", os.environ.get("SPARC_DOC_PATH", None))
api = locate_api()
print(api.sparc_version)
Expand Down

0 comments on commit af288aa

Please sign in to comment.