Skip to content

Commit

Permalink
chore: patch opticks for incorrect numpy dtype (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
plexoos authored May 29, 2024
1 parent 1bf8b2e commit a74bdfd
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,15 @@ ENV NVIDIA_DRIVER_CAPABILITIES=graphics,compute,utility

WORKDIR $ESI_DIR

COPY .opticks .opticks
COPY epic epic
COPY opticks opticks
COPY .opticks .opticks
COPY patches patches
COPY tests tests
COPY NVIDIA-OptiX-SDK-7.6.0-linux64-x86_64.sh .

RUN patch -p1 opticks/sysrap/sevt.py patches/opticks-fix-update-array-dtype-for-numpy-1.26.patch

COPY <<-"EOF" /etc/profile.d/z20_opticks.sh
source $OPTICKS_HOME/opticks.bash
opticks-
Expand Down
33 changes: 33 additions & 0 deletions patches/opticks-fix-update-array-dtype-for-numpy-1.26.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From 3c2a0ac17c2fb6d00cb08c2e7add4660642e8c46 Mon Sep 17 00:00:00 2001
From: Dmitri Smirnov <dmixsmi@gmail.com>
Date: Fri, 24 May 2024 12:41:09 -0400
Subject: [PATCH] fix: update array dtype for numpy >= 1.26

---
sysrap/sevt.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sysrap/sevt.py b/sysrap/sevt.py
index 191926c34..a67de5d7e 100644
--- a/sysrap/sevt.py
+++ b/sysrap/sevt.py
@@ -380,13 +380,13 @@ class SEvt(object):
qtab = eval(qtab_)
qtab_ = qtab_.replace("q","%s.q" % symbol)

- nosc = np.ones(len(qq), dtype=np.bool ) # start all true
+ nosc = np.ones(len(qq), dtype=bool ) # start all true
nosc[np.where(qq == pcf.SC)[0]] = 0 # knock out photons with scatter in their histories

- nore = np.ones(len(qq), dtype=np.bool ) # start all true
+ nore = np.ones(len(qq), dtype=bool ) # start all true
nore[np.where(qq == pcf.RE)[0]] = 0 # knock out photons with reemission in their histories

- noscab = np.ones(len(qq), dtype=np.bool ) # start all true
+ noscab = np.ones(len(qq), dtype=bool ) # start all true
noscab[np.where(qq == pcf.SC)[0]] = 0 # knock out photons with scatter in their histories
noscab[np.where(qq == pcf.AB)[0]] = 0 # knock out photons with bulk absorb in their histories
else:
--
2.39.3

0 comments on commit a74bdfd

Please sign in to comment.