scikit-rf/scikit-rf — Issue #3: deepcopy fails
Author: SjoerdOptLand
Created: 2012-02-17 09:33:23+00:00
State: open

Using the 07149 revision and Python 2.6.5, I can't seem to deepcopy a loaded 1-port Network. I don't have the time now to set up a test that detects the bug and then fix it. Furthermore, I have a problem configuring git for our corporate proxy, so you will need to wait for my commits.

This bug is rather serious, because Calibration invokes a deepcopy on the provided measurements and ideals.

Do you succeed in reproducing the bug?

import skrf
import copy
loadedNetwork = skrf.Network('Y:\ADS\SOIC8_Fixture_Test_prj\misc\short_sma_calibration.s1p')
copiedNetwork = copy.deepcopy(loadedNetwork)

Traceback (most recent call last):
File "", line 5, in
copiedNetwork = copy.deepcopy(loadedNetwork)
File "C:\Python26\lib\copy.py", line 189, in deepcopy
y = _reconstruct(x, rv, 1, memo)
File "C:\Python26\lib\copy.py", line 338, in _reconstruct
state = deepcopy(state, memo)
File "C:\Python26\lib\copy.py", line 162, in deepcopy
y = copier(x, memo)
File "C:\Python26\lib\copy.py", line 255, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "C:\Python26\lib\copy.py", line 189, in deepcopy
y = _reconstruct(x, rv, 1, memo)
File "C:\Python26\lib\copy.py", line 323, in _reconstruct
y = callable(*args)
File "C:\Python26\lib\copy_reg.py", line 93, in __newobj__
return cls.__new__(cls, *args)
TypeError: instancemethod expected at least 2 arguments, got 0