Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
left_unique_id="uID",
)
with pytest.raises(ValueError):
car = mm.AreaRatio(
self.df_tessellation,
self.df_buildings,
"area",
"area",
right_unique_id="uID",
)
car_sel = mm.AreaRatio(
self.df_tessellation.iloc[10:20], self.df_buildings, "area", "area", "uID"
).series
assert (car_sel.index == self.df_tessellation.iloc[10:20].index).all()
self.blocks["area"] = self.blocks.geometry.area
car_block = mm.AreaRatio(self.blocks, self.df_buildings, "area", "area", "bID")
assert car_block.series.mean() == 0.2761974319698012
check = 0.3206556897709747
assert car.mean() == check
assert carlr.mean() == check
far = mm.AreaRatio(
self.df_tessellation,
self.df_buildings,
self.df_tessellation.area,
self.df_buildings.fl_area,
"uID",
).series
check = 1.910949846262234
assert far.mean() == check
with pytest.raises(ValueError):
car = mm.AreaRatio(self.df_tessellation, self.df_buildings, "area", "area")
with pytest.raises(ValueError):
car = mm.AreaRatio(
self.df_tessellation,
self.df_buildings,
"area",
"area",
left_unique_id="uID",
)
with pytest.raises(ValueError):
car = mm.AreaRatio(
self.df_tessellation,
self.df_buildings,
"area",
"area",
right_unique_id="uID",
)
car_sel = mm.AreaRatio(
self.df_tessellation.iloc[10:20], self.df_buildings, "area", "area", "uID"
"uID",
).series
check = 1.910949846262234
assert far.mean() == check
with pytest.raises(ValueError):
car = mm.AreaRatio(self.df_tessellation, self.df_buildings, "area", "area")
with pytest.raises(ValueError):
car = mm.AreaRatio(
self.df_tessellation,
self.df_buildings,
"area",
"area",
left_unique_id="uID",
)
with pytest.raises(ValueError):
car = mm.AreaRatio(
self.df_tessellation,
self.df_buildings,
"area",
"area",
right_unique_id="uID",
)
car_sel = mm.AreaRatio(
self.df_tessellation.iloc[10:20], self.df_buildings, "area", "area", "uID"
).series
assert (car_sel.index == self.df_tessellation.iloc[10:20].index).all()
self.blocks["area"] = self.blocks.geometry.area
car_block = mm.AreaRatio(self.blocks, self.df_buildings, "area", "area", "bID")
assert car_block.series.mean() == 0.2761974319698012
def test_AreaRatio(self):
car = mm.AreaRatio(
self.df_tessellation, self.df_buildings, "area", "area", "uID"
).series
carlr = mm.AreaRatio(
self.df_tessellation,
self.df_buildings,
"area",
"area",
left_unique_id="uID",
right_unique_id="uID",
).series
check = 0.3206556897709747
assert car.mean() == check
assert carlr.mean() == check
far = mm.AreaRatio(
self.df_tessellation,
self.df_buildings,
def test_AreaRatio(self):
car = mm.AreaRatio(
self.df_tessellation, self.df_buildings, "area", "area", "uID"
).series
carlr = mm.AreaRatio(
self.df_tessellation,
self.df_buildings,
"area",
"area",
left_unique_id="uID",
right_unique_id="uID",
).series
check = 0.3206556897709747
assert car.mean() == check
assert carlr.mean() == check
far = mm.AreaRatio(
self.df_tessellation,
self.df_buildings,
self.df_tessellation.area,
self.df_buildings.fl_area,
"uID",
).series
check = 1.910949846262234
assert far.mean() == check
with pytest.raises(ValueError):
car = mm.AreaRatio(self.df_tessellation, self.df_buildings, "area", "area")
with pytest.raises(ValueError):
car = mm.AreaRatio(
self.df_tessellation,
self.df_buildings,
"area",
"area",
def test_AreaRatio(self):
car = mm.AreaRatio(
self.df_tessellation, self.df_buildings, "area", "area", "uID"
).series
carlr = mm.AreaRatio(
self.df_tessellation,
self.df_buildings,
"area",
"area",
left_unique_id="uID",
right_unique_id="uID",
).series
check = 0.3206556897709747
assert car.mean() == check
assert carlr.mean() == check
far = mm.AreaRatio(
self.df_tessellation,
self.df_buildings,
self.df_tessellation.area,
self.df_buildings.fl_area,
"uID",
car = mm.AreaRatio(
self.df_tessellation,
self.df_buildings,
"area",
"area",
left_unique_id="uID",
)
with pytest.raises(ValueError):
car = mm.AreaRatio(
self.df_tessellation,
self.df_buildings,
"area",
"area",
right_unique_id="uID",
)
car_sel = mm.AreaRatio(
self.df_tessellation.iloc[10:20], self.df_buildings, "area", "area", "uID"
).series
assert (car_sel.index == self.df_tessellation.iloc[10:20].index).all()
self.blocks["area"] = self.blocks.geometry.area
car_block = mm.AreaRatio(self.blocks, self.df_buildings, "area", "area", "bID")
assert car_block.series.mean() == 0.2761974319698012
right_unique_id="uID",
).series
check = 0.3206556897709747
assert car.mean() == check
assert carlr.mean() == check
far = mm.AreaRatio(
self.df_tessellation,
self.df_buildings,
self.df_tessellation.area,
self.df_buildings.fl_area,
"uID",
).series
check = 1.910949846262234
assert far.mean() == check
with pytest.raises(ValueError):
car = mm.AreaRatio(self.df_tessellation, self.df_buildings, "area", "area")
with pytest.raises(ValueError):
car = mm.AreaRatio(
self.df_tessellation,
self.df_buildings,
"area",
"area",
left_unique_id="uID",
)
with pytest.raises(ValueError):
car = mm.AreaRatio(
self.df_tessellation,
self.df_buildings,
"area",
"area",
right_unique_id="uID",
)