Skip to content

Commit

Permalink
move helpers
Browse files Browse the repository at this point in the history
- fixes #70
  • Loading branch information
casperdcl committed Nov 13, 2024
1 parent c5b0e46 commit 693afaa
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
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
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

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

# 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

0 comments on commit 693afaa

Please sign in to comment.