Changed the type of label field in Strand, Domain, Loopout, and Extension to str instead of an arbitrary object.
Related Issue
261
Motivation and Context
Supporting arbitrary data is more complex, both for the type checking (requiring some ugly Generic declarations), and for trying to serialize and deserialize automatically. Instead users can serialize and deserialize manually using the json package:
import json
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 = json.loads(strand.label) # nums is now the list [1, 2, 3]
How Has This Been Tested?
Mostly just changed type hints, so checked that there are no mypy errors.
Description
Changed the type of
label
field inStrand
,Domain
,Loopout
, andExtension
tostr
instead of an arbitrary object.Related Issue
261
Motivation and Context
Supporting arbitrary data is more complex, both for the type checking (requiring some ugly
Generic
declarations), and for trying to serialize and deserialize automatically. Instead users can serialize and deserialize manually using thejson
package:How Has This Been Tested?
Mostly just changed type hints, so checked that there are no mypy errors.
Screenshots (if appropriate):