From 5a590ea16a3f8c997f81d26a29d9c6fd125e3493 Mon Sep 17 00:00:00 2001 From: David Doty Date: Tue, 19 Dec 2023 19:28:37 -0600 Subject: [PATCH] added `strand()` method to class `Extension` to get parent strand --- scadnano/scadnano.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scadnano/scadnano.py b/scadnano/scadnano.py index ec6c19d..e0902ee 100644 --- a/scadnano/scadnano.py +++ b/scadnano/scadnano.py @@ -2716,6 +2716,14 @@ def dna_length(self) -> int: """Length of this :any:`Extension`; same as field :data:`Extension.num_bases`.""" return self.num_bases + def strand(self) -> Strand: + """ + :return: The :any:`Strand` that contains this :any:`Extension`. + """ + if self._parent_strand is None: + raise ValueError('_parent_strand has not yet been set') + return self._parent_strand + def vendor_dna_sequence(self) -> Optional[str]: """ :return: