38 This module provides a class with all GOcean related constants.
47 '''This class stores all GOcean constants. It stores all values in
48 class variables (to avoid re-evaluating them).
51 HAS_BEEN_INITIALISED =
False
55 '''Return the valid access types for the GOcean API. Reads the values
56 from the config file the first time the method is called.
58 :returns: valid access types for the GOcean API.
62 if not GOceanConstants._VALID_ACCESS_TYPES:
63 conf = Config.get().api_conf(
"gocean1.0")
64 GOceanConstants._VALID_ACCESS_TYPES = \
65 list(conf.get_access_mapping().keys())
66 return GOceanConstants._VALID_ACCESS_TYPES
69 if GOceanConstants.HAS_BEEN_INITIALISED:
72 GOceanConstants.HAS_BEEN_INITIALISED =
True
75 GOceanConstants.VALID_INTRINSIC_TYPES = []
80 GOceanConstants._VALID_ACCESS_TYPES = []
83 GOceanConstants.VALID_ARG_TYPE_NAMES = []
86 GOceanConstants.VALID_SCALAR_NAMES = [
"rscalar",
"iscalar"]
89 GOceanConstants.VALID_FIELD_GRID_TYPES = [
"go_cu",
"go_cv",
"go_ct",
94 GOceanConstants.VALID_SCALAR_TYPES = [
"go_i_scalar",
"go_r_scalar"]
97 GOceanConstants.VALID_OFFSET_NAMES = [
"go_offset_se",
"go_offset_sw",
98 "go_offset_ne",
"go_offset_nw",
103 GOceanConstants.SUPPORTED_OFFSETS = [
"go_offset_ne",
"go_offset_sw",
107 GOceanConstants.VALID_ITERATES_OVER = [
"go_all_pts",
"go_internal_pts",
113 GOceanConstants.VALID_STENCIL_NAMES = [
"go_pointwise"]
118 GOceanConstants.VALID_STENCIL_NAME =
"go_stencil"
122 GOceanConstants.VALID_LOOP_TYPES = [
"inner",
"outer"]
128 __all__ = [
'GOceanConstants']
def get_valid_access_types()