Add .copy() and .deepcopy() convenience methods
This commit is contained in:
parent
eb6a5d8e8c
commit
539198435c
@ -4,6 +4,7 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from typing import Union, List
|
from typing import Union, List
|
||||||
|
import copy
|
||||||
|
|
||||||
import numpy
|
import numpy
|
||||||
from numpy import pi
|
from numpy import pi
|
||||||
@ -183,3 +184,19 @@ class SubPattern:
|
|||||||
"""
|
"""
|
||||||
self.scale *= c
|
self.scale *= c
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
def copy(self) -> 'SubPattern':
|
||||||
|
"""
|
||||||
|
Return a shallow copy of the subpattern.
|
||||||
|
|
||||||
|
:return: copy.copy(self)
|
||||||
|
"""
|
||||||
|
return copy.copy(self)
|
||||||
|
|
||||||
|
def deepcopy(self) -> 'SubPattern':
|
||||||
|
"""
|
||||||
|
Return a deep copy of the subpattern.
|
||||||
|
|
||||||
|
:return: copy.copy(self)
|
||||||
|
"""
|
||||||
|
return copy.deepcopy(self)
|
||||||
|
Loading…
Reference in New Issue
Block a user