Commit 410cc66c authored by Le Roux Erwan's avatar Le Roux Erwan
Browse files

[refactor] improve test coverage for split.py.

parent 04f81275
No related merge requests found
Showing with 6 additions and 21 deletions
+6 -21
......@@ -89,7 +89,6 @@ class SafranRainfall7Days(SafranRainfall):
super().__init__(nb_consecutive_days=7, **kwargs)
class SafranNormalizedPreciptationRate(CumulatedStudy, Safran):
def __init__(self, **kwargs):
......@@ -103,6 +102,7 @@ class SafranNormalizedPreciptationRate(CumulatedStudy, Safran):
return self.variable_class(variable_array_temperature,
variable_array_snowfall, variable_array_rainfall, self.nb_consecutive_days)
class SafranNormalizedPreciptationRateOnWetDays(CumulatedStudy, Safran):
def __init__(self, **kwargs):
......
......@@ -25,5 +25,5 @@ def display_last_test_coverage():
if __name__ == '__main__':
# run_test_coverage()
run_test_coverage()
display_last_test_coverage()
......@@ -19,24 +19,6 @@ class Split(Enum):
test_temporal = 8
def split_to_display_kwargs(split: Split):
marker = None
gridsize = 1000
if 'train' in split.name:
linewidth = 0.5
else:
linewidth = 2
if 'spatiotemporal' in split.name:
gridsize = 20
if 'spatial' in split.name and 'temporal' in split.name:
marker = '*'
elif 'spatial' in split.name:
marker = '^'
else:
marker = '>'
return {'marker': marker, 'linewidth': linewidth, 'gridsize': gridsize}
ALL_SPLITS_EXCEPT_ALL = [split for split in Split if split is not Split.all]
SPLIT_NAME = 'split'
......
......@@ -33,7 +33,10 @@ class TestTwoFoldFit(unittest.TestCase):
def test_best_fit_spatial_extreme(self):
two_fold_fit = self.load_two_fold_fit(fit_method=MarginFitMethod.spatial_extremes_mle)
best_model_class = two_fold_fit.massif_name_to_best_model()['Vercors']
try:
best_model_class = two_fold_fit.massif_name_to_best_model()['Vercors']
except AssertionError as e:
self.assertTrue(False, msg=e.__str__())
self.assertEqual(best_model_class, LinearLocationAllDimsMarginModel)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment