emerald-geomodelling / libaarhusxyz

Parser for the Aarhus Workbench XYZ format
MIT License
2 stars 0 forks source link

'gex.__getattr__' makes is so that the gex object cannot be copied using 'copy.deepcopy' #31

Closed burningsage closed 2 months ago

burningsage commented 3 months ago

https://github.com/emerald-geomodelling/libaarhusxyz/blame/2e75435d9510a4b7548a2c780c845e55a9f203ca/libaarhusxyz/gex.py#L174

Traceback (most recent call last):
  File "/Users/bbloss/EMeraldCodes/VirtualEnvironments/0_EMPro_py3.10.13_20240617/lib/python3.10/site-packages/luigi/worker.py", line 210, in run
    new_deps = self._run_get_new_deps()
  File "/Users/bbloss/EMeraldCodes/VirtualEnvironments/0_EMPro_py3.10.13_20240617/lib/python3.10/site-packages/luigi/worker.py", line 138, in _run_get_new_deps
    task_gen = self.task.run()
  File "/Users/bbloss/EMeraldCodes/emerald-beryl-pipeline/beryl_pipeline/processing.py", line 69, in run
    fl_data = deepcopy(data)  # the gex is making it so that this cant copy and get a name?!?
  File "/opt/homebrew/Cellar/python@3.10/3.10.13/Frameworks/Python.framework/Versions/3.10/lib/python3.10/copy.py", line 172, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "/opt/homebrew/Cellar/python@3.10/3.10.13/Frameworks/Python.framework/Versions/3.10/lib/python3.10/copy.py", line 271, in _reconstruct
    state = deepcopy(state, memo)
  File "/opt/homebrew/Cellar/python@3.10/3.10.13/Frameworks/Python.framework/Versions/3.10/lib/python3.10/copy.py", line 146, in deepcopy
    y = copier(x, memo)
  File "/opt/homebrew/Cellar/python@3.10/3.10.13/Frameworks/Python.framework/Versions/3.10/lib/python3.10/copy.py", line 231, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/opt/homebrew/Cellar/python@3.10/3.10.13/Frameworks/Python.framework/Versions/3.10/lib/python3.10/copy.py", line 151, in deepcopy
    copier = getattr(x, "__deepcopy__", None)
  File "/Users/bbloss/EMeraldCodes/libaarhusxyz/libaarhusxyz/gex.py", line 175, in __getattr__
    return self.gex_dict[name]
KeyError: '__deepcopy__'
burningsage commented 3 months ago

Note: This this PR: https://github.com/emerald-geomodelling/libaarhusxyz/pull/29 will comment out these lines

burningsage commented 3 months ago

https://emerald-geomodelling.slack.com/archives/C01G0U7KXEV/p1721131641463619

Duke-of-Lizard commented 3 months ago

Did a search of instances of ‘.gex.’ and ’gex.’, and the only time there a predifined attribute of method wasn’t accessed was in this JavaScript file. However, I don’t know if this thing named gex is actually an instance of the Python Class GEX

Duke-of-Lizard commented 3 months ago

Did a search of instances of ‘.gex.’ and ’gex.’, and the only time there a predifined attribute of method wasn’t accessed was in this JavaScript file. However, I don’t know if this thing named gex is actually an instance of the Python Class GEX

My search query: https://github.com/search?q=org%3Aemerald-geomodelling+gex.&type=code

burningsage commented 2 months ago

this has been resolved by not copying the gex object