Ejemplo n.º 1
0
 def test_Courtyards(self):
     courtyards = mm.Courtyards(self.df_buildings, "bID").series
     sw = Queen.from_dataframe(self.df_buildings)
     courtyards_wm = mm.Courtyards(self.df_buildings, self.df_buildings.bID,
                                   sw).series
     check = 0.6805555555555556
     assert courtyards.mean() == check
     assert courtyards_wm.mean() == check
Ejemplo n.º 2
0
 def time_Courtyards(self):
     mm.Courtyards(self.df_buildings, "bID", self.swb)
streets["misRea"] = mm.Reached(streets,
                               tess,
                               "nID",
                               "nID",
                               spatial_weights=str_q1,
                               mode="count").series
streets["mdsAre"] = mm.Reached(streets,
                               tess,
                               "nID",
                               "nID",
                               spatial_weights=str_q1,
                               mode="sum").series

blg_q1 = libpysal.weights.contiguity.Queen.from_dataframe(blg)

blg["libNCo"] = mm.Courtyards(blg, "bID", blg_q1).series
blg["ldbPWL"] = mm.PerimeterWall(blg, blg_q1).series

blocks["ldkAre"] = mm.Area(blocks).series
blocks["ldkPer"] = mm.Perimeter(blocks).series
blocks["lskCCo"] = mm.CircularCompactness(blocks, "ldkAre").series
blocks["lskERI"] = mm.EquivalentRectangularIndex(blocks, "ldkAre",
                                                 "ldkPer").series
blocks["lskCWA"] = mm.CompactnessWeightedAxis(blocks, "ldkAre",
                                              "ldkPer").series
blocks["ltkOri"] = mm.Orientation(blocks).series

blo_q1 = libpysal.weights.contiguity.Queen.from_dataframe(blocks, ids="bID")

blocks["ltkWNB"] = mm.Neighbors(blocks, blo_q1, "bID", weighted=True).series
blocks["likWBB"] = mm.Count(blocks, blg, "bID", "bID", weighted=True).series