Skip to content

Dev export import circular strands#155

Merged
dave-doty merged 4 commits intodevfrom
dev-export-import-circular-strands
Dec 24, 2020
Merged

Dev export import circular strands#155
dave-doty merged 4 commits intodevfrom
dev-export-import-circular-strands

Conversation

@tcosmo
Copy link
Copy Markdown
Collaborator

@tcosmo tcosmo commented Dec 23, 2020

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.

…. 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
@tcosmo tcosmo requested a review from dave-doty as a code owner December 23, 2020 14:34
Copy link
Copy Markdown
Member

@dave-doty dave-doty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

@dave-doty dave-doty merged commit 60bbab0 into dev Dec 24, 2020
@dave-doty dave-doty deleted the dev-export-import-circular-strands branch December 24, 2020 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants