Skip to content

Commit

Permalink
fix final tests
Browse files Browse the repository at this point in the history
  • Loading branch information
manulera committed Jan 24, 2025
1 parent b655e8f commit c6f56c7
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 111 deletions.
4 changes: 2 additions & 2 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[flake8]
ignore = E203, E266, E501, W503, F403
max-line-length = 79
ignore = E203, E266, E501, W503, F403, E741
max-line-length = 119
max-complexity = 18
select = B,C,E,F,W,T4,B9
8 changes: 7 additions & 1 deletion src/pydna/dseqrecord.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,9 +788,10 @@ def __mul__(self, number):
if self.circular:
raise TypeError("TypeError: can't multiply circular Dseqrecord.")
if number > 0:
new = _copy.copy(self)
new = _copy.deepcopy(self)
for i in range(1, number):
new += self
new._per_letter_annotations = self._per_letter_annotations
return new
else:
return self.__class__("")
Expand Down Expand Up @@ -1061,7 +1062,10 @@ def upper(self):
pydna.dseqrecord.Dseqrecord.lower"""

upper = _copy.deepcopy(self)
# This is because the @seq.setter methods otherwise sets the _per_letter_annotations to an empty dict
prev_per_letter_annotation = upper._per_letter_annotations
upper.seq = upper.seq.upper()
upper._per_letter_annotations = prev_per_letter_annotation
return upper

def lower(self):
Expand Down Expand Up @@ -1092,7 +1096,9 @@ def lower(self):
"""
lower = _copy.deepcopy(self)
prev_per_letter_annotation = lower._per_letter_annotations
lower.seq = lower.seq.lower()
lower._per_letter_annotations = prev_per_letter_annotation
return lower

def orfs(self, minsize=300):
Expand Down
Loading

0 comments on commit c6f56c7

Please sign in to comment.