Commit 4457384d authored by Le Roux Erwan's avatar Le Roux Erwan
Browse files

[DATASET] add test_dataset

parent 0db99592
No related merge requests found
Showing with 27 additions and 3 deletions
+27 -3
......@@ -10,6 +10,7 @@ class Smith(AbstractMaxStableModel):
super().__init__(params_start_fit=params_start_fit, params_sample=params_sample)
self.cov_mod = 'gauss'
self.default_params_start_fit = {
'var': 1,
'cov11': 1,
'cov12': 0,
'cov22': 1
......
from rpy2.rinterface import RRuntimeError
import unittest
from itertools import product
from extreme_estimator.extreme_models.max_stable_model.utils import load_max_stable_models
from spatio_temporal_dataset.coordinates.utils import load_coordinates
from spatio_temporal_dataset.dataset.simulation_dataset import MaxStableDataset
class TestDataset(unittest.TestCase):
pass
# already done by the estimator somehow,
# maybe I could add some more precise test that check for 1D, 2D and 3D Datasets
nb_obs = 10
nb_points = 10
def test_max_stable_dataset_R1_and_R2(self):
max_stable_models = load_max_stable_models()[:]
coordinatess = load_coordinates(self.nb_points)[:-1]
for coordinates, max_stable_model in product(coordinatess, max_stable_models):
MaxStableDataset.from_sampling(nb_obs=self.nb_obs,
max_stable_model=max_stable_model,
coordinates=coordinates)
self.assertTrue(True)
def test_max_stable_dataset_crash_R3(self):
# test to warn me when spatialExtremes handles R3
with self.assertRaises(RRuntimeError):
smith_process = load_max_stable_models()[0]
coordinates_R3 = load_coordinates(self.nb_points)[-1]
MaxStableDataset.from_sampling(nb_obs=self.nb_obs,
max_stable_model=smith_process,
coordinates=coordinates_R3)
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