Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • main
  • 0.1.5
  • 0.1.6
  • 0.2.0
  • 0.2.1
  • 0.2.2
  • 0.2.3
  • 0.2.4
  • 0.2.5
  • 0.2.6
10 results

Target

Select target project
  • VIPS/models/python/referencemodel
1 result
Select Git revision
  • main
  • 0.1.5
  • 0.1.6
  • 0.2.0
  • 0.2.1
  • 0.2.2
  • 0.2.3
  • 0.2.4
  • 0.2.5
  • 0.2.6
10 results
Show changes
Commits on Source (3)
......@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "vips_reference_model"
version = "0.2.2"
version = "0.2.3"
description = "Example VIPS model, showcasing functionality"
readme = "README.md"
authors = [{ name="Tor-Einar Skog", email="tor-einar.skog@nibio.no" }]
......@@ -19,7 +19,7 @@ dependencies = [
"pydantic",
"pytz",
"pandas",
"vipscore_common @ git+https://gitlab.nibio.no/VIPS/vipscore-python-common.git@0.2.2"
"vipscore_common @ git+https://gitlab.nibio.no/VIPS/vipscore-python-common.git@0.2.3"
]
requires-python = ">=3.9"
......@@ -28,7 +28,7 @@ requires-python = ">=3.9"
dev = ["bumpver", "pytest"]
[tool.bumpver]
current_version = "0.2.2"
current_version = "0.2.3"
version_pattern = "MAJOR.MINOR.PATCH"
commit_message = "bump version {old_version} -> {new_version}"
commit = true
......
......@@ -75,15 +75,15 @@ class ReferenceModel(VIPSModel):
# Calculate day degrees from sowingDate and as far as weather data goes
# Adjusting for base temperature
self.df["TMContrib"] = self.df["TM"].apply(get_temp_adjusted_for_base, args=(5,))
self.df["WEATHER.TMContrib"] = self.df["TM"].apply(get_temp_adjusted_for_base, args=(5,))
# Aggregating the day degrees
self.df["TMDD"] = self.df["TMContrib"].cumsum()
self.df["WEATHER.TMDD"] = self.df["WEATHER.TMContrib"].cumsum()
# Adding the thresholds to the data frame
self.df["THRESHOLD_LOW"] = ReferenceModel.THRESHOLD_LOW
self.df["THRESHOLD_MEDIUM"] = ReferenceModel.THRESHOLD_MEDIUM
self.df["THRESHOLD_HIGH"] = ReferenceModel.THRESHOLD_HIGH
self.df["%s.THRESHOLD_LOW" % self.MODEL_ID] = ReferenceModel.THRESHOLD_LOW
self.df["%s.THRESHOLD_MEDIUM" % self.MODEL_ID] = ReferenceModel.THRESHOLD_MEDIUM
self.df["%s.THRESHOLD_HIGH" % self.MODEL_ID] = ReferenceModel.THRESHOLD_HIGH
# For each day: check accumulated day-degrees and decide warning status
self.df["WARNING_STATUS"] = self.df["TMDD"].apply(self.determine_warning_status)
self.df["WARNING_STATUS"] = self.df["WEATHER.TMDD"].apply(self.determine_warning_status)
#print(self.df)
result = get_result_list_from_dataframe(self.df)
#print(result)
......
......@@ -58,7 +58,7 @@ class TestReferenceModel(unittest.TestCase):
self.assertIsNotNone(result_list)
last_result = result_list[len(result_list)-1]
self.assertIsNotNone(result_list[0].valid_time_start)
self.assertEqual(555.8507083333333, last_result.get_value("TMDD"))
self.assertEqual(555.8507083333333, last_result.get_value("WEATHER","TMDD"))
def test_get_model_id(self):
"""
......