Skip to content

Commit

Permalink
SkiAreaSubsetPlot: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dhimmel committed Jan 11, 2025
1 parent 4c929c7 commit 5a2f777
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 15 deletions.
30 changes: 17 additions & 13 deletions openskistats/plot_ski_areas.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from openskistats.analyze import load_ski_areas_pl
from openskistats.plot import subplot_orientations
from openskistats.utils import gini_coefficient
from openskistats.utils import gini_coefficient, running_in_test


def get_ski_area_metric_ecdfs(
Expand Down Expand Up @@ -110,22 +110,26 @@ def plot_ski_area_metric_ecdfs(


class SkiAreaSubsetPlot:
select_ski_area_names = [
"Les Trois Vallées", # biggest
"Dartmouth Skiway", # bimodal
"Killington Resort", # eastfacing
"Mt. Bachelor", # difficulty by orientation
"Olos Ski Resort", # darkest resort in the world
"Etna Sud/Nicolosi", # sunniest
"Jackson Hole", # southfacing
"Narvik", # northernmost ski resort, https://www.openstreetmap.org/relation/12567328 should be Narvikfjellet
"Cerro Castor", # southernmost ski area/resort
]
@classmethod
def get_ski_area_names(self) -> list[str]:
if running_in_test():
return ["Storrs Hill Ski Area"]
return [
"Les Trois Vallées", # biggest
"Dartmouth Skiway", # bimodal
"Killington Resort", # eastfacing
"Mt. Bachelor", # difficulty by orientation
"Olos Ski Resort", # darkest resort in the world
"Etna Sud/Nicolosi", # sunniest
"Jackson Hole", # southfacing
"Narvik", # northernmost ski resort, https://www.openstreetmap.org/relation/12567328 should be Narvikfjellet
"Cerro Castor", # southernmost ski area/resort
]

@classmethod
def get_ski_areas_df(cls) -> pl.DataFrame:
ski_areas = (
pl.Series(name="ski_area_name", values=cls.select_ski_area_names)
pl.Series(name="ski_area_name", values=cls.get_ski_area_names())
.to_frame()
.join(
load_ski_areas_pl(),
Expand Down
19 changes: 17 additions & 2 deletions openskistats/tests/data/_variables.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
hemisphere:
north_over_south:
combined_distance: 1.0
combined_vertical: 1.0
coordinate_count: 1.0
lift_count: 1.0
run_count: 1.0
segment_count: 1.0
ski_areas_count: 1.0
openskimap:
countries:
counts:
ski_areas_04_downhill_operating_1_lift: 1
lifts:
counts:
01_raw: 5
Expand Down Expand Up @@ -28,9 +40,9 @@ openskimap:
03_downhill: 38
distance:
3d:
04_downhill_clean: 9845.301161414029
04_downhill_clean: 9845.30078125
vertical:
04_downhill_clean: 1793.500000000001
04_downhill_clean: 1793.500244140625
download:
checksum_sha256: 4549037d1c8c60f91e1963363940ba3e6ca51752ddde7f181cf906e57a027f04
compressed_size_mb: 92.48648071289062
Expand All @@ -48,6 +60,9 @@ openskimap:
01_raw_by_geometry:
Polygon: 2
02_downhill: 2
04_downhill_operating_1_lift: 2
04_downhill_operating_1_lift_us: 2
05_downhill_operating_5_lift: 0
download:
checksum_sha256: 9ba4f0091d8978ade54f83be9d3fc379703eaf307835b5e32d2d0beac59ee940
compressed_size_mb: 2.4046401977539062
Expand Down

0 comments on commit 5a2f777

Please sign in to comment.