8000 Add tests for Issue #493: PDF output with linewidth=0 by Cdiaz1234 · Pull Request #626 · matplotlib/basemap · GitHub
[go: up one dir, main page]

Skip to content

Add tests for Issue #493: PDF output with linewidth=0 #626

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

Open
wants to merge 17 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add test to validate longitude rounding and data integrity in shiftda…
…ta()
  • Loading branch information
Cdiaz1234 committed Apr 10, 2025
commit 2873ee6681e23ec80a040f19aa7b27a03a26ff1a
15 changes: 15 additions & 0 deletions tests/test_shiftdata_rounding.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import numpy as np
from mpl_toolkits.basemap import Basemap

def test_shiftdata_rounding():
m = Basemap(projection='cyl', llcrnrlon=-180, urcrnrlon=180,
llcrnrlat=-90, urcrnrlat=90, lon_0=0)

lonsin = np.array([104.123456789, -75.987654321])
datain = np.array([1.0, 2.0])

lonsout, dataout = m.shiftdata(lonsin, datain)

expected_lons = np.round(lonsin, 6)
np.testing.assert_allclose(np.sort(lonsout), np.sort(expected_lons), rtol=1e-8, atol=1e-8)
assert np.array_equal(np.sort(dataout), np.sort(datain))
0