Skip to content

Commit

Permalink
Minor formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasschaub committed Mar 24, 2022
1 parent 3ebdc9c commit 711f7b0
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 43 deletions.
2 changes: 1 addition & 1 deletion workers/ohsome_quality_analyst/api/request_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class BaseLayerName(BaseModel):
class BaseLayerData(BaseModel):
"""Model for the parameter `layer`.
The parameter contains layer name, description and data.
The Layer consists of name, description and data.
"""

layer: LayerData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ def __init__(
layer: Layer,
feature: geojson.Feature,
) -> None:
super().__init__(
layer=layer,
feature=feature,
)
super().__init__(layer=layer, feature=feature)
self.threshold_yellow = 0.6
self.threshold_red = 0.2
self.element_count = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,8 @@
class GhsPopComparisonBuildings(BaseIndicator):
"""Set number of features and population into perspective."""

def __init__(
self,
layer: Layer,
feature: Feature,
) -> None:
super().__init__(
layer=layer,
feature=feature,
)
def __init__(self, layer: Layer, feature: Feature) -> None:
super().__init__(layer=layer, feature=feature)
# Those attributes will be set during lifecycle of the object.
self.pop_count = None
self.area = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@
class GhsPopComparisonRoads(BaseIndicator):
"""Set number of features and population into perspective."""

def __init__(
self,
layer: Layer,
feature: Feature,
) -> None:
def __init__(self, layer: Layer, feature: Feature) -> None:
super().__init__(layer=layer, feature=feature)
# Those attributes will be set during lifecycle of the object.
self.pop_count = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,8 @@ def __init__(
feature: Feature,
time_range: str = "2008-01-01//P1M",
) -> None:
super().__init__(
layer=layer,
feature=feature,
)
super().__init__(layer=layer, feature=feature)

self.time_range: str = time_range

# The following attributes will be set during the life-cycle of the object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,8 @@


class PoiDensity(BaseIndicator):
def __init__(
self,
layer: Layer,
feature: Feature,
) -> None:
super().__init__(
layer=layer,
feature=feature,
)
def __init__(self, layer: Layer, feature: Feature) -> None:
super().__init__(layer=layer, feature=feature)
self.threshold_yellow = 30
self.threshold_red = 10
self.area_sqkm = None
Expand Down
12 changes: 2 additions & 10 deletions workers/ohsome_quality_analyst/indicators/tags_ratio/indicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,15 @@


class TagsRatio(BaseIndicator):
def __init__(
self,
layer: Layer,
feature: Feature,
) -> None:
super().__init__(
layer=layer,
feature=feature,
)
def __init__(self, layer: Layer, feature: Feature) -> None:
super().__init__(layer=layer, feature=feature)
self.threshold_yellow = 0.75
self.threshold_red = 0.25
self.ratio = None
self.count_all = None
self.count_match = None

async def preprocess(self) -> None:

query_results_count = await ohsome_client.query(
self.layer,
self.feature.geometry,
Expand Down
2 changes: 1 addition & 1 deletion workers/ohsome_quality_analyst/oqt.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ async def _create_indicator(
indicator = await create_indicator(
IndicatorBpolys(
name=name,
layerName=parameters.layer_name.value,
layerName=layer.name,
bpolys=feature,
)
)
Expand Down

0 comments on commit 711f7b0

Please sign in to comment.