autowrap icon indicating copy to clipboard operation
autowrap copied to clipboard

Enable maps of wrapped classes

Open poshul opened this issue 3 years ago • 4 comments

Autowrap currently doesn't allow the wrapping of maps that have keys that are themselves wrapped. ("Converter can not handle wrapped classes as keys and values in map"). This should be added for ID Datastructure wrapping.

poshul avatar Apr 04 '22 15:04 poshul

Done in #124

jpfeuffer avatar Apr 04 '22 20:04 jpfeuffer

I'm still seeing this issue using a version of autowrap with #124 merged,

Traceback (most recent call last): File "/home/samuel/.local/lib/python3.9/site-packages/autowrap-0.22.8-py3.9.egg/autowrap/CodeGenerator.py", line 520, in create_wrapper_for_class pyx_code, stub_code = self._create_wrapper_for_attribute(attribute) File "/home/samuel/.local/lib/python3.9/site-packages/autowrap-0.22.8-py3.9.egg/autowrap/CodeGenerator.py", line 870, in _create_wrapper_for_attribute to_py_code = converter.output_conversion(t, "_r", "py_result") File "/home/samuel/.local/lib/python3.9/site-packages/autowrap-0.22.8-py3.9.egg/autowrap/ConversionProvider.py", line 978, in output_conversion raise Exception("Converter can not handle wrapped classes as keys and values in map") Exception: Converter can not handle wrapped classes as keys and values in map

poshul avatar Apr 05 '22 07:04 poshul

Can you add a PR with a MWE as test that shows this behaviour?

jpfeuffer avatar Apr 14 '22 13:04 jpfeuffer

Ok, while checking the code, it is obvious that the support was only added for the input_conversion. We need to take the changes from the linked PR #124 and do the same for output_conversion.

jpfeuffer avatar Apr 14 '22 13:04 jpfeuffer