Skip to content

Commit

Permalink
Merge pull request #436 from lldelisle/fix_numpy1.24
Browse files Browse the repository at this point in the history
Fix numpy 1.24
  • Loading branch information
lldelisle authored Jan 23, 2023
2 parents c310cf3 + 361c43a commit 36ad127
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/content/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Requirements
Python dependencies:

* Python >= 3.7
* numpy >= 1.16
* numpy >= 1.20
* intervaltree >= 2.1.0
* pyBigWig >= 0.3.16
* hicmatrix >= 15
Expand Down
3 changes: 2 additions & 1 deletion docs/content/releases/3.8.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ Bugfix:
- Works with gffutils version 0.11.0 where ValueError became gffutils.exceptions.EmptyInputError for empty gtf.
- The installation instructions have been updated
- Fixed a small bug in links track with "use_middle" enabled, where midpoints could have different ordering than start points (Thanks to @Jeff1995 ).
- Fix a bug when plotting gtf in the middle of a large intron
- Fix a bug when plotting gtf in the middle of a large intron.
- Support Numpy 1.24, drop support below 1.20

Relax version control on matplotlib:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ channels:
- bioconda
- conda-forge
dependencies:
- numpy >=1.16
- numpy >=1.20
- matplotlib >=3.1.1,<=3.6.2
- intervaltree >=2.1.0
- pybigwig >=0.3.16
Expand Down
10 changes: 5 additions & 5 deletions pygenometracks/tracks/BedGraphTrack.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,9 @@ def plot(self, ax, chrom_region, start_region, end_region):
x_values = np.asarray([(t[0] + t[1]) / 2
for i, t in enumerate(pos_list)
if not np.isnan(score_list[i])],
dtype=np.float)
dtype=float)
score_list = np.asarray([x for x in score_list if not np.isnan(x)],
dtype=np.float)
dtype=float)
elif self.properties['summary_method'] is not None:
score_list, x_values = self.get_values_as_bigwig(score_list,
pos_list,
Expand Down Expand Up @@ -366,9 +366,9 @@ def plot(self, ax, chrom_region, start_region, end_region):
x_values2 = np.asarray([(t[0] + t[1]) / 2
for i, t in enumerate(pos_list2)
if not np.isnan(score_list2[i])],
dtype=np.float)
dtype=float)
score_list2 = np.asarray([x for x in score_list2 if not np.isnan(x)],
dtype=np.float)
dtype=float)
if not all([x1 == x2 for x1, x2 in zip(x_values, x_values2)]):
# The x are not compatible we need to extrapolate:
new_x = sorted(np.unique(np.concatenate((x_values, x_values2), axis=0)))
Expand Down Expand Up @@ -481,7 +481,7 @@ def get_values_as_bdg(self, score_list, pos_list):
# convert [1, 2, 3 ...] in [1, 1, 2, 2, 3, 3 ...]
score_list = np.repeat(score_list, 2)
# convert [(0, 10), (10, 20), (20, 30)] into [0, 10, 10, 20, 20, 30]
x_values = np.asarray(sum(pos_list, tuple()), dtype=np.float)
x_values = np.asarray(sum(pos_list, tuple()), dtype=float)

if self.properties['nans_to_zeros']:
score_list[np.isnan(score_list)] = 0
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
numpy >=1.16
numpy >=1.20
matplotlib >=3.1.1,<=3.6.2
intervaltree >=2.1.0
pybigwig >=0.3.16
Expand Down
2 changes: 1 addition & 1 deletion requirements_CI.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
numpy >=1.16
numpy >=1.20
matplotlib ==3.6.2 # For the tests locally
intervaltree >=2.1.0
pybigwig >=0.3.16
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def checkProgramIsInstalled(self, program, args, where_to_download,
sys.stderr.write(f"Error: {e}")


install_requires_py = ["numpy >=1.16",
install_requires_py = ["numpy >=1.20",
"matplotlib >=3.1.1,<=3.6.2",
"intervaltree >=2.1.0",
"pyBigWig >=0.3.16",
Expand Down

0 comments on commit 36ad127

Please sign in to comment.