Skip to content

Commit 4b94e26

Browse files
authored
Merge pull request #143 from PyCOMPLETE/fix/numpy2_compatibility
Fixes recent incompatibility issues with numpy and new python versions. Tested for linux, macos and lxplus. Recommending to use miniforge3 and "conda install compilers meson" from now on
2 parents e56f617 + a3f4d7f commit 4b94e26

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

beam_and_timing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def __init__(self, flag_bunched_beam, fact_beam, coast_dens, beam_charge, beam_f
113113
# exec(f.read())
114114
# f.close()
115115
else:
116-
ppb_vect = np.atleast_1d(np.float_(np.array(filling_pattern_file)))
116+
ppb_vect = np.atleast_1d(np.float64(np.array(filling_pattern_file)))
117117

118118
if flag_secodary_beam:
119119
t = t_primary_beam

geom_impact_poly_cython.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ cimport cython
77
from libc.math cimport sqrt
88

99
ctypedef np.float_t DOUBLE_t
10-
ctypedef np.int_t INT_t
10+
ctypedef np.intp_t INT_t
1111

1212
@cython.boundscheck(False)
1313
@cython.wraparound(False)

sec_emission_model_ECLOUD_nunif.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ def __init__(self, chamb, Emax, del_max, R0, E0=150.,
9999
else:
100100
self.angle_dist_func = None
101101

102-
self.del_max_segments = np.float_(chamb.del_max_segments)
103-
self.R0_segments = np.float_(chamb.R0_segments)
104-
self.Emax_segments = np.float_(chamb.Emax_segments)
102+
self.del_max_segments = np.float64(chamb.del_max_segments)
103+
self.R0_segments = np.float64(chamb.R0_segments)
104+
self.Emax_segments = np.float64(chamb.Emax_segments)
105105

106106
self.del_max_segments[chamb.del_max_segments < 0.] = del_max
107107
self.R0_segments[chamb.R0_segments < 0.] = R0
@@ -141,9 +141,9 @@ def __init__(self, chamb, Emax, del_max, R0, E0=150.,
141141
self.chamb = chamb
142142
self.Q_segments = 0. * self.del_max_segments
143143
self.flag_charging = np.int_(chamb.flag_charging)>0
144-
self.Q_max_segments = np.float_(chamb.Q_max_segments)
145-
self.EQ_segments = np.float_(chamb.EQ_segments)
146-
self.tau_segments = np.float_(chamb.tau_segments)
144+
self.Q_max_segments = np.float64(chamb.Q_max_segments)
145+
self.EQ_segments = np.float64(chamb.EQ_segments)
146+
self.tau_segments = np.float64(chamb.tau_segments)
147147

148148

149149
def SEY_process(self, nel_impact, E_impact_eV, costheta_impact, i_impact):

0 commit comments

Comments
 (0)