Skip to content
Snippets Groups Projects

Revised ResourcePrice class and methods. Added tests for problem...

15 files
+ 398
417
Compare changes
  • Side-by-side
  • Inline

Files

+ 38
38
#******************************************************************************
#******************************************************************************
# *****************************************************************************
# *****************************************************************************
# standard
@@ -13,8 +13,8 @@ from geopandas import GeoDataFrame, GeoSeries
from pandas import DataFrame, merge
from shapely.geometry import Point
#******************************************************************************
#******************************************************************************
# *****************************************************************************
# *****************************************************************************
# URLs
@@ -34,8 +34,8 @@ url_prefix_buildings = 'https://api.dataforsyningen.dk/bbrlight/bygninger/'
url_prefix_building_point = 'https://api.dataforsyningen.dk/bbrlight/bygningspunkter/'
#******************************************************************************
#******************************************************************************
# *****************************************************************************
# *****************************************************************************
# labels
@@ -228,8 +228,8 @@ BBR_CONTAINER_LABELS = {
'koordinater': list,
}
#******************************************************************************
#******************************************************************************
# *****************************************************************************
# *****************************************************************************
# BBR codes
@@ -511,8 +511,8 @@ list_labels_bbr = [
label_bbr_extra_heating
]
#******************************************************************************
#******************************************************************************
# *****************************************************************************
# *****************************************************************************
def get_bbr_building_data_geodataframe(
building_entrance_ids: list,
@@ -521,8 +521,8 @@ def get_bbr_building_data_geodataframe(
selected_bbr_building_point_labels: list = SELECT_BBR_BDG_POINT_LABELS
) -> Tuple[GeoDataFrame,list]:
#**************************************************************************
#**************************************************************************
# *************************************************************************
# *************************************************************************
# get data about building entrances
@@ -548,8 +548,8 @@ def get_bbr_building_data_geodataframe(
index=dict_building_entrances.keys()
)
#**************************************************************************
#**************************************************************************
# *************************************************************************
# *************************************************************************
# get data about buildings
@@ -577,8 +577,8 @@ def get_bbr_building_data_geodataframe(
index=dict_buildings.keys()
)
#**************************************************************************
#**************************************************************************
# *************************************************************************
# *************************************************************************
# get building point data
@@ -626,8 +626,8 @@ def get_bbr_building_data_geodataframe(
left_index=True,
suffixes=(None,"_y")) # adds "_y" to duplicate columns
#**************************************************************************
#**************************************************************************
# *************************************************************************
# *************************************************************************
# create a geodataframe whose geometry is that of building points
@@ -671,17 +671,17 @@ def get_bbr_building_data_geodataframe(
return gdf_buildings, list_failures
#**************************************************************************
#**************************************************************************
# *************************************************************************
# *************************************************************************
#******************************************************************************
#******************************************************************************
# *****************************************************************************
# *****************************************************************************
def fetch_building_entrance_data(building_entrance_ids: list) -> Tuple[dict,
list]:
#**************************************************************************
#**************************************************************************
# *************************************************************************
# *************************************************************************
# retrieve data about each node identified through OSM
@@ -733,21 +733,21 @@ def fetch_building_entrance_data(building_entrance_ids: list) -> Tuple[dict,
response.close()
#**************************************************************************
#**************************************************************************
# *************************************************************************
# *************************************************************************
return dict_building_entrances, list_failures
#**************************************************************************
#**************************************************************************
# *************************************************************************
# *************************************************************************
#******************************************************************************
#******************************************************************************
# *****************************************************************************
# *****************************************************************************
def fetch_building_data(building_codes: list):
#**************************************************************************
#**************************************************************************
# *************************************************************************
# *************************************************************************
# get data about each specific building
@@ -781,13 +781,13 @@ def fetch_building_data(building_codes: list):
response.close()
#**************************************************************************
#**************************************************************************
# *************************************************************************
# *************************************************************************
return dict_buildings
#**************************************************************************
#**************************************************************************
# *************************************************************************
# *************************************************************************
#******************************************************************************
#******************************************************************************
\ No newline at end of file
# *****************************************************************************
# *****************************************************************************
\ No newline at end of file
Loading