src.gfdl module¶
-
class
src.gfdl.ModuleManager(*args, **kwargs)[source]¶ Bases:
src.util.Singleton-
_current_module_versions= {'anaconda': 'anaconda2/5.1', 'gcp': 'gcp/2.3', 'ncl': 'ncarg/6.5.0', 'netcdf': 'netcdf/4.2', 'python2': 'python/2.7.12', 'python3': 'python/3.4.3', 'r': 'R/3.4.4'}¶
-
-
class
src.gfdl.GfdlDiagnostic(pod_name, verbose=0)[source]¶ Bases:
src.shared_diagnostic.DiagnosticWrapper for Diagnostic that adds writing a placeholder directory to the output as a lockfile if we’re running in frepp cooperative mode.
-
__init__(pod_name, verbose=0)[source]¶ POD initializer. Given a POD name, we attempt to read a settings.json file in a subdirectory of
/diagnosticsby that name and parse the contents.
-
setUp(verbose=0)[source]¶ Perform filesystem operations and checks prior to running the POD.
In order, this 1) sets environment variables specific to the POD, 2) creates POD-specific working directories, and 3) checks for the existence of the POD’s driver script.
Note
The existence of data files is checked with
data_manager.DataManager.fetchData()and the runtime environment is validated separately as a function ofenvironment_manager.EnvironmentManager.run(). This is because each POD is run in a subprocess (due to the necessity of supporting multiple languages) so the validation must take place in that subprocess.- Raises:
PodRequirementFailureif requirements aren’t met. This is re-raised from the
_check_pod_driver()and_check_for_varlist_files()subroutines.
- Raises:
-
tearDown(verbose=0)[source]¶ Performs cleanup tasks when the POD has finished running.
In order, this 1) creates the POD’s HTML output page from its included template, replacing
CASENAMEand other template variables with their current values, and adds a link to the POD’s page from the top-level HTML report; 2) converts the POD’s output plots (in PS or EPS vector format) to a bitmap format for webpage display; 3) Copies all requested files to the output directory and deletes temporary files.- Parameters
verbose (
int, optional) – Logging verbosity level. Default 0.
-
-
class
src.gfdl.GfdlvirtualenvEnvironmentManager(verbose=0)[source]¶ Bases:
src.environment_manager.VirtualenvEnvironmentManager-
_module_lookup= {'ncl': ['ncl'], 'ncl_MJO_suite': ['python', 'ncl'], 'py_convective_transition_diag': ['python', 'ncl'], 'py_default': ['python'], 'r_default': ['r']}¶
-
_abc_impl= <_abc_data object>¶
-
-
class
src.gfdl.GfdlcondaEnvironmentManager(verbose=0)[source]¶ Bases:
src.environment_manager.CondaEnvironmentManager-
_abc_impl= <_abc_data object>¶
-
-
src.gfdl.GfdlautoDataManager(case_dict, DateFreqMixin=None)[source]¶ Wrapper for dispatching DataManager based on inputs.
-
class
src.gfdl.GfdlarchiveDataManager(case_dict, DateFreqMixin=None)[source]¶ Bases:
src.data_manager.DataManager-
__init__(case_dict, DateFreqMixin=None)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
class
DataKey(name_in_model, date_freq)¶ Bases:
tuple-
_asdict()¶ Return a new OrderedDict which maps field names to their values.
-
_field_defaults= {}¶
-
_fields= ('name_in_model', 'date_freq')¶
-
_fields_defaults= {}¶
-
classmethod
_make(iterable)¶ Make a new DataKey object from a sequence or iterable
-
_replace(**kwds)¶ Return a new DataKey object replacing specified fields with new values
-
property
date_freq¶ Alias for field number 1
-
property
name_in_model¶ Alias for field number 0
-
-
dataset_key(dataset)[source]¶ Return immutable representation of DataSet. Two DataSets should have the same key
-
_query_data()[source]¶ XXX UPDATE DOCSTRING Populate _remote_data attribute with list of candidate files.
Specifically, if a <component> and <chunk_freq> subdirectory has all the requested data, return paths to all files we would need in that subdirectory. The decision of which <component> and <chunk_freq> to use is made in
plan_data_fetching()because it requires comparing the files found for all requested datasets.
-
local_data_is_current(dataset)[source]¶ Test whether data is current based on filesystem modification dates.
Todo
Throw an error if local copy has been modified after remote copy.
- Handle case where local data involves processing of remote data, like
ncrcat’ing. Copy raw remote files to temp directory if we need to process?
gcp –sync does this already.
-
_abc_impl= <_abc_data object>¶
-
-
class
src.gfdl.GfdlppDataManager(case_dict, DateFreqMixin=None)[source]¶ Bases:
src.gfdl.GfdlarchiveDataManager-
__init__(case_dict, DateFreqMixin=None)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
UndecidedKey¶ alias of
ComponentKey
-
static
_heuristic_component_tiebreaker(str_list)[source]¶ Determine experiment component(s) from heuristics.
If we’re passed multiple components, select those containing ‘cmip’.
- If that selects multiple components, break the tie by selecting the
component with the fewest words (separated by ‘_’), or, failing that, the shortest overall name.
:param str_list (
listofstr: ): list of component names.Returns:
str: name of component that breaks the tie.
-
_abc_impl= <_abc_data object>¶
-
-
class
src.gfdl.Gfdlcmip6abcDataManager(case_dict, DateFreqMixin=None)[source]¶ Bases:
src.gfdl.GfdlarchiveDataManager-
__init__(case_dict, DateFreqMixin=None)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
class
UndecidedKey(table_id, grid_label, version_date)¶ Bases:
tuple-
_asdict()¶ Return a new OrderedDict which maps field names to their values.
-
_field_defaults= {}¶
-
_fields= ('table_id', 'grid_label', 'version_date')¶
-
_fields_defaults= {}¶
-
classmethod
_make(iterable)¶ Make a new UndecidedKey object from a sequence or iterable
-
_replace(**kwds)¶ Return a new UndecidedKey object replacing specified fields with new values
-
property
grid_label¶ Alias for field number 1
-
property
table_id¶ Alias for field number 0
-
property
version_date¶ Alias for field number 2
-
-
_abc_impl= <_abc_data object>¶
-
-
class
src.gfdl.Gfdludacmip6DataManager(case_dict, DateFreqMixin=None)[source]¶ Bases:
src.gfdl.Gfdlcmip6abcDataManager-
_cmip6_root= '/archive/pcmdi/repo/CMIP6'¶
-
_abc_impl= <_abc_data object>¶
-
-
class
src.gfdl.Gfdldatacmip6DataManager(case_dict, DateFreqMixin=None)[source]¶ Bases:
src.gfdl.Gfdlcmip6abcDataManager-
_cmip6_root= '/data_cmip6/CMIP6'¶
-
_abc_impl= <_abc_data object>¶
-
-
src.gfdl.parse_frepp_stub(frepp_stub)[source]¶ Converts the frepp arguments to a Python dictionary.
See https://wiki.gfdl.noaa.gov/index.php/FRE_User_Documentation#Automated_creation_of_diagnostic_figures.
Returns:
dictof frepp parameters.