SciTools / cartopy

Cartopy - a cartographic python library with matplotlib support
https://scitools.org.uk/cartopy/docs/latest
BSD 3-Clause "New" or "Revised" License
1.42k stars 361 forks source link

Pickle crs.epsg missing argument 'code' #2042

Closed chunhei37 closed 6 months ago

chunhei37 commented 2 years ago

Description

Cannot pickle crs.epsg(). It can be dumped, but cannot be loaded.

TypeError: __init__() missing 1 required positional argument: 'code'

Code to reproduce

import pickle
import cartopy.crs as ccrs

proj = ccrs.epsg(3088)
pickle.dump(proj, open("test.pickle", "wb"))
proj = pickle.load(open("test.pickle", "rb"))

Traceback

Traceback (most recent call last):
  File "/Users/user01/opt/anaconda3/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Users/user01/opt/anaconda3/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/user01/.vscode/extensions/ms-python.python-2022.4.1/pythonFiles/lib/python/debugpy/__main__.py", line 45, in <module>
    cli.main()
  File "/Users/user01/.vscode/extensions/ms-python.python-2022.4.1/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 444, in main
    run()
  File "/Users/user01/.vscode/extensions/ms-python.python-2022.4.1/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 285, in run_file
    runpy.run_path(target_as_str, run_name=compat.force_str("__main__"))
  File "/Users/user01/opt/anaconda3/lib/python3.9/runpy.py", line 268, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "/Users/user01/opt/anaconda3/lib/python3.9/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/Users/user01/opt/anaconda3/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/user01/1/2/3/try.py", line 6, in <module>
    proj = pickle.load(open("test1.pickle", "rb"))
