Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
dave-doty committed Oct 26, 2024
1 parent 03d15db commit b00105b
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions scadnano/scadnano.py
Original file line number Diff line number Diff line change
Expand Up @@ -6609,17 +6609,17 @@ def _cadnano_v2_place_crossover(helix_from_dct: Dict[str, Any], helix_to_dct: Di
helix_to_dct[strand_type][start_to][:2] = [helix_from, start_from]
elif forward_from and forward_to:
helix_from_dct[strand_type][end_from - 1][2:] = [helix_to, start_to]
helix_to_dct[strand_type][end_to-1][:2] = [helix_from, start_from]
if helix_from_dct["row"]%2 != helix_to_dct["row"]%2:
helix_to_dct[strand_type][end_to - 1][:2] = [helix_from, start_from]
if helix_from_dct["row"] % 2 != helix_to_dct["row"] % 2:
raise ValueError("Paranemic crossovers are only allowed between helices that have the same parity of "
f"row number, here helix num {helix_from_dct['num']} and helix num "
f"{helix_to_dct['num']} have different parity of row number: respectively "
f"{helix_from_dct['row']} and {helix_to_dct["row"]}")

elif not forward_from and not forward_to:
helix_from_dct[strand_type][start_from][2:] = [helix_to, end_to - 1]
helix_to_dct[strand_type][end_to-1][:2] = [helix_from, start_from]
if helix_from_dct["row"]%2 != helix_to_dct["row"]%2:
helix_to_dct[strand_type][end_to - 1][:2] = [helix_from, start_from]
if helix_from_dct["row"] % 2 != helix_to_dct["row"] % 2:
raise ValueError("Paranemic crossovers are only allowed between helices that have the same parity of "
f"row number, here helix num {helix_from_dct['num']} and helix num "
f"{helix_to_dct['num']} have different parity of row number: respectively "
Expand Down Expand Up @@ -6661,9 +6661,6 @@ def _cadnano_v2_place_strand(self, strand: Strand, dct: dict,
next_helix = dct['vstrands'][next_helix_id]
self._cadnano_v2_place_crossover(which_helix, next_helix,
domain, next_domain, strand_type)




# if the strand is circular, we need to close the loop
if strand.circular:
Expand Down Expand Up @@ -6817,7 +6814,6 @@ def to_cadnano_v2_serializable(self, name: str = '') -> Dict[str, Any]:

for strand in self.strands:
self._cadnano_v2_place_strand(strand, dct, helices_ids_reverse)


return dct

Expand Down

0 comments on commit b00105b

Please sign in to comment.