TomLXXVI / python-hvac

A multi-package for HVAC engineering written in Python.
MIT License
54 stars 18 forks source link

Fixes for the duplicate method #3

Closed samskiter closed 1 year ago

samskiter commented 1 year ago

More fixes for the duplicate method on Conduit - the deepcopy also navigates into Loops Nodes and eventually stumbles into CoolProps. I'm not sure it's really the right thing to recreate the start and end nodes anyway.

In the case of _create_loops I just had to reorder the statements such that when the copy happens, there are no loops on the conduit... but the net effect should be the same

TomLXXVI commented 1 year ago

I was able to solve this issue by implementing the dunder method __deepcopy__ to the Fluid class. Inside this method, a new Fluid instance is created with the same attributes as the original object to be copied and then returned.