Skip to content

Commit c796673

Browse files
committed
test order
1 parent f334af6 commit c796673

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

libpysal/weights/tests/test_contiguity.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,16 @@ def test_from_geodataframe(self):
123123
w = self.cls.from_dataframe(df, geom_col="the_geom", ids=self.idVariable)
124124
self.assertEqual(w[self.known_name], self.known_namedw)
125125

126+
@ut.skipIf(GEOPANDAS_EXTINCT, "Missing geopandas")
127+
def test_from_geodataframe_order(self):
128+
import geopandas
129+
130+
south = geopandas.read_file(pysal_examples.get_path("south.shp"))
131+
expected = south.FIPS.iloc[:5].tolist()
132+
for ids_ in ("FIPS", south.FIPS):
133+
w = self.cls.from_dataframe(south, ids=ids_)
134+
self.assertEqual(w.id_order[:5], expected)
135+
126136
def test_from_xarray(self):
127137
w = self.cls.from_xarray(self.da, sparse=False, n_jobs=-1)
128138
self.assertEqual(w[self.known_wi_da], self.known_w_da)

0 commit comments

Comments
 (0)