Hello,
For the below code I get an error related to __cinit__ (Cython) when performing a deepcopy that includes a nest.spatial specification.
I am using NEST 3.3 and Python 3.8.12
Best,
Xavier
----
import nest import copy
my_dict = {'rule': 'pairwise_bernoulli', 'p': nest.spatial_distributions.gaussian(nest.spatial.distance, std=1.0), 'mask': {'circular': {'radius': 4.}}} new_dict = copy.deepcopy(my_dict)
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib64/python3.8/copy.py", line 146, in deepcopy y = copier(x, memo) File "/usr/lib64/python3.8/copy.py", line 230, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "/usr/lib64/python3.8/copy.py", line 172, in deepcopy y = _reconstruct(x, memo, *rv) File "/usr/lib64/python3.8/copy.py", line 270, in _reconstruct state = deepcopy(state, memo) File "/usr/lib64/python3.8/copy.py", line 146, in deepcopy y = copier(x, memo) File "/usr/lib64/python3.8/copy.py", line 230, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "/usr/lib64/python3.8/copy.py", line 161, in deepcopy rv = reductor(4) File "stringsource", line 2, in pynestkernel.SLIDatum.__reduce_cython__ TypeError: no default __reduce__ due to non-trivial __cinit__
Dear Xavier,
I have recorded your problem as a feature request: https://github.com/nest/nest-simulator/issues/2623, please continue
Due to limited developer resources, I don't think we will be able to handle this with a very high priority, though. If you decide to give this a shot yourself, feel free to do so.
Cheers, Jochen!
On 17.02.23 15:33, Xavier Otazu wrote:
Hello,
For the below code I get an error related to __cinit__ (Cython) when performing a deepcopy that includes a nest.spatial specification.
I am using NEST 3.3 and Python 3.8.12
Best,
Xavier
import nest import copy
my_dict = {'rule': 'pairwise_bernoulli', 'p': nest.spatial_distributions.gaussian(nest.spatial.distance, std=1.0), 'mask': {'circular': {'radius': 4.}}} new_dict = copy.deepcopy(my_dict)
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib64/python3.8/copy.py", line 146, in deepcopy y = copier(x, memo) File "/usr/lib64/python3.8/copy.py", line 230, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "/usr/lib64/python3.8/copy.py", line 172, in deepcopy y = _reconstruct(x, memo, *rv) File "/usr/lib64/python3.8/copy.py", line 270, in _reconstruct state = deepcopy(state, memo) File "/usr/lib64/python3.8/copy.py", line 146, in deepcopy y = copier(x, memo) File "/usr/lib64/python3.8/copy.py", line 230, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "/usr/lib64/python3.8/copy.py", line 161, in deepcopy rv = reductor(4) File "stringsource", line 2, in pynestkernel.SLIDatum.__reduce_cython__ TypeError: no default __reduce__ due to non-trivial __cinit__ _______________________________________________ NEST Users mailing list -- users@nest-simulator.org To unsubscribe send an email to users-leave@nest-simulator.org
Dear Jochen,
Thank you!
I am not very familiar with Python (I am a C++ guy) and it would be somewhat difficult for me to debug this error :-)
Best,
Xavier