Skip to content

Commit

Permalink
Merge pull request #12 from KrisThielemans/docPip
Browse files Browse the repository at this point in the history
Update to PETSIRD v0.2.0 and adapt Python documentation
  • Loading branch information
KrisThielemans authored Nov 1, 2024
2 parents 5684524 + 08b88d3 commit 948c950
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
- name: Python
run: |
pip install ./PETSIRD/python
cd python
python start.py
Expand Down
2 changes: 1 addition & 1 deletion PETSIRD
9 changes: 6 additions & 3 deletions python/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# PETSIRD basic Python example

This directory contains some instructions to wrote Python code to read/write PETSIRD data. You need to `yardl generate` in the `model` directory first.
As you can now install the `petsird` package from PyPI, you likely no longer
need this repository and can just use `pip install petsird`.
You can of course use the Python package generated from the local PETSIRD
clone (`cd python; pip install .`). See
https://github.com/ETSInitiative/PETSIRD/tree/main/python#readme
for more information.

As we currently do not have a `set_up.py` for PETSIRD yet, the example file hard-codes the path to the generated files.
Alternatives would be to use the `PYTHONPATH` environment variable or symbolic links.
3 changes: 1 addition & 2 deletions python/start.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import sys
# Currently hard-wire location of generated files. This will need to change!
sys.path.append('../PETSIRD/python/')
import petsird
help(petsird.BinaryPETSIRDReader)

0 comments on commit 948c950

Please sign in to comment.