Skip to content

Commit

Permalink
Merge pull request #86 from nkrah/patch-1
Browse files Browse the repository at this point in the history
Fix string input to logger.error in phsp_helpers.py
  • Loading branch information
tbaudier authored Oct 31, 2024
2 parents 5caa259 + fdc3a24 commit 9381cea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gatetools/phsp/phsp_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def load_root(filename, treename, nmax=-1, nstart=0):
nmax = int(nmax)
# Check if file exist
if not os.path.isfile(filename):
logger.error("File '" + filename + "' does not exist.")
logger.error(f"File '{filename}' does not exist.")
exit()

# Check if this is a root file
Expand Down Expand Up @@ -82,7 +82,7 @@ def load_root(filename, treename, nmax=-1, nstart=0):
d = np.column_stack([a[k] for k in psf.keys()])
# d = np.float64(d) # slow
except Exception:
logger.error("File '" + filename + "' cannot be opened, not root file ?")
logger.error(f"File '{filename}' cannot be opened, not root file ?")
exit()

return d, names, int(n)
Expand All @@ -97,7 +97,7 @@ def load_npy(filename, nmax=-1, nstart=0, shuffle=False):

# Check if file exist
if not os.path.isfile(filename):
logger.error("File '" + filename + "' does not exist.")
logger.error(f"File '{filename}' does not exist.")
exit()

x = np.load(filename, mmap_mode='r')
Expand Down

0 comments on commit 9381cea

Please sign in to comment.