Skip to content

Commit

Permalink
Merge pull request #143 from PyCOMPLETE/fix/numpy2_compatibility
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kparasch authored Nov 8, 2024
2 parents e56f617 + a3f4d7f commit 4b94e26
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion beam_and_timing.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def __init__(self, flag_bunched_beam, fact_beam, coast_dens, beam_charge, beam_f
# exec(f.read())
# f.close()
else:
ppb_vect = np.atleast_1d(np.float_(np.array(filling_pattern_file)))
ppb_vect = np.atleast_1d(np.float64(np.array(filling_pattern_file)))

if flag_secodary_beam:
t = t_primary_beam
Expand Down
2 changes: 1 addition & 1 deletion geom_impact_poly_cython.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ cimport cython
from libc.math cimport sqrt

ctypedef np.float_t DOUBLE_t
ctypedef np.int_t INT_t
ctypedef np.intp_t INT_t

@cython.boundscheck(False)
@cython.wraparound(False)
Expand Down
12 changes: 6 additions & 6 deletions sec_emission_model_ECLOUD_nunif.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ def __init__(self, chamb, Emax, del_max, R0, E0=150.,
else:
self.angle_dist_func = None

self.del_max_segments = np.float_(chamb.del_max_segments)
self.R0_segments = np.float_(chamb.R0_segments)
self.Emax_segments = np.float_(chamb.Emax_segments)
self.del_max_segments = np.float64(chamb.del_max_segments)
self.R0_segments = np.float64(chamb.R0_segments)
self.Emax_segments = np.float64(chamb.Emax_segments)

self.del_max_segments[chamb.del_max_segments < 0.] = del_max
self.R0_segments[chamb.R0_segments < 0.] = R0
Expand Down Expand Up @@ -141,9 +141,9 @@ def __init__(self, chamb, Emax, del_max, R0, E0=150.,
self.chamb = chamb
self.Q_segments = 0. * self.del_max_segments
self.flag_charging = np.int_(chamb.flag_charging)>0
self.Q_max_segments = np.float_(chamb.Q_max_segments)
self.EQ_segments = np.float_(chamb.EQ_segments)
self.tau_segments = np.float_(chamb.tau_segments)
self.Q_max_segments = np.float64(chamb.Q_max_segments)
self.EQ_segments = np.float64(chamb.EQ_segments)
self.tau_segments = np.float64(chamb.tau_segments)


def SEY_process(self, nel_impact, E_impact_eV, costheta_impact, i_impact):
Expand Down

0 comments on commit 4b94e26

Please sign in to comment.