diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 1d66af844fa..57d21b375ed 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -65,3 +65,10 @@ jobs: run: | set -o pipefail codespell | reviewdog -efm='%f:%l: %m' -name=codespell -reporter=github-check -filter-mode=nofilter + + - name: Check static data registry + # Don't skip if any other steps fail + if: always() + run: | + python -c "import pooch; pooch.make_registry('staticdata', 'src/metpy/static-data-manifest.txt')" + git diff --exit-code diff --git a/ci/linting_requirements.txt b/ci/linting_requirements.txt index fa04e7dedb8..c0789203b1e 100644 --- a/ci/linting_requirements.txt +++ b/ci/linting_requirements.txt @@ -16,3 +16,5 @@ doc8==1.1.1 restructuredtext_lint==1.4.0 codespell==2.2.6 + +pooch==1.8.0 \ No newline at end of file diff --git a/src/metpy/plots/cartopy_utils.py b/src/metpy/plots/cartopy_utils.py index f74ab886378..f9a5b23bd84 100644 --- a/src/metpy/plots/cartopy_utils.py +++ b/src/metpy/plots/cartopy_utils.py @@ -14,7 +14,7 @@ class MetPyMapFeature(Feature): def __init__(self, name, scale, **kwargs): """Create MetPyMapFeature instance.""" import cartopy.crs as ccrs - super().__init__(ccrs.PlateCarree(), **kwargs) + super().__init__(ccrs.PlateCarree(globe=ccrs.Globe('NAD83')), **kwargs) self.name = name if isinstance(scale, str): @@ -27,7 +27,7 @@ def geometries(self): # Ensure that the associated files are in the cache fname = f'{self.name}_{self.scaler.scale}' - for extension in ['.dbf', '.shx']: + for extension in ['.cpg', '.dbf', '.prj', '.shx']: get_test_data(fname + extension, as_file_obj=False) path = get_test_data(fname + '.shp', as_file_obj=False) return iter(tuple(shapereader.Reader(path).geometries())) diff --git a/src/metpy/static-data-manifest.txt b/src/metpy/static-data-manifest.txt index a97808d34c1..dafa9ea2bd6 100644 --- a/src/metpy/static-data-manifest.txt +++ b/src/metpy/static-data-manifest.txt @@ -222,22 +222,34 @@ station_data.txt 3c1b71abb95ef8fe4adf57e47e2ce67f3529c6fe025b546dd40c862999fc5ff stations.txt 22b52d8f10c236ef5b2d25c4b6f67e2a3ed9798a0c2e16ceb2031ea377d72945 timeseries.csv 2d79f8f21ad1fcec12d0e24750d0958631e92c9148adfbd1b7dc8defe8c56fc5 us_cities.zip fe08a30a5d65a84365e083549718dff223f22f84812e2eec90c0d00df856df82 -us_counties_20m.dbf b5eeaa4769f25324d52933a6067e9a90315a77fefcdbefd0c7d99e94fd0cbb41 -us_counties_20m.shp 8acb8bfbcf670028f7ce6c1c11ae08b21844b1c882c26ef397df33231831dee9 -us_counties_20m.shx 131ccb63c365415c81c4fcd686b2bcbb9166e3a3d1fe97c1a5fc28344036a4ae -us_counties_500k.dbf 8cb3e42c3d951cf5b15e395bee61eb1ad50c0470bd0937e7288526605bf1ab85 -us_counties_500k.shp 06463cf329d6f412d7f3323748225aca1ca495a8c04af58cfaf169fc3a8c8df4 -us_counties_500k.shx aa301ee507e17bcd84a0792648eaea17a5efd7b274d14689a285603c0a61a8ba -us_counties_5m.dbf f7e5b7cb1da1a306652b4ca94212a91b4e08006691366ede1bca57c1b31018a4 -us_counties_5m.shp be255ca37625e5feef7808ef996e803c6412ee67e52c29ee0b603b569eba083c -us_counties_5m.shx 7412c519095b9d2c3d3bf0e681f784f2b44fb4b4b6ce58d5b60fcd740dab2895 -us_states_20m.dbf f0bdd4b4e28f874a725041bc141991773f503d04372a3b03cc0b6a37426bbc50 -us_states_20m.shp 9e3a98552c6ab4d7d2039acfaaf5953c7d55c45f60aa78cf4800107517c28e65 -us_states_20m.shx 6c3a86e50b460dcb81556fd3480700051afd3c88c159dee2aae2b59c3fd84e09 -us_states_500k.dbf 13d63f8ab31963d93982a559ad7539bffc7fe08787326bea6d9b2eb7cfdfb64c -us_states_500k.shp 206d5f423c430b33d607f4efde8c63dfe4a93fda98b53011cf3077a1b6a6dc85 -us_states_500k.shx 815827b21eda32c062e5f641d52b66dfcc68bb9dc97b86bf008f34bd8735e08f -us_states_5m.dbf b3d04bbea008b33a5e7e8e14b1b8cc19bdd7c06754ddabb1e2f73c2ca0d79288 -us_states_5m.shp 62e8684263aa8c7dd8c69a467dd0ed54f3a882a89487e8e5d430063ae925f68f -us_states_5m.shx c0f853272c7b9902073242de57a8d2ba7a446904da0d9e7cc98b538cc20a59d6 +us_counties_20m.cpg 3ad3031f5503a4404af825262ee8232cc04d4ea6683d42c5dd0a2f2a27ac9824 +us_counties_20m.dbf d75f7b87f5bd384c95236caa1525d0704d3232e85a7ac55992370083d0509f0b +us_counties_20m.prj 0b9041e921d9ebb43247d314608fe9e38a0b008ee793067fc1806199ea1fb9dd +us_counties_20m.shp c95f3659d205787a6eeca270642255941a11b19b5d604a91d42304a7ad47108a +us_counties_20m.shx 8b83a347a417fedaac4b46ada2205918279297639f434dfea245712f90e5d7c7 +us_counties_500k.cpg 3ad3031f5503a4404af825262ee8232cc04d4ea6683d42c5dd0a2f2a27ac9824 +us_counties_500k.dbf 465be482a7bbf16070e0af6b087dbd2edc332182a34725581a63b7160e8d6d3e +us_counties_500k.prj 0b9041e921d9ebb43247d314608fe9e38a0b008ee793067fc1806199ea1fb9dd +us_counties_500k.shp eda039434f2e64f4ee5324b36c5fe5216e8911f489767a8fc17dc4875742c924 +us_counties_500k.shx 5ef30b33c6080876c166cdd6f730fcc5522bafb69f1c2bf4e567cf74435d450d +us_counties_5m.cpg 3ad3031f5503a4404af825262ee8232cc04d4ea6683d42c5dd0a2f2a27ac9824 +us_counties_5m.dbf aaa4b176083097a67b1fa25ecc03a4279acf6ab44720e79248c0eeff0f74e64a +us_counties_5m.prj 0b9041e921d9ebb43247d314608fe9e38a0b008ee793067fc1806199ea1fb9dd +us_counties_5m.shp 74ab399b8fdebf77d31a80bf6fedf1ef3ee55d5e5cdc912b6330b48521dc7fe4 +us_counties_5m.shx 27fb6114207766baab256e70d1830bcfe9668048b84c9407d8d55f4096e16daa +us_states_20m.cpg 3ad3031f5503a4404af825262ee8232cc04d4ea6683d42c5dd0a2f2a27ac9824 +us_states_20m.dbf 04e3caf5dfc140ee152bb7fc52ba2ce41c9f5f4c80078a1060a1edb1c5d779a0 +us_states_20m.prj 0b9041e921d9ebb43247d314608fe9e38a0b008ee793067fc1806199ea1fb9dd +us_states_20m.shp 8f9a030ff97a5ecce6c7c98fd43dd3e7ffe15ed61a43d6e5981a13990f0b8232 +us_states_20m.shx b9ecf37f30dbd1b35ad11dae9d1807487cddea94276cf388064c09680f94c12c +us_states_500k.cpg 3ad3031f5503a4404af825262ee8232cc04d4ea6683d42c5dd0a2f2a27ac9824 +us_states_500k.dbf 47b3d04db6c0408851b4c75d2635e9d06764fa18fc9cd9d6be54755334a0df35 +us_states_500k.prj 0b9041e921d9ebb43247d314608fe9e38a0b008ee793067fc1806199ea1fb9dd +us_states_500k.shp 438b67af3be55c210f70789a0ba4eb8ac2518ee4424f633590ead19d1f962c3e +us_states_500k.shx 58cded58f24356e50135efe7f44b69b17ae5492b8a644fdd34292c2a16b46851 +us_states_5m.cpg 3ad3031f5503a4404af825262ee8232cc04d4ea6683d42c5dd0a2f2a27ac9824 +us_states_5m.dbf 6a7710e15b095ecb0d3214f3778c2d2383329377d199387857fa0525953730f8 +us_states_5m.prj 0b9041e921d9ebb43247d314608fe9e38a0b008ee793067fc1806199ea1fb9dd +us_states_5m.shp e175a60ccb482e01f8d2633d1c38acba5e2b06065d02dd34f7f94d00bbe345fb +us_states_5m.shx c8c81c45086d0169e4e84ad059268a2220e18c61d1543f8cb923e2512ab7cb11 wrf_example.nc dcc1444db327507730334fd94dcb223025f77791448dd394f3ba06391ddbf98f diff --git a/staticdata/us_counties_20m.cpg b/staticdata/us_counties_20m.cpg new file mode 100644 index 00000000000..3ad133c048f --- /dev/null +++ b/staticdata/us_counties_20m.cpg @@ -0,0 +1 @@ +UTF-8 \ No newline at end of file diff --git a/staticdata/us_counties_20m.dbf b/staticdata/us_counties_20m.dbf index c4a215afc37..71b8d1937f9 100644 Binary files a/staticdata/us_counties_20m.dbf and b/staticdata/us_counties_20m.dbf differ diff --git a/staticdata/us_counties_20m.prj b/staticdata/us_counties_20m.prj new file mode 100644 index 00000000000..747df588c20 --- /dev/null +++ b/staticdata/us_counties_20m.prj @@ -0,0 +1 @@ +GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]] \ No newline at end of file diff --git a/staticdata/us_counties_20m.shp b/staticdata/us_counties_20m.shp index e29fb45651f..bcbd7395b1e 100644 Binary files a/staticdata/us_counties_20m.shp and b/staticdata/us_counties_20m.shp differ diff --git a/staticdata/us_counties_20m.shx b/staticdata/us_counties_20m.shx index a081174d84d..588dbb84a88 100644 Binary files a/staticdata/us_counties_20m.shx and b/staticdata/us_counties_20m.shx differ diff --git a/staticdata/us_counties_500k.cpg b/staticdata/us_counties_500k.cpg new file mode 100644 index 00000000000..3ad133c048f --- /dev/null +++ b/staticdata/us_counties_500k.cpg @@ -0,0 +1 @@ +UTF-8 \ No newline at end of file diff --git a/staticdata/us_counties_500k.dbf b/staticdata/us_counties_500k.dbf index 2e110609057..500597bc022 100644 Binary files a/staticdata/us_counties_500k.dbf and b/staticdata/us_counties_500k.dbf differ diff --git a/staticdata/us_counties_500k.prj b/staticdata/us_counties_500k.prj new file mode 100644 index 00000000000..747df588c20 --- /dev/null +++ b/staticdata/us_counties_500k.prj @@ -0,0 +1 @@ +GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]] \ No newline at end of file diff --git a/staticdata/us_counties_500k.shp b/staticdata/us_counties_500k.shp index 45b3f041f32..ff2abcc56ac 100644 Binary files a/staticdata/us_counties_500k.shp and b/staticdata/us_counties_500k.shp differ diff --git a/staticdata/us_counties_500k.shx b/staticdata/us_counties_500k.shx index 715e770c755..7f36f9b16c9 100644 Binary files a/staticdata/us_counties_500k.shx and b/staticdata/us_counties_500k.shx differ diff --git a/staticdata/us_counties_5m.cpg b/staticdata/us_counties_5m.cpg new file mode 100644 index 00000000000..3ad133c048f --- /dev/null +++ b/staticdata/us_counties_5m.cpg @@ -0,0 +1 @@ +UTF-8 \ No newline at end of file diff --git a/staticdata/us_counties_5m.dbf b/staticdata/us_counties_5m.dbf index 892ae266dcb..78d43a15238 100644 Binary files a/staticdata/us_counties_5m.dbf and b/staticdata/us_counties_5m.dbf differ diff --git a/staticdata/us_counties_5m.prj b/staticdata/us_counties_5m.prj new file mode 100644 index 00000000000..747df588c20 --- /dev/null +++ b/staticdata/us_counties_5m.prj @@ -0,0 +1 @@ +GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]] \ No newline at end of file diff --git a/staticdata/us_counties_5m.shp b/staticdata/us_counties_5m.shp index dfb7cec6999..12bb7be62ef 100644 Binary files a/staticdata/us_counties_5m.shp and b/staticdata/us_counties_5m.shp differ diff --git a/staticdata/us_counties_5m.shx b/staticdata/us_counties_5m.shx index 09901ab8855..9073e6d090b 100644 Binary files a/staticdata/us_counties_5m.shx and b/staticdata/us_counties_5m.shx differ diff --git a/staticdata/us_states_20m.cpg b/staticdata/us_states_20m.cpg new file mode 100644 index 00000000000..3ad133c048f --- /dev/null +++ b/staticdata/us_states_20m.cpg @@ -0,0 +1 @@ +UTF-8 \ No newline at end of file diff --git a/staticdata/us_states_20m.dbf b/staticdata/us_states_20m.dbf index 1f75020d9a7..2aa34103f22 100644 Binary files a/staticdata/us_states_20m.dbf and b/staticdata/us_states_20m.dbf differ diff --git a/staticdata/us_states_20m.prj b/staticdata/us_states_20m.prj new file mode 100644 index 00000000000..747df588c20 --- /dev/null +++ b/staticdata/us_states_20m.prj @@ -0,0 +1 @@ +GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]] \ No newline at end of file diff --git a/staticdata/us_states_20m.shp b/staticdata/us_states_20m.shp index 43fbab71880..28473da9b71 100644 Binary files a/staticdata/us_states_20m.shp and b/staticdata/us_states_20m.shp differ diff --git a/staticdata/us_states_20m.shx b/staticdata/us_states_20m.shx index d0da44f3f8a..d2f2a397b1d 100644 Binary files a/staticdata/us_states_20m.shx and b/staticdata/us_states_20m.shx differ diff --git a/staticdata/us_states_500k.cpg b/staticdata/us_states_500k.cpg new file mode 100644 index 00000000000..3ad133c048f --- /dev/null +++ b/staticdata/us_states_500k.cpg @@ -0,0 +1 @@ +UTF-8 \ No newline at end of file diff --git a/staticdata/us_states_500k.dbf b/staticdata/us_states_500k.dbf index ad5c7db4983..747252f3a0c 100644 Binary files a/staticdata/us_states_500k.dbf and b/staticdata/us_states_500k.dbf differ diff --git a/staticdata/us_states_500k.prj b/staticdata/us_states_500k.prj new file mode 100644 index 00000000000..747df588c20 --- /dev/null +++ b/staticdata/us_states_500k.prj @@ -0,0 +1 @@ +GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]] \ No newline at end of file diff --git a/staticdata/us_states_500k.shp b/staticdata/us_states_500k.shp index 34f0f575ef3..cb8344640fc 100644 Binary files a/staticdata/us_states_500k.shp and b/staticdata/us_states_500k.shp differ diff --git a/staticdata/us_states_500k.shx b/staticdata/us_states_500k.shx index 33b1e4f6884..02cc7b3463a 100644 Binary files a/staticdata/us_states_500k.shx and b/staticdata/us_states_500k.shx differ diff --git a/staticdata/us_states_5m.cpg b/staticdata/us_states_5m.cpg new file mode 100644 index 00000000000..3ad133c048f --- /dev/null +++ b/staticdata/us_states_5m.cpg @@ -0,0 +1 @@ +UTF-8 \ No newline at end of file diff --git a/staticdata/us_states_5m.dbf b/staticdata/us_states_5m.dbf index 84b2290c99f..68b2ad75524 100644 Binary files a/staticdata/us_states_5m.dbf and b/staticdata/us_states_5m.dbf differ diff --git a/staticdata/us_states_5m.prj b/staticdata/us_states_5m.prj new file mode 100644 index 00000000000..747df588c20 --- /dev/null +++ b/staticdata/us_states_5m.prj @@ -0,0 +1 @@ +GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]] \ No newline at end of file diff --git a/staticdata/us_states_5m.shp b/staticdata/us_states_5m.shp index 69429c09fb4..909a7098be1 100644 Binary files a/staticdata/us_states_5m.shp and b/staticdata/us_states_5m.shp differ diff --git a/staticdata/us_states_5m.shx b/staticdata/us_states_5m.shx index 92205f9d48a..3142218c2f0 100644 Binary files a/staticdata/us_states_5m.shx and b/staticdata/us_states_5m.shx differ diff --git a/tests/plots/baseline/test_declarative_additional_layers_plot_options.png b/tests/plots/baseline/test_declarative_additional_layers_plot_options.png index 4dcafcafb9e..5f6deadf56e 100644 Binary files a/tests/plots/baseline/test_declarative_additional_layers_plot_options.png and b/tests/plots/baseline/test_declarative_additional_layers_plot_options.png differ diff --git a/tests/plots/baseline/test_us_county_defaults.png b/tests/plots/baseline/test_us_county_defaults.png index 40ffe2ed536..5dccf118ba1 100644 Binary files a/tests/plots/baseline/test_us_county_defaults.png and b/tests/plots/baseline/test_us_county_defaults.png differ diff --git a/tests/plots/baseline/test_us_county_scales.png b/tests/plots/baseline/test_us_county_scales.png index b7e0175d81b..d55a45d2231 100644 Binary files a/tests/plots/baseline/test_us_county_scales.png and b/tests/plots/baseline/test_us_county_scales.png differ diff --git a/tests/plots/baseline/test_us_states_scales.png b/tests/plots/baseline/test_us_states_scales.png index 199e6bbb541..5f12b9dd360 100644 Binary files a/tests/plots/baseline/test_us_states_scales.png and b/tests/plots/baseline/test_us_states_scales.png differ diff --git a/tests/plots/test_declarative.py b/tests/plots/test_declarative.py index bacee611cdf..e075215d0d6 100644 --- a/tests/plots/test_declarative.py +++ b/tests/plots/test_declarative.py @@ -91,7 +91,7 @@ def test_declarative_four_dims_error(): pc.draw() -@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.093) +@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.096) @needs_cartopy def test_declarative_contour(): """Test making a contour plot.""" @@ -150,7 +150,7 @@ def test_declarative_titles(): return pc.figure -@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.098) +@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.101) @needs_cartopy def test_declarative_smooth_contour(): """Test making a contour plot using smooth_contour.""" @@ -179,7 +179,7 @@ def test_declarative_smooth_contour(): return pc.figure -@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.12) +@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.121) @needs_cartopy def test_declarative_smooth_contour_calculation(): """Test making a contour plot using smooth_contour.""" @@ -221,7 +221,7 @@ def test_declarative_smooth_contour_calculation(): return pc.figure -@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.021) +@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.034) @needs_cartopy def test_declarative_smooth_contour_order(): """Test making a contour plot using smooth_contour with tuple.""" @@ -250,7 +250,7 @@ def test_declarative_smooth_contour_order(): return pc.figure -@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.059) +@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.063) @needs_cartopy def test_declarative_figsize(): """Test having an all float figsize.""" @@ -278,7 +278,7 @@ def test_declarative_figsize(): return pc.figure -@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.032) +@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.039) @needs_cartopy def test_declarative_smooth_field(): """Test the smoothing of the field with smooth_field trait.""" @@ -366,7 +366,7 @@ def test_declarative_contour_options(): return pc.figure -@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.082) +@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.085) @needs_cartopy def test_declarative_layers_plot_options(): """Test declarative layer options of edgecolor and linewidth.""" @@ -835,7 +835,7 @@ def test_latlon(): return pc.figure -@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.342) +@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.343) @needs_cartopy def test_declarative_barb_options(): """Test making a contour plot.""" @@ -1035,7 +1035,7 @@ def test_declarative_overlay_projections(): return pc.figure -@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.026) +@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.047) @needs_cartopy def test_declarative_gridded_scale(): """Test making a contour plot.""" @@ -1936,7 +1936,7 @@ def test_declarative_region_modifier_zoom_in(): return pc.figure -@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.332) +@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.338) @needs_cartopy def test_declarative_region_modifier_zoom_out(): """Test that '-' suffix on area string properly expands extent of map."""