Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow users to bypass deepcopy in from_dict methods #453

Closed
lossyrob opened this issue Jun 17, 2021 · 1 comment
Closed

Allow users to bypass deepcopy in from_dict methods #453

lossyrob opened this issue Jun 17, 2021 · 1 comment

Comments

@lossyrob
Copy link
Member

As described in stac-utils/pystac-client#49, a lot of time is spent in the deepcopy for a large Item dict when deserializing to a pystac.Item. The deepcopy is done to avoid mutating the parameter dict, which I think is good practice, but also wholly unnecessary when you've just created the dict from e.g. reading from a file or deserializing from a HTTP response and are not planning on using the dict any further. In these cases, the deepcopy is only a performance hit with no benefit.

The goal of this issue is to introduce a parameter to to_dict methods that allow users to avoid copying the dict. This should be used in PySTAC codepaths such as from_file methods where the incoming dict is a temporary data structure.

@lossyrob
Copy link
Member Author

Closed by #454

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant