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

REF: Multithread safe CRS #793

Merged
merged 1 commit into from
Mar 7, 2021
Merged

REF: Multithread safe CRS #793

merged 1 commit into from
Mar 7, 2021

Conversation

snowman2
Copy link
Member

@snowman2 snowman2 commented Mar 6, 2021

@codecov
Copy link

codecov bot commented Mar 6, 2021

Codecov Report

Merging #793 (13983f0) into master (6412a04) will increase coverage by 0.28%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #793      +/-   ##
==========================================
+ Coverage   94.69%   94.98%   +0.28%     
==========================================
  Files          21       21              
  Lines        1528     1595      +67     
==========================================
+ Hits         1447     1515      +68     
+ Misses         81       80       -1     
Impacted Files Coverage Δ
pyproj/transformer.py 95.36% <ø> (ø)
pyproj/crs/crs.py 97.44% <100.00%> (+0.74%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6412a04...c945258. Read the comment docs.

@jorisvandenbossche
Copy link
Contributor

Cool! Will try to give this a go tomorrow

@jorisvandenbossche
Copy link
Contributor

This looks good!

As mentioned in geopandas/dask-geopandas#36, locally this fixed the decoding errors we see with dask-geopandas.

Maybe one suggestion: if you want to limit the duplication of the docstrings (because now all the attributes/methods that needed to be added to dispatch to self._crs have a copy of the docstring), I think it should be relatively easy to use a decorator that automatically adds the docstring of the cython class.

Something like

def inherit_doc():
    """
    A decorator adding the docstring from the equivalent `_CRS` method.
    """

    def decorator(decorated):
        original_method = getattr(_CRS, decorated.__name__, None)
        if original_method:
            doc = original_method.__doc__ or ""
        else:
            doc = ""

        decorated.__doc__ = doc
        return decorated

    return decorator

@snowman2 snowman2 mentioned this pull request Mar 7, 2021
@snowman2
Copy link
Member Author

snowman2 commented Mar 7, 2021

Thanks for testing! I am going to merge now and deal with the docstring later. It is something that I agree should be looked into.

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.

2 participants