Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Introduce map copy method #1554
Add a test that shows that the clone is an independent deep copy by default (using
is not to test that object IDs are different)?
Is the complexity with
init inspect needed? Or is there are different way to write this?
OK I might have missed the point of this
clone method but I would not expect a clone method to be able to change the geometry of a
Note also the possible issue with multi resolution
I see, the complexity comes from wanting to use
I think I agree with the comment by @registerrier :
If possible, I would prefer to remove the complex implementation of clone with argument inspection. Is this possible?
Note that str is immutable in Python, so making a copy is not needed / useful.
And then for the cases where geom changes, we keep using the
If so, it might be better to rename
I actually noticed the same issue, that the
I've changed now to the following pattern. I introduced a hidden
I don't like the
I'll make a follow-up commit here and then merge without further discussion, so that we can move on.
That doesn't have to be the final solution, we can re-discuss on Friday or later once we have more experience and callers with this, and then put something better if we find it.
But this should go in, IMO it's been a real pain-point and error-prone, to not have a way to make a copy without having to import and hard-code the map class (i.e. WCSNDMap or HPX map).