Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to PETSIRD v0.2.0 and adapt Python documentation #12

Merged
merged 3 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)