Commit 3f750c33 authored by Le Roux Erwan's avatar Le Roux Erwan
Browse files

[contrasting project] fix test_two_fold_fit.py

parent b70b6f94
No related merge requests found
Showing with 3 additions and 3 deletions
+3 -3
......@@ -58,4 +58,5 @@ class LinearMarginEstimator(AbstractMarginEstimator):
gev_params = self.function_from_fit.get_gev_params(coordinate, is_transformed=False)
p = gev_params.density(maximum)
nllh -= np.log(p)
assert not np.isinf(nllh)
return nllh
import numpy as np
import rpy2
from rpy2 import robjects
from extreme_fit.model.result_from_model_fit.result_from_extremes.abstract_result_from_extremes import \
......
......@@ -21,7 +21,7 @@ class TestTwoFoldFit(unittest.TestCase):
set_seed_for_test()
altitudes = [900, 1200]
study_class = SafranSnowfall1Day
studies = AltitudesStudies(study_class, altitudes, year_min=1959, year_max=1963)
studies = AltitudesStudies(study_class, altitudes, year_min=1959, year_max=1989)
self.two_fold_datasets_generator = TwoFoldDatasetsGenerator(studies, nb_samples=2, massif_names=['Vercors'])
self.model_family_name_to_model_class = {'Stationary': [ConstantMarginModel],
'Linear': [ConstantMarginModel, LinearLocationAllDimsMarginModel]}
......@@ -34,7 +34,7 @@ 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']
self.assertEqual(best_model_class, ConstantMarginModel)
self.assertEqual(best_model_class, LinearLocationAllDimsMarginModel)
if __name__ == '__main__':
......
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