Skip to content

Commit

Permalink
use numpy.asarray (#73)
Browse files Browse the repository at this point in the history
* use numpy.asarray

* fix bug with environment

* style: pre-commit fixes

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
lobis and pre-commit-ci[bot] authored Oct 6, 2024
1 parent dbdb909 commit 67665a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/geant4_python_application/files/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,9 @@ def install_datasets(show_progress: bool = True):
return

# check if the datasets are present in the corresponding Geant4 directory
if not bool(missing_datasets(os.environ["GEANT4_DATA_DIR"])):
if "GEANT4_DATA_DIR" in os.environ and not bool(
missing_datasets(os.environ["GEANT4_DATA_DIR"])
):
# return
...

Expand Down
2 changes: 1 addition & 1 deletion tests/test_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def test_seed_single_thread():
8.09506886e-03,
1.22345221e00,
]
energy = np.array(events.track.step.energy[0][0][0:5])
energy = np.asarray(events.track.step.energy[0][0][0:5])
assert np.allclose(energy, reference_value, atol=1e-5)
assert app.seed == 1100

Expand Down

0 comments on commit 67665a0

Please sign in to comment.