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

move python helpers #71

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Python
run: |
cd python
python petsird_generator.py | python petsird_analysis.py
python -m petsird.helpers.generator | python -m petsird.helpers.analysis
- name: cpp
run: |
mkdir cpp/build
Expand Down
9 changes: 5 additions & 4 deletions python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ pip install --editable ../python
The Python code shows piping the compact binary format to standard out and
reading it from standard in. This can be used as follows:

1. From the repo root `cd python`
1. `python petsird_generator.py | python petsird_analysis.py`
```sh
python -m petsird.helpers.generator | python -m petsird.helpers.analysis
```

There is also a very basic utility to plot the scanner geometry. For instance

```sh
python petsird_generator.py > test.bin
python petsird_plot_scanner.py < test.bin
python -m petsird.helpers.generator > test.bin
python -m petsird.helpers.plot_scanner < test.bin
```
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
# Copyright (C) 2023-2024 University College London
#
# SPDX-License-Identifier: Apache-2.0

import sys

import petsird
KrisThielemans marked this conversation as resolved.
Show resolved Hide resolved
from petsird_helpers import (get_detection_efficiency, get_module_and_element,
get_num_det_els)

from . import get_detection_efficiency, get_module_and_element, get_num_det_els
KrisThielemans marked this conversation as resolved.
Show resolved Hide resolved

if __name__ == "__main__":
with petsird.BinaryPETSIRDReader(sys.stdin.buffer) as reader:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
# Copyright (C) 2023-2024 University College London
#
# SPDX-License-Identifier: Apache-2.0

import math
import random
import sys
from collections.abc import Iterator

import numpy
import petsird
from petsird_helpers import get_module_and_element, get_num_det_els

from . import get_module_and_element, get_num_det_els
KrisThielemans marked this conversation as resolved.
Show resolved Hide resolved

# these are constants for now
NUMBER_OF_ENERGY_BINS = 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

# basic plotting of the scanner geometry
# preliminary code!

import sys

import matplotlib.pyplot as plt
Expand Down
Loading