Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_SharedWallsRatio(self):
self.df_buildings["swr"] = mm.SharedWallsRatio(self.df_buildings).series
self.df_buildings["swr_array"] = mm.SharedWallsRatio(
self.df_buildings, perimeters=self.df_buildings.geometry.length
).series
nonconsecutive = self.df_buildings.drop(2)
result = mm.SharedWallsRatio(nonconsecutive).series
check = 0.3424804411228673
assert self.df_buildings["swr"][10] == check
assert self.df_buildings["swr_array"][10] == check
assert result[10] == check
with pytest.warns(FutureWarning):
mm.SharedWallsRatio(self.df_buildings, "uID")
def test_SharedWallsRatio(self):
self.df_buildings["swr"] = mm.SharedWallsRatio(self.df_buildings).series
self.df_buildings["swr_array"] = mm.SharedWallsRatio(
self.df_buildings, perimeters=self.df_buildings.geometry.length
).series
nonconsecutive = self.df_buildings.drop(2)
result = mm.SharedWallsRatio(nonconsecutive).series
check = 0.3424804411228673
assert self.df_buildings["swr"][10] == check
assert self.df_buildings["swr_array"][10] == check
assert result[10] == check
with pytest.warns(FutureWarning):
mm.SharedWallsRatio(self.df_buildings, "uID")
def test_SharedWallsRatio(self):
self.df_buildings["swr"] = mm.SharedWallsRatio(self.df_buildings).series
self.df_buildings["swr_array"] = mm.SharedWallsRatio(
self.df_buildings, perimeters=self.df_buildings.geometry.length
).series
nonconsecutive = self.df_buildings.drop(2)
result = mm.SharedWallsRatio(nonconsecutive).series
check = 0.3424804411228673
assert self.df_buildings["swr"][10] == check
assert self.df_buildings["swr_array"][10] == check
assert result[10] == check
with pytest.warns(FutureWarning):
mm.SharedWallsRatio(self.df_buildings, "uID")
def test_SharedWallsRatio(self):
self.df_buildings["swr"] = mm.SharedWallsRatio(self.df_buildings).series
self.df_buildings["swr_array"] = mm.SharedWallsRatio(
self.df_buildings, perimeters=self.df_buildings.geometry.length
).series
nonconsecutive = self.df_buildings.drop(2)
result = mm.SharedWallsRatio(nonconsecutive).series
check = 0.3424804411228673
assert self.df_buildings["swr"][10] == check
assert self.df_buildings["swr_array"][10] == check
assert result[10] == check
with pytest.warns(FutureWarning):
mm.SharedWallsRatio(self.df_buildings, "uID")
def time_SharedWallsRatio(self):
mm.SharedWallsRatio(self.df_buildings)