Commit 59f359d3 authored by Le Roux Erwan's avatar Le Roux Erwan
Browse files

[FIX TESTS] fix imports for global tests. refactor some code.

parent fd82d6a9
No related merge requests found
Showing with 19 additions and 29 deletions
+19 -29
File moved
......@@ -23,10 +23,8 @@ class SmoothMarginalsThenUnitaryMsp(AbstractFullEstimator):
# Estimate the margin parameters
self.margin_estimator.fit()
# Compute the maxima_frech
print(self.dataset.maxima_gev)
maxima_frech = self.margin_estimator.margin_model.gev2frech(maxima_gev=self.dataset.maxima_gev,
df_gev_params=self.margin_estimator.df_gev_params)
print(maxima_frech)
# Update maxima frech field through the dataset object
self.dataset.maxima_frech = maxima_frech
# Estimate the max stable parameters
......
......@@ -9,8 +9,8 @@ class AlpsStation2DCoordinates(AlpsStation3DCoordinates):
@classmethod
def from_csv(cls, csv_file='coord-lambert2'):
# Remove the Z coordinates from df_coord
spatial_coordinates = super().from_csv(csv_file)
spatial_coordinates.df_coord.drop(cls.COORD_Z, axis=1, inplace=True)
spatial_coordinates = super().from_csv(csv_file) # type: AlpsStation3DCoordinates
spatial_coordinates.df_coordinates.drop(cls.COORD_Z, axis=1, inplace=True)
return spatial_coordinates
......
......@@ -7,8 +7,8 @@ class TransformedCoordinates(AbstractSpatialCoordinates):
@classmethod
def from_coordinates(cls, spatial_coordinates: AbstractSpatialCoordinates,
transformation_function: AbstractTransformation):
df_coord_transformed = spatial_coordinates.df_coordinates.copy()
df_coord_transformed = transformation_function.transform(df_coord=df_coord_transformed)
return cls(df_coord=df_coord_transformed, s_split=spatial_coordinates.s_split)
df_coordinates_transformed = spatial_coordinates.df_coordinates.copy()
df_coordinates_transformed = transformation_function.transform(df_coord=df_coordinates_transformed)
return cls(df_coordinates=df_coordinates_transformed, s_split=spatial_coordinates.s_split)
import unittest
from spatio_temporal_dataset.spatial_coordinates.alps_station_2D_coordinates import \
AlpsStation2DCoordinatesBetweenZeroAndOne
from spatio_temporal_dataset.spatial_coordinates.alps_station_3D_coordinates import \
AlpsStation3DCoordinatesWithAnisotropy
from spatio_temporal_dataset.spatial_coordinates.generated_coordinates import CircleCoordinatesRadius1
class TestTemporalObservations(unittest.TestCase):
DISPLAY = False
if __name__ == '__main__':
unittest.main()
import unittest
from itertools import product
from extreme_estimator.estimator.full_estimator import FullEstimatorInASingleStep, \
FullEstimatorInASingleStepWithSmoothMarginals, SmoothMarginalsThenUnitaryMsp
from spatio_temporal_dataset.dataset.simulation_dataset import MarginDataset, FullSimulatedDataset
from extreme_estimator.estimator.full_estimator import SmoothMarginalsThenUnitaryMsp
from spatio_temporal_dataset.dataset.simulation_dataset import FullSimulatedDataset
from spatio_temporal_dataset.spatial_coordinates.generated_coordinates import CircleCoordinatesRadius1
from test.extreme_estimator.test_margin_estimators import TestMarginEstimators
from test.extreme_estimator.test_max_stable_estimators import TestMaxStableEstimators
from itertools import product
from test.test_extreme_estimator.test_margin_estimators import TestMarginEstimators
from test.test_extreme_estimator.test_max_stable_estimators import TestMaxStableEstimators
class TestFullEstimators(unittest.TestCase):
......@@ -20,7 +19,6 @@ class TestFullEstimators(unittest.TestCase):
self.margin_models = TestMarginEstimators.load_margin_models()
def test_full_estimators(self):
print(self.margin_models, self.max_stable_models)
for margin_model, max_stable_model in product(self.margin_models, self.max_stable_models):
dataset = FullSimulatedDataset.from_double_sampling(nb_obs=10, margin_model=margin_model,
spatial_coordinates=self.spatial_coord,
......
import unittest
class TestTemporalObservations(unittest.TestCase):
DISPLAY = False
if __name__ == '__main__':
unittest.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