Conversation
…. Two tests added: which come from cadnano Autostaple's output
…_inputs/cadnano_v2_export as some .sc files are not generated but directly read by the tests
dave-doty
left a comment
There was a problem hiding this comment.
Looks good except for some mypy errors in scadnano.py. (There's always lots of mypy errors in the unit tests for some reason, which I don't worry about as much, but I want to keep scadnano.py free of mypy errors.) See other comment for list of errors related to the cadnano import/export code.
| base_from_before = base_from | ||
| id_from, base_from, _, _ = vstrands[id_from][strand_type][base_from] | ||
| return id_from_before, base_from_before | ||
| return id_from_before, base_from_before, is_circular |
There was a problem hiding this comment.
The return type of this method should be changed to Tuple[int, int, bool]. (Run mypy from the command line to see a list of mypy errors, or open in PyCharm.) There are some mypy errors in other parts of the code (not dealing with cadnano import/export) that are fixed in a newer branch I have, so don't worry about those errors, but here's the mypy errors in code related to cadnano import/export:
scadnano.py:4041: error: Incompatible return value type (got "Tuple[int, int, bool]", expected "Tuple[int, int]")
scadnano.py:4149: error: "Sequence[Domain[Any]]" has no attribute "__delitem__"; maybe "__getitem__"?
scadnano.py:4166: error: Need more than 2 values to unpack (3 expected)
scadnano.py:4174: error: Cannot determine type of 'strand_5_end_base'
scadnano.py:4175: error: Cannot determine type of 'strand_5_end_helix'
scadnano.py:4177: error: Cannot determine type of 'strand_5_end_base'
scadnano.py:4178: error: Cannot determine type of 'strand_5_end_helix'
scadnano.py:4180: error: Cannot determine type of 'is_circular'
scadnano.py:4185: error: Cannot determine type of 'is_circular'
scadnano.py:4454: error: Item "Loopout" of "Union[Domain[Any], Loopout]" has no attribute "helix"
scadnano.py:4455: error: Item "Loopout" of "Union[Domain[Any], Loopout]" has no attribute "start"
scadnano.py:4455: error: Item "Loopout" of "Union[Domain[Any], Loopout]" has no attribute "end"
scadnano.py:4455: error: Item "Loopout" of "Union[Domain[Any], Loopout]" has no attribute "forward"
scadnano.py:4458: error: Item "Loopout" of "Union[Domain[Any], Loopout]" has no attribute "helix"
scadnano.py:4459: error: Item "Loopout" of "Union[Domain[Any], Loopout]" has no attribute "start"
scadnano.py:4459: error: Item "Loopout" of "Union[Domain[Any], Loopout]" has no attribute "end"
scadnano.py:4459: error: Item "Loopout" of "Union[Domain[Any], Loopout]" has no attribute "forward"
This pull request incorporates my changes to make the import/export cadnano2 feature compatible with circular strands.
Relevant import/export tests were added as well.