Skip to content

Commit 97ab426

Browse files
authored
Merge pull request #991 from xylar/remove-end-year-end
Removed `errorOnMissing` and `endYear = end` config options
2 parents 1fbfa29 + 10dd8de commit 97ab426

16 files changed

Lines changed: 41 additions & 158 deletions

docs/tutorials/dev_getting_started.rst

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -642,24 +642,16 @@ climate index.
642642
## options related to producing time series plots, often to compare against
643643
## observations and previous runs
644644
645-
# start and end years for timeseries analysis. Use endYear = end to indicate
646-
# that the full range of the data should be used. If errorOnMissing = False,
647-
# the start and end year will be clipped to the valid range. Otherwise, out
648-
# of bounds values will lead to an error. In a "control" config file used in
649-
# a "main vs. control" analysis run, the range of years must be valid and
650-
# cannot include "end" because the original data may not be available.
645+
# start and end years for timeseries analysis. Out-of-bounds values will lead
646+
# to an error.
651647
startYear = 1
652648
endYear = 5
653649
654650
[index]
655651
## options related to producing nino index.
656652
657-
# start and end years for El Nino 3.4 analysis. Use endYear = end to indicate
658-
# that the full range of the data should be used. If errorOnMissing = False,
659-
# the start and end year will be clipped to the valid range. Otherwise, out
660-
# of bounds values will lead to an error. In a "control" config file used in
661-
# a "main vs. control" analysis run, the range of years must be valid and
662-
# cannot include "end" because the original data may not be available.
653+
# start and end years for El Nino 3.4 analysis. Out-of-bounds values will lead
654+
# to an error.
663655
startYear = 1
664656
endYear = 5
665657

docs/tutorials/getting_started.rst

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -443,24 +443,16 @@ climate index.
443443
## options related to producing time series plots, often to compare against
444444
## observations and previous runs
445445
446-
# start and end years for timeseries analysis. Use endYear = end to indicate
447-
# that the full range of the data should be used. If errorOnMissing = False,
448-
# the start and end year will be clipped to the valid range. Otherwise, out
449-
# of bounds values will lead to an error. In a "control" config file used in
450-
# a "main vs. control" analysis run, the range of years must be valid and
451-
# cannot include "end" because the original data may not be available.
446+
# start and end years for timeseries analysis. Out-of-bounds values will lead
447+
# to an error.
452448
startYear = 1
453449
endYear = 5
454450
455451
[index]
456452
## options related to producing nino index.
457453
458-
# start and end years for El Nino 3.4 analysis. Use endYear = end to indicate
459-
# that the full range of the data should be used. If errorOnMissing = False,
460-
# the start and end year will be clipped to the valid range. Otherwise, out
461-
# of bounds values will lead to an error. In a "control" config file used in
462-
# a "main vs. control" analysis run, the range of years must be valid and
463-
# cannot include "end" because the original data may not be available.
454+
# start and end years for timeseries analysis. Out-of-bounds values will lead
455+
# to an error.
464456
startYear = 1
465457
endYear = 5
466458

