Skip to content

Commit

Permalink
Merge pull request #59 from nu-radio/compatibility-numpy
Browse files Browse the repository at this point in the history
fix outdated syntax to be compatible with new numpy version
  • Loading branch information
cg-laser authored Feb 23, 2024
2 parents f6cb626 + 9a77d26 commit 60d0be0
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 11 deletions.
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ module = "radiotools"
author = "Christian Glaser"
author-email = "[email protected]"
home-page = "https://github.com/nu-radio/radiotools"
requires-python=">3.4"
requires-python=">=3.6"
classifiers = ["License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)"]

requires = [
"numpy",
"scipy",
]
2 changes: 1 addition & 1 deletion radiotools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

"""A tool package for cosmic-ray and neutrino radio detectors."""

__version__ = '0.2.1'
__version__ = '0.2.2'
4 changes: 0 additions & 4 deletions radiotools/atmosphere/models.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# Python 2 and 3: backward-compatible
from __future__ import absolute_import, division, print_function # , unicode_literals

from scipy import optimize, interpolate, integrate

import numpy as np
import os
import sys
Expand Down
1 change: 0 additions & 1 deletion radiotools/coreas/generate_coreas_sim.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import, division, print_function # , unicode_literals
import os
import stat
import numpy as np
Expand Down
1 change: 0 additions & 1 deletion radiotools/helper.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function # , unicode_literals
from radiotools.atmosphere import models as atm
import numpy as np
import sys
Expand Down
6 changes: 3 additions & 3 deletions radiotools/plthelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
def get_discrete_cmap(N, base_cmap='viridis'):
cmap = plt.get_cmap(base_cmap, N)
colors = []
N = np.int(N)
N = int(N)
for i in range(N):
if(i % 2 == 0):
colors.append(cmap.colors[i // 2])
Expand Down Expand Up @@ -302,7 +302,7 @@ def get_histograms(histograms, bins=None, xlabels=None, ylabels=None, stats=True
for i in range(N):
xlabel = ""
if xlabels:
if(type(xlabels) != np.str):
if(type(xlabels) != str):
xlabel = xlabels[i]
else:
xlabel = xlabels
Expand All @@ -317,7 +317,7 @@ def get_histograms(histograms, bins=None, xlabels=None, ylabels=None, stats=True
if titles:
title = titles[i]
if bins is not None:
if(type(bins) == np.int):
if(type(bins) == int):
tbin = bins
else:
if (isinstance(bins[0], float) or isinstance(bins[0], int)):
Expand Down

0 comments on commit 60d0be0

Please sign in to comment.