From 27acb96b65f05926fc29f7fa97ab6c229f55cac3 Mon Sep 17 00:00:00 2001 From: jdevine Date: Tue, 10 Aug 2021 18:57:17 +0200 Subject: [PATCH] Changes to temperature handling --- README.md | 4 ++-- cara/apps/expert.py | 4 ++-- cara/tests/models/test_piecewiseconstant.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1be26e55..4ca66968 100644 --- a/README.md +++ b/README.md @@ -65,9 +65,9 @@ In order for the natural ventilation option to work correctly for other geograph There are some scripts to help download and process the temperature data from your nearest weather station in the https://gitlab.cern.ch/cara/climatology-data repository. Once you have used the scripts, the hourly temperature data for your location should be added to the file `data.py` in place of the default values for Geneva. The temperature values for your locations should be pasted into the `Geneva_hourly_temperatures_celsius_per_hour` variable, **without changing the variable name** in the following format: - `'Jan': [0.2, -0.3, -0.5, -0.9, -1.1, -1.4, -1.5, -1.5, -1.1, 0.1, 1.5, + `'1': [0.2, -0.3, -0.5, -0.9, -1.1, -1.4, -1.5, -1.5, -1.1, 0.1, 1.5, 2.8, 3.8, 4.4, 4.5, 4.4, 4.4, 3.9, 3.1, 2.7, 2.2, 1.7, 1.5, 1.1], - 'Feb': [0.9, 0.3, 0.0, -0.5, -0.7, -1.1, -1.2, -1.1, -0.7, 0.8, 2.5, + '2': [0.9, 0.3, 0.0, -0.5, -0.7, -1.1, -1.2, -1.1, -0.7, 0.8, 2.5, 4.2, 5.4, 6.2, 6.3, 6.2, 6.1, 5.5, 4.5, 4.1, 3.5, 2.8, 2.5, 2.0],...` CARA currently supports **only one geographic location for weather data per instance**. diff --git a/cara/apps/expert.py b/cara/apps/expert.py index c29cea76..f7827aa4 100644 --- a/cara/apps/expert.py +++ b/cara/apps/expert.py @@ -360,10 +360,10 @@ class ModelWidgets(View): def _build_month(self, node) -> WidgetGroup: - month_choice = widgets.Select(options=list(data.GenevaTemperatures.keys()), value='Jan') + month_choice = widgets.Select(options=list(data.Temperatures.keys()), value='1') def on_month_change(change): - node.outside_temp = data.GenevaTemperatures[change['new']] + node.outside_temp = data.Temperatures[change['new']] month_choice.observe(on_month_change, names=['value']) return WidgetGroup( diff --git a/cara/tests/models/test_piecewiseconstant.py b/cara/tests/models/test_piecewiseconstant.py index a0ba14f0..72f3d05e 100644 --- a/cara/tests/models/test_piecewiseconstant.py +++ b/cara/tests/models/test_piecewiseconstant.py @@ -81,5 +81,5 @@ def test_piecewiseconstant_vs_interval(time): def test_piecewiseconstant_transition_times(): - outside_temp = data.GenevaTemperatures['Jan'] + outside_temp = data.GenevaTemperatures['1'] assert set(outside_temp.transition_times) == outside_temp.interval().transition_times()