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

FIX: Deepcopy of CRS with str/epsg #2356

Merged
merged 1 commit into from
Apr 3, 2024

Conversation

lgolston
Copy link
Contributor

Rationale

When using initializing crs.CRS with a string, or calling crs.epsg, there are errors when loading from a pickled copy or when performing deepcopy. This PR updates reduce to get those processes working.

Implications

Closes #2042 and the new issue recently reported in #1336

Checklist

Two previously failing cases are added to the crs test fixture.

@lgolston
Copy link
Contributor Author

The minimum packages run failed, and now I see pyproj has a related bug that was fixed in version 3.2.0 (pyproj4/pyproj#901). Would bumping the minimum version from 3.1.0 to 3.2.0 be okay?

@greglucas
Copy link
Contributor

Yes, I think that should be fine, we've been trying to do roughly 2 years for dependencies and that was released in 2021.
https://github.com/pyproj4/pyproj/releases/tag/3.2.0

@lgolston
Copy link
Contributor Author

Okay, I test locally and v3.3.1 is actually minimum needed for this, and have pushed a new update.
https://github.com/pyproj4/pyproj/releases/tag/3.3.1

@dopplershift
Copy link
Contributor

I'm happy to go with Proj 3.3.1 since that's at 23 months old.

@lgolston
Copy link
Contributor Author

I realized that checking if self.proj4_params == {} was a little myopic. That made deepcopy work if the proj4_params input to crs.CRS was a string, but still did not work for a dict. The PR is now updated to handle both cases.

pyproj is bumped as before (and one place matplotlib to 3.5 was missed in #2276)

As an aside, I also think getstate only needs to pop the _local variable, since it is unpickable, but just left it alone since it works either way.

There seem to be intermittent / unrelated failures recently that go away upon re-running (here with windows-latest, 3.9, false), which I do not understand.

@lgolston
Copy link
Contributor Author

Re-ran a fourth time and all tests are passing this time.
Run #1 there were a lot of errors in windows 3.9, I saw something similar when my conda environment was a little messed up before.
Run #2 and #3 there was a HTTP 502 error in downloading a few tiles from Google.
I think it is ready to go, but let me know if there are any issues.

@greglucas greglucas merged commit e069ab4 into SciTools:main Apr 3, 2024
23 checks passed
@QuLogic QuLogic added this to the Next Release milestone Apr 3, 2024
@lgolston lgolston deleted the deepcopy-bug-crs branch April 4, 2024 02:46
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

Successfully merging this pull request may close these issues.

Pickle crs.epsg missing argument 'code'
4 participants