Newer
Older
from earthdiagnostics.diagnostic import Diagnostic
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
class RelinkAll(Diagnostic):
"""
Recreates the links for the variable specified
:original author: Javier Vegas-Regidor<javier.vegas@bsc.es>
:created: September 2016
:param data_manager: data management object
:type data_manager: DataManager
:param startdate: startdate
:type startdate: str
"""
alias = 'relinkall'
"Diagnostic alias for the configuration file"
def __init__(self, data_manager, startdate):
Diagnostic.__init__(self, data_manager)
self.startdate = startdate
def __str__(self):
return 'Relink all output Startdate: {0}'.format(self.startdate)
def __eq__(self, other):
return self.startdate == other.startdate
@classmethod
def generate_jobs(cls, diags, options):
"""
Creates a job for each chunk to compute the diagnostic
:param diags: Diagnostics manager class
:type diags: Diags
:param options: variable, domain, move_old=False
:type options: list[str]
:return:
"""
if len(options) > 1:
raise Exception('The Relink All diagnostic has no options')
job_list = list()
for startdate in diags.config.experiment.startdates: