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

MNT: Switch to (lon, lat) for all argument and return ordering #2453

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

greglucas
Copy link
Contributor

There are more usages of (lon, lat) currently and only a few private versions of (lat, lon) so it is easy enough to switch everything over to (lon, lat) for consistency. This matches what we are expecting from transform_point(x, y) as well.

There are more usages of (lon, lat) currently and only a few private
versions of (lat, lon) so it is easy enough to switch everything
over to (lon, lat) for consistency.
@@ -36,7 +36,7 @@ def test_osni(self, approx):
ll = ccrs.Geodetic()

# results obtained by nearby.org.uk.
lat, lon = np.array([54.5622169298669, -5.54159863617957],
lon, lat = np.array([-5.54159863617957, 54.5622169298669],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this even put through np.array in the first place if it's split immediately?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷 I was wondering the same thing, but really didn't want to go refactoring more than this PR title suggests.

Copy link
Contributor

@dopplershift dopplershift left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious what the failure cause is?

@greglucas
Copy link
Contributor Author

Curious what the failure cause is?

Looks like an issue with a corrupted shapefile download or something that Fiona is causing errors from which leads to a later error.

type = <class 'weakref.KeyedRef'>, ob = None
callback = <function WeakValueDictionary.__init__.<locals>.remove at 0x000001D0FE0E63E0>
key = <cartopy.mpl.feature_artist._GeomKey object at 0x000001D0FFA4D590>

    def __new__(type, ob, callback, key):
>       self = ref.__new__(type, ob, callback)
E       TypeError: cannot create weak reference to 'NoneType' object

C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\weakref.py:348: TypeError
------------------------------ Captured log call ------------------------------
ERROR    fiona._env:shapereader.py:217 Error in fread() reading object of size 248 at offset 332 from .shp file
ERROR    fiona._env:shapereader.py:217 Error in fread() reading object of size 1128 at offset 580 from .shp file
ERROR    fiona._env:shapereader.py:217 Error in fread() reading object of size 792 at offset [170](https://github.com/SciTools/cartopy/actions/runs/11298952884/job/31428955719?pr=2453#step:9:171)8 from .shp file
ERROR    fiona._env:shapereader.py:217 fread(27) failed on DBF file.

I reran the job as this seems like something intermittent and unrelated.

@greglucas greglucas merged commit 894ff37 into SciTools:main Oct 23, 2024
23 of 26 checks passed
@greglucas greglucas deleted the lon-lat-consistency branch October 23, 2024 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants