Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions cuvis/AcquisitionContext.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,15 @@ def __del__(self):
cuvis_il.cuvis_acq_cont_free(_ptr)
self._handle = cuvis_il.p_int_value(_ptr)

def __deepcopy__(self, memo):
'''This functions is not permitted due to the class only keeping a handle, that is managed by the cuvis sdk.'''
raise TypeError('Deep copying is not supported for AcquisitionContext')

def __copy__(self):
'''This functions is not permitted due to the class only keeping a handle, that is managed by the cuvis sdk.'''
raise TypeError(
'Shallow copying is not supported for AcquisitionContext')


class Component:
"""
Expand Down
18 changes: 18 additions & 0 deletions cuvis/Async.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ def __del__(self):
cuvis_il.cuvis_async_capture_free(_ptr)
self._handle = cuvis_il.p_int_value(_ptr)

def __deepcopy__(self, memo):
'''This functions is not permitted due to the class only keeping a handle, that is managed by the cuvis sdk.'''
raise TypeError('Deep copying is not supported for AsyncMesu')

def __copy__(self):
'''This functions is not permitted due to the class only keeping a handle, that is managed by the cuvis sdk.'''
raise TypeError(
'Shallow copying is not supported for AsyncMesu')


class Async(object):
def __init__(self, handle):
Expand Down Expand Up @@ -111,3 +120,12 @@ def __del__(self):
cuvis_il.p_int_assign(_ptr, self._handle)
cuvis_il.cuvis_async_call_free(_ptr)
self._handle = cuvis_il.p_int_value(_ptr)

def __deepcopy__(self, memo):
'''This functions is not permitted due to the class only keeping a handle, that is managed by the cuvis sdk.'''
raise TypeError('Deep copying is not supported for Async')

def __copy__(self):
'''This functions is not permitted due to the class only keeping a handle, that is managed by the cuvis sdk.'''
raise TypeError(
'Shallow copying is not supported for Async')
8 changes: 8 additions & 0 deletions cuvis/Calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,11 @@ def __del__(self):
_ptr = cuvis_il.new_p_int()
cuvis_il.p_int_assign(_ptr, self._handle)
cuvis_il.cuvis_calib_free(_ptr)

def __deepcopy__(self, memo):
'''This functions is not permitted due to the class only keeping a handle, that is managed by the cuvis sdk.'''
raise TypeError('Deep copying is not supported for Calibration')

def __copy__(self):
'''This functions is not permitted due to the class only keeping a handle, that is managed by the cuvis sdk.'''
raise TypeError('Shallow copying is not supported for Calibration')
9 changes: 9 additions & 0 deletions cuvis/Export.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from .Measurement import Measurement
from .FileWriteSettings import GeneralExportSettings, EnviExportSettings, TiffExportSettings, ViewExportSettings, SaveArgs


class Exporter(object):
def __init__(self):
self._handle = None
Expand All @@ -26,6 +27,14 @@ def flush(self):
if cuvis_il.status_ok != cuvis_il.cuvis_exporter_flush(self._handle):
raise SDKException()

def __deepcopy__(self, memo):
'''This functions is not permitted due to the class only keeping a handle, that is managed by the cuvis sdk.'''
raise TypeError('Deep copying is not supported for Exporter')

def __copy__(self):
'''This functions is not permitted due to the class only keeping a handle, that is managed by the cuvis sdk.'''
raise TypeError('Shallow copying is not supported for Exporter')

@property
def queue_used(self) -> int:
_ptr = cuvis_il.new_p_int()
Expand Down
7 changes: 7 additions & 0 deletions cuvis/Measurement.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,10 @@ def __del__(self):
cuvis_il.cuvis_measurement_free(_ptr)
self._handle = cuvis_il.p_int_value(_ptr)
pass

def __deepcopy__(self, memo):
return self.deepcopy()

def __copy__(self, memo):
'''This functions is not permitted due to the class only keeping a handle, that is managed by the cuvis sdk.'''
raise TypeError('Shallow copying is not supported for Measurement')
12 changes: 11 additions & 1 deletion cuvis/ProcessingContext.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import dataclasses


class ProcessingContext(object):
def __init__(self, base: Union[Calibration, SessionFile, Measurement]):
self._handle = None
Expand Down Expand Up @@ -132,4 +133,13 @@ def __del__(self):
cuvis_il.p_int_assign(_ptr, self._handle)
cuvis_il.cuvis_proc_cont_free(_ptr)
self._handle = cuvis_il.p_int_value(_ptr)
pass
pass

def __deepcopy__(self, memo):
'''This functions is not permitted due to the class only keeping a handle, that is managed by the cuvis sdk.'''
raise TypeError('Deep copying is not supported for ProcessingContext')

def __copy__(self):
'''This functions is not permitted due to the class only keeping a handle, that is managed by the cuvis sdk.'''
raise TypeError(
'Shallow copying is not supported for ProcessingContext')
8 changes: 8 additions & 0 deletions cuvis/SessionFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,11 @@ def __del__(self):
cuvis_il.p_int_assign(_ptr, self._handle)
cuvis_il.cuvis_session_file_free(_ptr)
self._handle = cuvis_il.p_int_value(_ptr)

def __deepcopy__(self, memo):
'''This functions is not permitted due to the class only keeping a handle, that is managed by the cuvis sdk.'''
raise TypeError('Deep copying is not supported for SessionFile')

def __copy__(self):
'''This functions is not permitted due to the class only keeping a handle, that is managed by the cuvis sdk.'''
raise TypeError('Shallow copying is not supported for SessionFile')
8 changes: 8 additions & 0 deletions cuvis/Viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,11 @@ def __del__(self):
cuvis_il.p_int_assign(_ptr, self._handle)
cuvis_il.cuvis_viewer_free(_ptr)
self._handle = cuvis_il.p_int_value(_ptr)

def __deepcopy__(self, memo):
'''This functions is not permitted due to the class only keeping a handle, that is managed by the cuvis sdk.'''
raise TypeError('Deep copying is not supported for Viewer')

def __copy__(self):
'''This functions is not permitted due to the class only keeping a handle, that is managed by the cuvis sdk.'''
raise TypeError('Shallow copying is not supported for Viewer')
8 changes: 8 additions & 0 deletions cuvis/Worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,3 +318,11 @@ def __del__(self):
cuvis_il.p_int_assign(_ptr, self._handle)
cuvis_il.cuvis_worker_free(_ptr)
self._handle = cuvis_il.p_int_value(_ptr)

def __deepcopy__(self, memo):
'''This functions is not permitted due to the class only keeping a handle, that is managed by the cuvis sdk.'''
raise TypeError('Deep copying is not supported for Worker')

def __copy__(self):
'''This functions is not permitted due to the class only keeping a handle, that is managed by the cuvis sdk.'''
raise TypeError('Shallow copying is not supported for Worker')