docs/users_guide/config/index.rst

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,15 @@ determine the start and end years of climate indices (such as El Ni |n~| o
1313
[index]
1414
## options related to producing nino index.
1515

16-
# start and end years for El Nino 3.4 analysis. Use endYear = end to indicate
17-
# that the full range of the data should be used. If errorOnMissing = False,
18-
# the start and end year will be clipped to the valid range. Otherwise, out
19-
# of bounds values will lead to an error. In a "control" config file used in
20-
# a "main vs. control" analysis run, the range of years must be valid and
21-
# cannot include "end" because the original data may not be available.
16+
# start and end years for El Nino 3.4 analysis. Out-of-bounds values will lead
17+
# to an error.
2218
startYear = 1
23-
endYear = end
19+
endYear = 20
2420

2521
Start and End Year
2622
------------------
2723

2824
A custom config file should specify a start and end year for time axis.
29-
If ``errorOnMissing = False`` in the ``input`` section and the start or end
30-
year is beyond the range of the simulation, the range will be reduced to those
31-
dates with available data and a warning message will be displayed. If
32-
``errorOnMissing = True``, out of range year will produce an error.
25+
Out of range year will produce an error.
3326

3427

docs/users_guide/config/timeSeries.rst

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,16 @@ for anomalies::
1616
# only the anomaly over a later span of years is of interest.
1717
# anomalyRefYear = 249
1818

19-
# start and end years for timeseries analysis. Use endYear = end to indicate
20-
# that the full range of the data should be used. If errorOnMissing = False,
21-
# the start and end year will be clipped to the valid range. Otherwise, out
22-
# of bounds values will lead to an error. In a "control" config file used in
23-
# a "main vs. control" analysis run, the range of years must be valid and
24-
# cannot include "end" because the original data may not be available.
19+
# start and end years for timeseries analysis. Out-of-bounds values will lead
20+
# to an error.
2521
startYear = 1
26-
endYear = end
22+
endYear = 20
2723

2824
Start and End Year
2925
------------------
3026

3127
A custom config file should specify a start and end year for time series.
32-
If ``errorOnMissing = False`` in the ``input`` section and the start or end
33-
year is beyond the range of the simulation, the range will be reduced to those
34-
dates with available data and a warning message will be displayed. If
35-
``errorOnMissing = True``, out of range year will produce an error.
28+
Out of range year will produce an error.
3629

3730

3831
Anomaly Reference Year

mpas_analysis/default.cfg

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,6 @@ file_cache_maxsize = 1200
151151
# with a single time slice.
152152
maxChunkSize = 10000
153153

154-
# Whether missing input data should produce an error. If not, the user gets
155-
# a warning and the time bounds are adjusted to the beginning and end of the
156-
# available data
157-
errorOnMissing = False
158-
159154

160155
[output]
161156
## options related to writing out plots, intermediate cached data sets, logs,
@@ -300,14 +295,10 @@ subprocessCount = 1
300295
# only the anomaly over a later span of years is of interest.
301296
# anomalyRefYear = 249
302297

303-
# start and end years for timeseries analysis. Use endYear = end to indicate
304-
# that the full range of the data should be used. If errorOnMissing = False,
305-
# the start and end year will be clipped to the valid range. Otherwise, out
306-
# of bounds values will lead to an error. In a "control" config file used in
307-
# a "main vs. control" analysis run, the range of years must be valid and
308-
# cannot include "end" because the original data may not be available.
298+
# start and end years for timeseries analysis. Out-of-bounds values will lead
299+
# to an error.
309300
startYear = 1
310-
endYear = end
301+
endYear = 20
311302

312303

313304
# line colors for the main, control and obs curves
@@ -344,14 +335,10 @@ plotTypes = ['absolute_energy_error', 'absolute_salt_error', 'total_mass_change'
344335
[index]
345336
## options related to producing nino index.
346337

347-
# start and end years for El Nino 3.4 analysis. Use endYear = end to indicate
348-
# that the full range of the data should be used. If errorOnMissing = False,
349-
# the start and end year will be clipped to the valid range. Otherwise, out
350-
# of bounds values will lead to an error. In a "control" config file used in
351-
# a "main vs. control" analysis run, the range of years must be valid and
352-
# cannot include "end" because the original data may not be available.
338+
# start and end years for El Nino 3.4 analysis. Out-of-bounds values will lead
339+
# to an error.
353340
startYear = 1
354-
endYear = end
341+
endYear = 20
355342

356343

357344
[regions]

mpas_analysis/ocean/hovmoller_ocean_regions.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,7 @@ def __init__(self, config, regionMasksTask, oceanRegionalProfilesTask,
7272
tags=['profiles', 'timeSeries', 'hovmoller'])
7373

7474
startYear = config.getint('timeSeries', 'startYear')
75-
endYear = config.get('timeSeries', 'endYear')
76-
if endYear == 'end':
77-
# a valid end year wasn't found, so likely the run was not found,
78-
# perhaps because we're just listing analysis tasks
79-
endYear = startYear
80-
else:
81-
endYear = int(endYear)
75+
endYear = config.getint('timeSeries', 'endYear')
8276

8377
regionGroups = config.getexpression('hovmollerOceanRegions',
8478
'regionGroups')

mpas_analysis/ocean/streamfunction_moc.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,7 @@ def __init__(self, config, mpasClimatologyTask, controlConfig=None):
8888
plotClimSubtask.run_after(computeClimSubtask)
8989

9090
startYear = config.getint('timeSeries', 'startYear')
91-
endYear = config.get('timeSeries', 'endYear')
92-
if endYear == 'end':
93-
# a valid end year wasn't found, so likely the run was not found,
94-
# perhaps because we're just listing analysis tasks
95-
endYear = startYear
96-
else:
97-
endYear = int(endYear)
91+
endYear = config.getint('timeSeries', 'endYear')
9892

9993
years = range(startYear, endYear + 1)
10094

mpas_analysis/ocean/time_series_antarctic_melt.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,7 @@ def __init__(self, config, mpasTimeSeriesTask, regionMasksTask,
8787
iceShelvesToPlot = masksSubtask.expand_region_names(iceShelvesToPlot)
8888

8989
startYear = config.getint('timeSeries', 'startYear')
90-
endYear = config.get('timeSeries', 'endYear')
91-
if endYear == 'end':
92-
# a valid end year wasn't found, so likely the run was not found,
93-
# perhaps because we're just listing analysis tasks
94-
endYear = startYear
95-
else:
96-
endYear = int(endYear)
90+
endYear = config.getint('timeSeries', 'endYear')
9791

9892
years = list(range(startYear, endYear + 1))
9993

mpas_analysis/ocean/time_series_ocean_regions.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,7 @@ def __init__(self, config, regionMasksTask, controlConfig=None):
7070
tags=['timeSeries', 'regions', 'antarctic'])
7171

7272
startYear = config.getint('timeSeries', 'startYear')
73-
endYear = config.get('timeSeries', 'endYear')
74-
if endYear == 'end':
75-
# a valid end year wasn't found, so likely the run was not found,
76-
# perhaps because we're just listing analysis tasks
77-
endYear = startYear
78-
else:
79-
endYear = int(endYear)
73+
endYear = config.getint('timeSeries', 'endYear')
8074

8175
regionGroups = config.getexpression(self.taskName, 'regionGroups')
8276

mpas_analysis/ocean/time_series_transport.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,7 @@ def __init__(self, config, controlConfig=None):
6767
tags=['timeSeries', 'transport'])
6868

6969
startYear = config.getint('timeSeries', 'startYear')
70-
endYear = config.get('timeSeries', 'endYear')
71-
if endYear == 'end':
72-
# a valid end year wasn't found, so likely the run was not found,
73-
# perhaps because we're just listing analysis tasks
74-
endYear = startYear
75-
else:
76-
endYear = int(endYear)
70+
endYear = config.getint('timeSeries', 'endYear')
7771

7872
years = [year for year in range(startYear, endYear + 1)]
7973

0 commit comments

Comments
 (0)