From 42de813048b82d6359d93244f19fb06006fe6e44 Mon Sep 17 00:00:00 2001 From: Paul Hobson Date: Fri, 25 Oct 2024 16:39:21 -0700 Subject: [PATCH] . --- pygridtools/tests/test_core.py | 5 ++++- pygridtools/tests/test_iotools.py | 5 ++++- pygridtools/tests/test_misc.py | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pygridtools/tests/test_core.py b/pygridtools/tests/test_core.py index 2fb157e..cebe940 100644 --- a/pygridtools/tests/test_core.py +++ b/pygridtools/tests/test_core.py @@ -665,7 +665,10 @@ def test_masks_no_polys(mg): def test_ModelGrid_to_point_geodataframe(g1): expectedfile = resource_filename('pygridtools.tests.baseline_files', 'mgshp_nomask_nodes_points.shp') - expected = geopandas.read_file(expectedfile) + expected = geopandas.read_file(expectedfile).assign( + ii=lambda df: df["ii"].astype("int64"), + jj=lambda df: df["jj"].astype("int64"), + ) result = g1.to_point_geodataframe(which='nodes', usemask=False) utils.assert_gdfs_equal(expected.drop(columns=['river', 'reach']), result) diff --git a/pygridtools/tests/test_iotools.py b/pygridtools/tests/test_iotools.py index 0c2e26a..7628340 100644 --- a/pygridtools/tests/test_iotools.py +++ b/pygridtools/tests/test_iotools.py @@ -76,7 +76,10 @@ def test_read_grid(): known_df = pandas.DataFrame( data={'easting': [1., 2., 3.] * 4, 'northing': sorted([4., 5., 6., 7.] * 3)}, index=pandas.MultiIndex.from_product([[2, 3, 4, 5], [2, 3, 4]], names=['jj', 'ii']) - ).assign(elev=0.0).assign(river='test').reset_index().set_index(['ii', 'jj']).sort_index() + ).assign(elev=0.0).assign(river='test').reset_index().set_index(['ii', 'jj']).sort_index().assign( + ii=lambda df: df["ii"].astype("int64"), + jj=lambda df: df["jj"].astype("int64"), + ) pdtest.assert_frame_equal(result_df, known_df) diff --git a/pygridtools/tests/test_misc.py b/pygridtools/tests/test_misc.py index 7481fbf..64ec6fb 100644 --- a/pygridtools/tests/test_misc.py +++ b/pygridtools/tests/test_misc.py @@ -407,7 +407,7 @@ def test_gdf_of_points(usemasks, fname, example_crs): y = numpy.ma.masked_array(y, mask) baselinedir = Path(resource_filename('pygridtools.tests', 'baseline_files')) - river = 'test' + expected = geopandas.read_file(str(baselinedir / fname)).assign( ii=lambda df: df["ii"].astype("int64"), jj=lambda df: df["jj"].astype("int64"),