v0.18.0
Release notes
BREAKING CHANGE: label type is now str
Strands, domains, loopouts, and extensions have a field label
. Previously the declared type was arbitrary, though at runtime it was required to be JSON-serializable.
Now we have changed the type of label
field in Strand
, Domain
, Loopout
, and Extension
to str
instead of an arbitrary object.
This is a breaking change because existing code using non-string labels will have to be altered to change the data to a string before storing and change it back to structured data when reading.
If you would like to store "structured data" (e.g., lists or dicts) in the label, you can serialize to a string and deserialize back to structured data manually using the json
package.
Before, this was possible:
from typing import List
# previously was possible, now is not supported
nums = [1, 2, 3]
strand.label = nums # stores strand.label as the list [1, 2, 3]; would be a mypy type error now
# and to get the structured data back out:
nums: List[int] = strand.label # would be a mypy type error now
Now this is necessary to store a list of int
's in the label:
import json
from typing import List
nums = [1, 2, 3]
strand.label = json.dumps(nums) # stores strand.label as the string '[1, 2, 3]'
# and to get the structured data back out:
nums: List[int] = json.loads(strand.label) # nums is now the list [1, 2, 3]
added p8634 variant of M13
There is a variant of M13 mentioned in a few papers (e.g., https://doi.org/10.1038/s41565-022-01283-1) called "p8634". It can be obtained from Tilibit (though not listed on their website). This sequence is now available as a predefined sequence. See https://scadnano-python-package.readthedocs.io/en/latest/#scadnano.M13Variant.p8634
Commits
- d955eda: bumped version (David Doty) #258
- 2f58b2b: updated docstrings (David Doty) #258
- 0a482a7: Update scadnano.py (David Doty) #258
- c55411e: Update scadnano.py (David Doty) #258
- fca673a: added test generated by GitHub Copilot (David Doty) #258
- 3e84a38: changed docstring for
Design.base_pairs
(David Doty) #258 - fc2176b: added examples (David Doty) #258
- 7b0603b: changed to LR newlines (David Doty) #258
- 01c43e3: added p8634 variant of M13 (David Doty) #258
- 0678d55: formatting (David Doty) #258
- e8211db: fixed PyCharm warnings (David Doty) #258
- 602575d: closes #261: change
label
type tostr
(David Doty) #262 - a292757: removed all string type hints and replaced with forward references (not supported in Python 3.6) (David Doty) #262