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

chore: patch opticks for incorrect numpy dtype #81

Merged
merged 1 commit into from
May 29, 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
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