Commit f52524cd authored by Le Roux Erwan's avatar Le Roux Erwan
Browse files

[SCM][HYPERCUBE] catch more exception in abstract_gev_trend_test

parent 66c65c95
No related merge requests found
Showing with 16 additions and 10 deletions
+16 -10
......@@ -37,10 +37,10 @@ def full_trends_with_quantity_altitude_hypercube():
save_to_file = True
only_first_one = False
fast = False
add_detailed_plots = False
add_detailed_plots = True
altitudes = ALL_ALTITUDES[3:-6]
study_classes = SCM_STUDIES
for trend_test_class in [MannKendallTrendTest, GevLocationTrendTest, GevScaleTrendTest, GevShapeTrendTest][1:2]:
for trend_test_class in [MannKendallTrendTest, GevLocationTrendTest, GevScaleTrendTest, GevShapeTrendTest][:]:
visualizers = [StudyVisualizer(study, temporal_non_stationarity=True, verbose=False, multiprocessing=True)
for study in study_iterator_global(study_classes=study_classes, only_first_one=only_first_one,
altitudes=altitudes)]
......@@ -94,8 +94,8 @@ def fast_trends_with_quantity_altitude_hypercube():
def main_run():
# fast_trends_with_altitude_hypercube()
fast_trends_with_quantity_altitude_hypercube()
# full_trends_with_quantity_altitude_hypercube()
# fast_trends_with_quantity_altitude_hypercube()
full_trends_with_quantity_altitude_hypercube()
if __name__ == '__main__':
......
......@@ -81,7 +81,10 @@ class AbstractGevTrendTest(AbstractTrendTest):
@property
def test_trend_strength(self):
return self.percentage_of_change_per_year
if self.crashed:
return 0.0
else:
return self.percentage_of_change_per_year
@property
def percentage_of_change_per_year(self):
......
......@@ -21,6 +21,11 @@ class AbstractTrendTest(object):
SIGNIFICANCE_LEVEL = 0.05
def __init__(self, years_after_change_point, maxima_after_change_point):
self.years_after_change_point = years_after_change_point
self.maxima_after_change_point = maxima_after_change_point
assert len(self.years_after_change_point) == len(self.maxima_after_change_point)
@classmethod
def trend_type_to_style(cls):
d = OrderedDict()
......@@ -49,10 +54,7 @@ class AbstractTrendTest(object):
else:
return plt.cm.binary
def __init__(self, years_after_change_point, maxima_after_change_point):
self.years_after_change_point = years_after_change_point
self.maxima_after_change_point = maxima_after_change_point
assert len(self.years_after_change_point) == len(self.maxima_after_change_point)
@property
def n(self):
......
......@@ -55,10 +55,11 @@ class WarningWhileRunningR(Warning):
class WarningMaximumAbsoluteValueTooHigh(Warning):
pass
class OptimizationConstants(object):
class OptimizationConstants(object):
USE_MAXIT = False
class SafeRunException(Exception):
pass
......
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