TypeError: __init__() missing 1 required positional argument: 'code'
Full environment definition ### Operating system macOS ### Cartopy version 0.20.2 ### conda list ``` # Name Version Build Channel _anaconda_depends 2021.11 py39_0 _ipyw_jlab_nb_ext_conf 0.1.0 py39hecd8cb5_1 alabaster 0.7.12 pyhd3eb1b0_0 anaconda custom py39_1 anaconda-client 1.9.0 py39hecd8cb5_0 anaconda-navigator 2.1.4 py39hecd8cb5_0 anaconda-project 0.10.2 pyhd3eb1b0_0 anyio 3.5.0 py39hecd8cb5_0 appdirs 1.4.4 pyhd3eb1b0_0 applaunchservices 0.2.1 pyhd3eb1b0_0 appnope 0.1.2 py39hecd8cb5_1001 appscript 1.1.2 py39h9ed2024_0 argh 0.26.2 py39hecd8cb5_0 argon2-cffi 21.3.0 pyhd3eb1b0_0 argon2-cffi-bindings 21.2.0 py39hca72f7f_0 arrow 1.2.2 pyhd3eb1b0_0 asn1crypto 1.4.0 py_0 astroid 2.6.6 py39hecd8cb5_0 astropy 5.0.4 py39h67323c0_0 asttokens 2.0.5 pyhd3eb1b0_0 async_generator 1.10 pyhd3eb1b0_0 atomicwrites 1.4.0 py_0 attrs 21.4.0 pyhd3eb1b0_0 autopep8 1.6.0 pyhd3eb1b0_0 babel 2.9.1 pyhd3eb1b0_0 backcall 0.2.0 pyhd3eb1b0_0 backports 1.1 pyhd3eb1b0_0 backports.functools_lru_cache 1.6.4 pyhd3eb1b0_0 backports.shutil_get_terminal_size 1.0.0 pyhd3eb1b0_3 backports.tempfile 1.0 pyhd3eb1b0_1 backports.weakref 1.0.post1 py_1 beautifulsoup4 4.11.1 py39hecd8cb5_0 binaryornot 0.4.4 pyhd3eb1b0_1 bitarray 2.4.1 py39hca72f7f_0 bkcharts 0.2 py39hecd8cb5_0 black 19.10b0 py_0 blas 1.0 mkl bleach 4.1.0 pyhd3eb1b0_0 blosc 1.21.1 hd0a9f43_0 conda-forge bokeh 2.4.2 py39hecd8cb5_0 boto 2.49.0 py39hecd8cb5_0 bottleneck 1.3.4 py39h67323c0_0 brotli 1.0.9 hb1e8313_2 brotlipy 0.7.0 py39h9ed2024_1003 brunsli 0.1 h23ab428_0 bzip2 1.0.8 h1de35cc_0 c-ares 1.18.1 hca72f7f_0 c-blosc2 2.0.4 ha1a4663_1 conda-forge ca-certificates 2021.10.8 h033912b_0 conda-forge cached-property 1.5.2 py_0 cartopy 0.20.2 py39hd74d15e_4 conda-forge certifi 2021.10.8 py39h6e9494a_2 conda-forge cffi 1.15.0 py39hc55c11b_1 cfitsio 3.470 hee0f690_6 cftime 1.5.1.1 py39h67323c0_0 chardet 4.0.0 py39hecd8cb5_1003 charls 2.2.0 h23ab428_0 charset-normalizer 2.0.4 pyhd3eb1b0_0 click 8.0.4 py39hecd8cb5_0 cloudpickle 2.0.0 pyhd3eb1b0_0 clyent 1.2.2 py39hecd8cb5_1 colorama 0.4.4 pyhd3eb1b0_0 conda 4.12.0 py39h6e9494a_0 conda-forge conda-build 3.21.8 py39hecd8cb5_2 conda-content-trust 0.1.1 pyhd3eb1b0_0 conda-env 2.6.0 1 conda-pack 0.6.0 pyhd3eb1b0_0 conda-package-handling 1.8.1 py39hca72f7f_0 conda-repo-cli 1.0.4 pyhd3eb1b0_0 conda-token 0.3.0 pyhd3eb1b0_0 conda-verify 3.4.2 py_1 contextlib2 0.6.0.post1 pyhd3eb1b0_0 cookiecutter 1.7.3 pyhd3eb1b0_0 cryptography 3.4.8 py39h2fd3fbb_0 curl 7.82.0 hca72f7f_0 cycler 0.11.0 pyhd3eb1b0_0 cython 0.29.28 py39he9d5cce_0 cytoolz 0.11.0 py39h9ed2024_0 daal4py 2021.5.0 py39h24a4e90_0 dal 2021.5.0 hecd8cb5_782 dask 2022.2.1 pyhd3eb1b0_0 dask-core 2022.2.1 pyhd3eb1b0_0 dataclasses 0.8 pyh6d0b6a4_7 debugpy 1.5.1 py39he9d5cce_0 decorator 5.1.1 pyhd3eb1b0_0 defusedxml 0.7.1 pyhd3eb1b0_0 diff-match-patch 20200713 pyhd3eb1b0_0 distributed 2022.2.1 pyhd3eb1b0_0 docutils 0.17.1 py39hecd8cb5_1 entrypoints 0.4 py39hecd8cb5_0 et_xmlfile 1.1.0 py39hecd8cb5_0 executing 0.8.3 pyhd3eb1b0_0 fastcache 1.1.0 py39h9ed2024_0 filelock 3.6.0 pyhd3eb1b0_0 flake8 3.9.2 pyhd3eb1b0_0 flask 1.1.2 pyhd3eb1b0_0 fonttools 4.25.0 pyhd3eb1b0_0 freetype 2.11.0 hd8bbffd_0 fsspec 2022.2.0 pyhd3eb1b0_0 future 0.18.2 py39hecd8cb5_1 geos 3.10.2 he49afe7_0 conda-forge get_terminal_size 1.0.0 h7520d66_0 gevent 21.8.0 py39h9ed2024_1 giflib 5.2.1 haf1e3a3_0 glob2 0.7 pyhd3eb1b0_0 gmp 6.2.1 h23ab428_2 gmpy2 2.1.2 py39hd5de756_0 greenlet 1.1.1 py39h23ab428_0 h5py 3.6.0 py39h4a1dd59_0 hdf4 4.2.13 h39711bb_2 hdf5 1.10.6 hdbbcd12_0 heapdict 1.0.1 pyhd3eb1b0_0 html5lib 1.1 pyhd3eb1b0_0 icu 58.2 h0a44026_3 idna 3.3 pyhd3eb1b0_0 imagecodecs 2021.8.26 py39he5b32f2_1 conda-forge imageio 2.9.0 pyhd3eb1b0_0 imagesize 1.3.0 pyhd3eb1b0_0 importlib-metadata 4.11.3 py39hecd8cb5_0 importlib_metadata 4.11.3 hd3eb1b0_0 importlib_resources 5.2.0 pyhd3eb1b0_1 inflection 0.5.1 py39hecd8cb5_0 iniconfig 1.1.1 pyhd3eb1b0_0 intel-openmp 2021.4.0 hecd8cb5_3538 intervaltree 3.1.0 pyhd3eb1b0_0 ipykernel 6.9.1 py39hecd8cb5_0 ipython 8.2.0 py39hecd8cb5_0 ipython_genutils 0.2.0 pyhd3eb1b0_1 ipywidgets 7.6.5 pyhd3eb1b0_1 isort 5.9.3 pyhd3eb1b0_0 itsdangerous 2.0.1 pyhd3eb1b0_0 jbig 2.1 h4d881f8_0 jdcal 1.4.1 pyhd3eb1b0_0 jedi 0.18.1 py39hecd8cb5_1 jinja2 2.11.3 pyhd3eb1b0_0 jinja2-time 0.2.0 pyhd3eb1b0_3 joblib 1.1.0 pyhd3eb1b0_0 jpeg 9e hca72f7f_0 json5 0.9.6 pyhd3eb1b0_0 jsonschema 4.4.0 py39hecd8cb5_0 jupyter 1.0.0 py39hecd8cb5_7 jupyter_client 6.1.12 pyhd3eb1b0_0 jupyter_console 6.4.0 pyhd3eb1b0_0 jupyter_core 4.9.2 py39hecd8cb5_0 jupyter_server 1.13.5 pyhd3eb1b0_0 jupyterlab 3.3.2 pyhd3eb1b0_0 jupyterlab_pygments 0.1.2 py_0 jupyterlab_server 2.10.3 pyhd3eb1b0_1 jupyterlab_widgets 1.0.0 pyhd3eb1b0_1 jxrlib 1.1 haf1e3a3_2 keyring 23.4.0 py39hecd8cb5_0 kiwisolver 1.3.2 py39he9d5cce_0 krb5 1.19.2 hcd88c3b_0 lazy-object-proxy 1.6.0 py39h9ed2024_0 lcms2 2.12 hf1fd2bf_0 lerc 3.0 he9d5cce_0 libaec 1.0.6 he49afe7_0 conda-forge libarchive 3.5.2 h2b60450_1 conda-forge libbrotlicommon 1.0.9 h5eb16cf_7 conda-forge libbrotlidec 1.0.9 h5eb16cf_7 conda-forge libbrotlienc 1.0.9 h5eb16cf_7 conda-forge libcurl 7.82.0 h6dfd666_0 libcxx 13.0.1 hc203e6f_0 conda-forge libdeflate 1.8 h9ed2024_5 libedit 3.1.20210910 hca72f7f_0 libev 4.33 h9ed2024_1 libffi 3.3 hb1e8313_2 libgfortran 3.0.1 h93005f0_2 libiconv 1.16 hca72f7f_2 liblief 0.11.5 he9d5cce_1 libllvm11 11.1.0 h46f1229_1 libnetcdf 4.8.1 h24cb85c_1 libnghttp2 1.46.0 ha29bfda_0 libpng 1.6.37 ha441bb4_0 libsodium 1.0.18 h1de35cc_0 libspatialindex 1.9.3 h23ab428_0 libssh2 1.10.0 h0a4fc7d_0 libtiff 4.3.0 hd146c10_2 conda-forge libuv 1.40.0 haf1e3a3_0 libwebp 1.2.2 h56c3ce4_0 libwebp-base 1.2.2 hca72f7f_0 libxml2 2.9.12 hcdb78fc_0 libxslt 1.1.34 h83b36ba_0 libzip 1.5.1 h08130ce_1003 libzlib 1.2.11 h6c3fc93_1014 conda-forge libzopfli 1.0.3 hb1e8313_0 llvm-openmp 12.0.0 h0dcd299_1 llvmlite 0.38.0 py39h8346a28_0 locket 0.2.1 py39hecd8cb5_2 lxml 4.8.0 py39h65b224f_0 lz4-c 1.9.3 h23ab428_1 lzo 2.10 haf1e3a3_2 markupsafe 2.0.1 py39h9ed2024_0 matplotlib 3.5.1 py39hecd8cb5_1 matplotlib-base 3.5.1 py39hfb0c5b7_1 matplotlib-inline 0.1.2 pyhd3eb1b0_2 mccabe 0.6.1 py39hecd8cb5_1 metpy 1.3.0 pyhd8ed1ab_0 conda-forge mistune 0.8.4 py39h9ed2024_1000 mkl 2021.4.0 hecd8cb5_637 mkl-service 2.4.0 py39h9ed2024_0 mkl_fft 1.3.1 py39h4ab4a9b_0 mkl_random 1.2.2 py39hb2f4e1b_0 mock 4.0.3 pyhd3eb1b0_0 more-itertools 8.12.0 pyhd3eb1b0_0 mpc 1.1.0 h6ef4df4_1 mpfr 4.0.2 h9066e36_1 mpi 1.0 mpich mpich 3.3.2 hc856adb_0 mpmath 1.2.1 py39hecd8cb5_0 msgpack-python 1.0.2 py39hf7b0b51_1 multipledispatch 0.6.0 py39hecd8cb5_0 munkres 1.1.4 py_0 mypy_extensions 0.4.3 py39hecd8cb5_1 mysql-connector-c 6.1.11 hccea1a4_1 mysqlclient 2.0.3 py39h23ab428_1 navigator-updater 0.2.1 py39_1 nbclassic 0.3.5 pyhd3eb1b0_0 nbclient 0.5.13 py39hecd8cb5_0 nbconvert 6.4.4 py39hecd8cb5_0 nbformat 5.3.0 py39hecd8cb5_0 ncurses 6.3 hca72f7f_2 nest-asyncio 1.5.5 py39hecd8cb5_0 netcdf4 1.5.7 py39h4a1dd59_1 networkx 2.7.1 pyhd3eb1b0_0 nltk 3.7 pyhd3eb1b0_0 nose 1.3.7 pyhd3eb1b0_1008 notebook 6.4.8 py39hecd8cb5_0 numba 0.55.1 py39hae1ba45_0 numexpr 2.8.1 py39h2e5f0a9_0 numpy 1.21.5 py39h2e5f0a9_1 numpy-base 1.21.5 py39h3b1a694_1 numpydoc 1.2 pyhd3eb1b0_0 olefile 0.46 pyhd3eb1b0_0 openjpeg 2.4.0 h66ea3da_0 openpyxl 3.0.9 pyhd3eb1b0_0 openssl 1.1.1n h6c3fc93_0 conda-forge packaging 21.3 pyhd3eb1b0_0 pandas 1.4.2 py39he9d5cce_0 pandocfilters 1.5.0 pyhd3eb1b0_0 parso 0.8.3 pyhd3eb1b0_0 partd 1.2.0 pyhd3eb1b0_1 path 16.2.0 pyhd3eb1b0_0 path.py 12.5.0 hd3eb1b0_0 pathlib2 2.3.6 py39hecd8cb5_2 pathspec 0.7.0 py_0 patsy 0.5.2 py39hecd8cb5_1 pep8 1.7.1 py39hecd8cb5_0 pexpect 4.8.0 pyhd3eb1b0_3 pickleshare 0.7.5 pyhd3eb1b0_1003 pillow 9.0.1 py39hde71d04_0 pint 0.19.2 pyhd8ed1ab_0 conda-forge pip 21.2.4 py39hecd8cb5_0 pkginfo 1.8.2 pyhd3eb1b0_0 pluggy 1.0.0 py39hecd8cb5_1 ply 3.11 py39hecd8cb5_0 pooch 1.4.0 pyhd3eb1b0_0 poyo 0.5.0 pyhd3eb1b0_0 proj 9.0.0 h2364a93_1 conda-forge prometheus_client 0.13.1 pyhd3eb1b0_0 prompt-toolkit 3.0.20 pyhd3eb1b0_0 prompt_toolkit 3.0.20 hd3eb1b0_0 psutil 5.8.0 py39h9ed2024_1 ptyprocess 0.7.0 pyhd3eb1b0_2 pure_eval 0.2.2 pyhd3eb1b0_0 py 1.11.0 pyhd3eb1b0_0 py-lief 0.11.5 py39he9d5cce_1 pycodestyle 2.7.0 pyhd3eb1b0_0 pycosat 0.6.3 py39h9ed2024_0 pycparser 2.21 pyhd3eb1b0_0 pycurl 7.44.1 py39hbcfaee0_1 pydocstyle 6.1.1 pyhd3eb1b0_0 pyepsg 0.4.0 pyhd3eb1b0_0 pyerfa 2.0.0 py39h9ed2024_0 pyflakes 2.3.1 pyhd3eb1b0_0 pygments 2.11.2 pyhd3eb1b0_0 pyjwt 2.1.0 py39hecd8cb5_0 pylint 2.9.6 py39hecd8cb5_1 pyls-spyder 0.4.0 pyhd3eb1b0_0 pyodbc 4.0.32 py39he9d5cce_1 pyopenssl 21.0.0 pyhd3eb1b0_1 pyparsing 3.0.4 pyhd3eb1b0_0 pyproj 3.3.1 py39hfe197cf_0 conda-forge pyqt 5.9.2 py39h23ab428_6 pyrsistent 0.18.0 py39hca72f7f_0 pyshp 2.1.3 pyhd3eb1b0_0 pysocks 1.7.1 py39hecd8cb5_0 pytables 3.6.1 py39h648f197_1 pytest 7.1.1 py39hecd8cb5_0 python 3.9.12 hdfd78df_0 python-dateutil 2.8.2 pyhd3eb1b0_0 python-fastjsonschema 2.15.1 pyhd3eb1b0_0 python-libarchive-c 2.9 pyhd3eb1b0_1 python-lsp-black 1.0.0 pyhd3eb1b0_0 python-lsp-jsonrpc 1.0.0 pyhd3eb1b0_0 python-lsp-server 1.2.4 pyhd3eb1b0_0 python-slugify 5.0.2 pyhd3eb1b0_0 python.app 3 py39hca72f7f_0 python_abi 3.9 2_cp39 conda-forge pytz 2021.3 pyhd3eb1b0_0 pywavelets 1.3.0 py39hca72f7f_0 pyyaml 6.0 py39hca72f7f_1 pyzmq 22.3.0 py39he9d5cce_2 qdarkstyle 3.0.2 pyhd3eb1b0_0 qstylizer 0.1.10 pyhd3eb1b0_0 qt 5.9.7 h468cd18_1 qtawesome 1.0.3 pyhd3eb1b0_0 qtconsole 5.3.0 pyhd3eb1b0_0 qtpy 2.0.1 pyhd3eb1b0_0 readline 8.1.2 hca72f7f_1 regex 2022.3.15 py39hca72f7f_0 requests 2.27.1 pyhd3eb1b0_0 ripgrep 12.1.1 0 rope 0.22.0 pyhd3eb1b0_0 rtree 0.9.7 py39hecd8cb5_1 ruamel_yaml 0.15.100 py39h9ed2024_0 scikit-image 0.19.2 py39hae1ba45_0 scikit-learn 1.0.2 py39hae1ba45_1 scikit-learn-intelex 2021.5.0 py39hecd8cb5_0 scipy 1.7.3 py39h8c7af03_0 seaborn 0.11.2 pyhd3eb1b0_0 send2trash 1.8.0 pyhd3eb1b0_1 setuptools 61.2.0 py39hecd8cb5_0 shapely 1.8.0 py39h4700a46_6 conda-forge simplegeneric 0.8.1 py39hecd8cb5_2 singledispatch 3.7.0 pyhd3eb1b0_1001 sip 4.19.13 py39h23ab428_0 six 1.16.0 pyhd3eb1b0_1 snappy 1.1.9 he9d5cce_0 sniffio 1.2.0 py39hecd8cb5_1 snowballstemmer 2.2.0 pyhd3eb1b0_0 sortedcollections 2.1.0 pyhd3eb1b0_0 sortedcontainers 2.4.0 pyhd3eb1b0_0 soupsieve 2.3.1 pyhd3eb1b0_0 sphinx 4.4.0 pyhd3eb1b0_0 sphinxcontrib 1.0 py39hecd8cb5_1 sphinxcontrib-applehelp 1.0.2 pyhd3eb1b0_0 sphinxcontrib-devhelp 1.0.2 pyhd3eb1b0_0 sphinxcontrib-htmlhelp 2.0.0 pyhd3eb1b0_0 sphinxcontrib-jsmath 1.0.1 pyhd3eb1b0_0 sphinxcontrib-qthelp 1.0.3 pyhd3eb1b0_0 sphinxcontrib-serializinghtml 1.1.5 pyhd3eb1b0_0 sphinxcontrib-websupport 1.2.4 py_0 spyder 5.1.5 py39hecd8cb5_1 spyder-kernels 2.1.3 py39hecd8cb5_0 sqlalchemy 1.4.32 py39hca72f7f_0 sqlite 3.38.2 h707629a_0 stack_data 0.2.0 pyhd3eb1b0_0 statsmodels 0.13.2 py39hca72f7f_0 sympy 1.10.1 py39hecd8cb5_0 tbb 2021.5.0 haf03e11_0 tbb4py 2021.5.0 py39haf03e11_0 tblib 1.7.0 pyhd3eb1b0_0 terminado 0.13.1 py39hecd8cb5_0 testpath 0.5.0 pyhd3eb1b0_0 text-unidecode 1.3 pyhd3eb1b0_0 textdistance 4.2.1 pyhd3eb1b0_0 threadpoolctl 2.2.0 pyh0d69192_0 three-merge 0.1.1 pyhd3eb1b0_0 tifffile 2021.7.2 pyhd3eb1b0_2 tinycss 0.4 pyhd3eb1b0_1002 tk 8.6.11 h7bc2e8c_0 toml 0.10.2 pyhd3eb1b0_0 tomli 1.2.2 pyhd3eb1b0_0 toolz 0.11.2 pyhd3eb1b0_0 tornado 6.1 py39h9ed2024_0 tqdm 4.64.0 py39hecd8cb5_0 traitlets 5.1.1 pyhd3eb1b0_0 typed-ast 1.4.3 py39h9ed2024_1 typing-extensions 4.1.1 hd3eb1b0_0 typing_extensions 4.1.1 pyh06a4308_0 tzdata 2022a hda174b7_0 ujson 5.1.0 py39he9d5cce_0 unicodecsv 0.14.1 py39hecd8cb5_0 unidecode 1.2.0 pyhd3eb1b0_0 unixodbc 2.3.9 haf1e3a3_0 urllib3 1.26.9 py39hecd8cb5_0 watchdog 2.1.6 py39h999c104_0 wcwidth 0.2.5 pyhd3eb1b0_0 webencodings 0.5.1 py39hecd8cb5_1 websocket-client 0.58.0 py39hecd8cb5_4 werkzeug 2.0.3 pyhd3eb1b0_0 wheel 0.37.1 pyhd3eb1b0_0 whichcraft 0.6.1 pyhd3eb1b0_0 widgetsnbextension 3.5.2 py39hecd8cb5_0 wrapt 1.12.1 py39h9ed2024_1 wurlitzer 3.0.2 py39hecd8cb5_0 xarray 0.20.1 pyhd3eb1b0_1 xlrd 2.0.1 pyhd3eb1b0_0 xlsxwriter 3.0.3 pyhd3eb1b0_0 xlwings 0.24.9 py39hecd8cb5_0 xlwt 1.3.0 py39hecd8cb5_0 xz 5.2.5 h1de35cc_0 yaml 0.2.5 haf1e3a3_0 yapf 0.31.0 pyhd3eb1b0_0 zeromq 4.3.4 h23ab428_0 zfp 0.5.5 he9d5cce_6 zict 2.0.0 pyhd3eb1b0_0 zipp 3.7.0 pyhd3eb1b0_0 zlib 1.2.11 h6c3fc93_1014 conda-forge zope 1.0 py39hecd8cb5_1 zope.event 4.5.0 py39hecd8cb5_0 zope.interface 5.4.0 py39h9ed2024_0 zstd 1.5.2 h582d3a0_0 conda-forge ```
dopplershift commented 2 years ago

This is coming from the __reduce__ method on CRS: https://github.com/SciTools/cartopy/blob/63fd1e3ce7bc146a0e1a5b120441dabd4d38651c/lib/cartopy/crs.py#L203-L211

which says you can create an empty instance with just the class and no args, which is not correct, technically it's not even correct for the CRS class, but it does work for the subclasses:

proj = ccrs.CRS(ccrs.PlateCarree().to_wkt())
pickle.dump(proj, open("test.pickle", "wb"))
proj = pickle.load(open("test.pickle", "rb"))

fails.

Not sure if the right solution is fix CRS.__reduce__ or add a new implementation to ccrs._epsg._EPSGProjection.