Added dummy metric

This commit is contained in:
dario 2023-12-14 19:19:40 +01:00
parent 63d609d4cf
commit 751887e6d8
3 changed files with 25 additions and 1 deletions

View File

@ -171,6 +171,10 @@
}
],
"source": [
"from spatz.metrics import Metric\n",
"\n",
"metric = Metric()\n",
"\n",
"logger = simulation.get_logger()\n",
"\n",
"# Set verbose to False to disable the progress bar\n",
@ -183,7 +187,12 @@
" # Get the correct altitude data.\n",
" alt = altitude()\n",
"\n",
" # TODO: Add your computation here."
" pred_alt = ...\n",
" metric(alt, pred_alt)\n",
"\n",
" # TODO: Add your computation here.\n",
"\n",
"print('Score was:', metric.get_score())"
]
},
{

View File

@ -0,0 +1 @@
from spatz.metrics.metric import Metric

14
spatz/metrics/metric.py Normal file
View File

@ -0,0 +1,14 @@
from typing import Any
class Metric:
def __init__(self) -> None:
self.__sum = 0
def get_score():
pass
def __call__(self, *args) -> Any:
self.__sum += abs(x - y)