Skip to content

Commit

Permalink
Merge pull request #85 from godotgildor/feature/support_numpy_2_1
Browse files Browse the repository at this point in the history
Update to be compatible with numpy 2.1
  • Loading branch information
veghp authored Aug 29, 2024
2 parents c4d3ec1 + efa9b3a commit f200677
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dnachisel/builtin_specifications/EnforceGCContent.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,10 @@ def evaluate(self, problem):
wstart, wend = self.location.start, self.location.end
sequence = self.location.extract_sequence(problem.sequence)
gc = gc_content(sequence, window_size=self.window)
breaches = np.maximum(0, self.mini - gc) + np.maximum(
0, gc - self.maxi
breaches = np.atleast_1d(
np.maximum(0, self.mini - gc) + np.maximum(
0, gc - self.maxi
)
)
score = -breaches.sum()
breaches_starts = wstart + (breaches > 0).nonzero()[0]
Expand Down

0 comments on commit f200677

Please sign in to comment.