Commit 452b683d authored by Antoine Berchet's avatar Antoine Berchet
Browse files

Updating class type names for pytest

parent 7b10c2b3
"""
Write here the README about the plugin.
Example of relevant information: type of files treated,
including format of names and shape of data, time resolution, and any specific treatment
that prevents the plugin from working with another type of files.
This is a template to write a flux plugin.
It includes all required function to run properly.
It generates random values and can be directly used with a working test case.
.. warning::
Please gradually document properly your plugin when starting from the template.
It includes :bash:`input_arguments` (see :doc:`here</contrib_doc>` for details),
as well as all information about the original data the plugin is supposed to
accommodate.
Please include licensing information, permanent link to download the data (or a
contact person if no link is publicly available), as well as data format (temporal
and horizontal resolution, names and shape of the data files), and any specific treatment
that prevents the plugin from working with another type of files.
Summary steps to integrate a new flux data plugin
-----------------------------------------------------
First steps to integrate your own flux plugin from the template
...............................................................
To integrate your own flux plugin, please follow the steps:
1) copy the :bash:`flux_plugin_template` directory into one with a name of your
preference
2) Start writing the documentation of your plugin by replacing the present
bash:`docstring` in the file bash:`__init__.py`. Use rst syntax since this doctring
will be automatically parsed for publication in the documentation
3) Change the variables :bash:`_name`, :bash:`_version` (default is :bash:`std`) if
not specified, and :bash:`_fullname` (optional, is used as a title when
automatically generating the documentation
:doc:`here</documentation/plugins/datastreams/fluxes/index>`)
Now your new plugin is ready to be used in your test case with random data.
Further integration of your own plugin
......................................
Now that your plugin can be used in a yml and generate random values, you need to
integrate the main functions feeding the plugin.
- :bash:`fetch`: fetch data files
- :bash:`read`: read data files
- :bash:`write`: write data files
Please find further details :doc:`here</documentation/plugins/datastreams/index>`.
Use rst syntax since this README will be automatically displayed in the documentation
"""
......
......@@ -135,7 +135,7 @@ def native2inputs_adj( self, datastore, input_type, datei, datef, runsubdir, mod
# end if
# Return if input_type is something else than "flux".
if( input_type != 'fluxes' ):
if( input_type != 'flux' ):
return datastore
# end if
......
......@@ -99,14 +99,14 @@ def ref_chimere(tmpdir):
'plugin': {
'name': 'CHIMERE',
'version': 'AEMISSIONS',
'type': 'fluxes'
'type': 'flux'
},
"parameters": {
"CH4": {
'plugin': {
'name': 'CHIMERE',
'version': 'AEMISSIONS',
'type': 'fluxes'
'type': 'flux'
},
"hresol": "hpixels",
"file_freq": "3H",
......@@ -126,7 +126,7 @@ def ref_chimere(tmpdir):
'plugin': {
'name': 'CHIMERE',
'version': 'icbc',
'type': 'fields'
'type': 'field'
}
},
"topcond": {
......@@ -137,7 +137,7 @@ def ref_chimere(tmpdir):
'plugin': {
'name': 'CHIMERE',
'version': 'icbc',
'type': 'fields'
'type': 'field'
}
},
"meteo": {
......@@ -156,7 +156,7 @@ def ref_chimere(tmpdir):
'plugin': {
'name': 'CHIMERE',
'version': 'icbc',
'type': 'fields'
'type': 'field'
}
},
"concs": {
......
......@@ -55,14 +55,14 @@ def setup_argfrsd(ref_chimere, request):
'plugin': {
'name': 'CHIMERE',
'version': 'AEMISSIONS',
'type': 'fluxes'
'type': 'flux'
},
"parameters": {
"NO2": {
'plugin': {
'name': 'CHIMERE',
'version': 'AEMISSIONS',
'type': 'fluxes'
'type': 'flux'
},
"tresol": "24H",
"hresol": "hpixels",
......@@ -77,7 +77,7 @@ def setup_argfrsd(ref_chimere, request):
'plugin': {
'name': 'CHIMERE',
'version': 'AEMISSIONS',
'type': 'fluxes'
'type': 'flux'
},
"tresol": "24H",
"hresol": "hpixels",
......@@ -92,7 +92,7 @@ def setup_argfrsd(ref_chimere, request):
'plugin': {
'name': 'CHIMERE',
'version': 'AEMISSIONS',
'type': 'fluxes'
'type': 'flux'
},
"tresol": "24H",
"hresol": "hpixels",
......@@ -107,20 +107,20 @@ def setup_argfrsd(ref_chimere, request):
}
# Test different options in biofluxes
datavect["biofluxes"] = {
datavect["bioflux"] = {
"dir": input_dir,
"file": "BEMISSIONS_"+domid+".%Y%m%d%H.24.nc",
"file_freq": "24H",
"emis_type": "bio",
'plugin': {
'name': 'CHIMERE', 'version': 'AEMISSIONS', 'type': 'fluxes'
'name': 'CHIMERE', 'version': 'AEMISSIONS', 'type': 'flux'
},
"parameters": {
"'''NO'''": {
'plugin': {
'name': 'CHIMERE',
'version': 'AEMISSIONS',
'type': 'fluxes'
'type': 'flux'
},
"emis_type": "bio",
"tresol": "24H",
......@@ -136,7 +136,7 @@ def setup_argfrsd(ref_chimere, request):
'plugin': {
'name': 'CHIMERE',
'version': 'AEMISSIONS',
'type': 'fluxes'
'type': 'flux'
},
"emis_type": "bio",
"tresol": "24H",
......@@ -157,7 +157,7 @@ def setup_argfrsd(ref_chimere, request):
"file": config["datei"].strftime("INI_CONCS_"+domid+".%Y%m%d%H.24.nc"),
"comp_type": "inicond",
'plugin': {
'name': 'CHIMERE', 'version': 'icbc', 'type': 'fields'
'name': 'CHIMERE', 'version': 'icbc', 'type': 'field'
},
# "parameters" : {
# "NO2": {
......@@ -188,7 +188,7 @@ def setup_argfrsd(ref_chimere, request):
"comp_type": "latcond",
"file_freq": "24H",
'plugin': {
'name': 'CHIMERE', 'version': 'icbc', 'type': 'fields'
'name': 'CHIMERE', 'version': 'icbc', 'type': 'field'
},
# "parameters" : {
# "NO2": {
......@@ -225,7 +225,7 @@ def setup_argfrsd(ref_chimere, request):
"comp_type": "topcond",
"file_freq": "24H",
'plugin': {
'name': 'CHIMERE', 'version': 'icbc', 'type': 'fields'
'name': 'CHIMERE', 'version': 'icbc', 'type': 'field'
},
# "parameters" : {
# "NO2": {
......
......@@ -42,7 +42,7 @@ def setup_argonaut(ref_chimere):
},
}
},
"biofluxes": {"dir": input_dir},
"bioflux": {"dir": input_dir},
"latcond": {"dir": input_dir},
"topcond": {"dir": input_dir},
"meteo": {"dir": input_dir},
......
......@@ -42,7 +42,7 @@ def setup_eurocom(ref_chimere):
},
}
},
"biofluxes": {"dir": input_dir},
"bioflux": {"dir": input_dir},
"latcond": {"dir": input_dir},
"topcond": {"dir": input_dir},
"meteo": {"dir": input_dir},
......
......@@ -42,7 +42,7 @@ def setup_eurocomex(ref_chimere):
},
}
},
"biofluxes": {"dir": input_dir},
"bioflux": {"dir": input_dir},
"latcond": {"dir": input_dir},
"topcond": {"dir": input_dir},
"meteo": {"dir": input_dir},
......
......@@ -28,14 +28,14 @@ def setup_melchior(ref_chimere):
'plugin': {
'name': 'CHIMERE',
'version': 'AEMISSIONS',
'type': 'fluxes'
'type': 'flux'
},
"parameters": {
"HCHO": {
'plugin': {
'name': 'CHIMERE',
'version': 'AEMISSIONS',
'type': 'fluxes'
'type': 'flux'
},
"file_freq": "3H",
"hresol": "hpixels",
......@@ -58,7 +58,7 @@ def setup_melchior(ref_chimere):
'plugin': {
'name': 'CHIMERE',
'version': 'AEMISSIONS',
'type': 'fluxes'
'type': 'flux'
},
"file_freq": "3H",
"hresol": "bands",
......@@ -77,7 +77,7 @@ def setup_melchior(ref_chimere):
'plugin': {
'name': 'CHIMERE',
'version': 'AEMISSIONS',
'type': 'fluxes'
'type': 'flux'
},
"file_freq": "3H",
"hresol": "ibands",
......@@ -95,7 +95,7 @@ def setup_melchior(ref_chimere):
'plugin': {
'name': 'CHIMERE',
'version': 'AEMISSIONS',
'type': 'fluxes'
'type': 'flux'
},
"file_freq": "3H",
"hresol": "regions",
......@@ -139,13 +139,13 @@ def setup_melchior(ref_chimere):
}
# Test different options in biofluxes
datavect["biofluxes"] = {
datavect["bioflux"] = {
"dir": input_dir,
"file": "BEMISSIONS.%Y%m%d%H.3.nc",
"file_freq": "3H",
"emis_type": "bio",
'plugin': {
'name': 'CHIMERE', 'version': 'AEMISSIONS', 'type': 'fluxes'
'name': 'CHIMERE', 'version': 'AEMISSIONS', 'type': 'flux'
},
"parameters": {
"C5H8": {
......@@ -154,7 +154,7 @@ def setup_melchior(ref_chimere):
"file_freq": "24H",
"emis_type": "bio",
'plugin': {
'name': 'CHIMERE', 'version': 'AEMISSIONS', 'type': 'fluxes'
'name': 'CHIMERE', 'version': 'AEMISSIONS', 'type': 'flux'
},
"domain": {
'plugin': {
......@@ -230,7 +230,7 @@ def setup_melchior(ref_chimere):
'plugin': {
'name': 'ECMWF',
'version': 'grib2',
'type': 'fields'
'type': 'field'
},
"dir": "{}/ECMWF/europe160/%Y/%m/".format(raw_dir),
"varname": "co2",
......@@ -307,7 +307,7 @@ def setup_melchior(ref_chimere):
'plugin': {
'name': 'ECMWF',
'version': 'grib2',
'type': 'fields'
'type': 'field'
},
"dir": "{}/ECMWF/europe160/%Y/%m/".format(raw_dir),
"varname": "co2",
......
......@@ -97,7 +97,7 @@ def ref_flexpart(tmpdir):
'plugin': {
'name': 'FLEXPART',
'version': 'nc',
'type': 'fluxes'
'type': 'flux'
},
"to_netcdf": True,
"hresol": "regions",
......
......@@ -53,7 +53,7 @@ def setup_empa(ref_flexpart):
'plugin': {
'name': 'FLEXPART',
'version': 'nc',
'type': 'fluxes'
'type': 'flux'
},
"to_netcdf": True,
"hresol": "regions",
......@@ -96,7 +96,7 @@ def setup_empa(ref_flexpart):
'plugin': {
'name': 'TM5-4DVAR',
'version': 'rodenbeck',
'type': 'fields'
'type': 'field'
},
"dir": os.path.join(
data_dir, "TEST_INPUT/INIT_CONC/HJM/"),
......
......@@ -76,14 +76,14 @@ def ref_lmdz(tmpdir):
'version': 'std'
},
'components': {
'fluxes': {
'flux': {
'file_freq': "1MS",
'parameters': {
'CH4_agri': {
'plugin': {
'name': 'LMDZ',
'version': 'sflx',
'type': 'fluxes'
'type': 'flux'
},
'hresol': 'hpixels',
'vresol': 'vpixels',
......@@ -105,7 +105,7 @@ def ref_lmdz(tmpdir):
'plugin': {
'name': 'LMDZ',
'version': 'sflx',
'type': 'fluxes'
'type': 'flux'
},
'hresol': 'hpixels',
'vresol': 'vpixels',
......@@ -134,7 +134,7 @@ def ref_lmdz(tmpdir):
'plugin': {
'name': 'LMDZ',
'version': 'ic',
'type': 'fields'},
'type': 'field'},
'hresol': 'bands',
'bands_lat': [-90.1, -60, -30, 0, 30, 60, 90.1],
'bands_lon': [-180.1, -150, -120, -90, -60, -30, 0,
......@@ -149,7 +149,7 @@ def ref_lmdz(tmpdir):
'plugin': {
'name': 'LMDZ',
'version': 'prescrconcs',
'type': 'fields'},
'type': 'field'},
'file_freq': "1MS",
'parameters': {
'OH': {
......@@ -169,7 +169,7 @@ def ref_lmdz(tmpdir):
"plugin": {
"name": 'LMDZ',
"version": 'photochem',
"type": 'fields'},
"type": 'field'},
"dir": '{}/kinetic/'.format(input_dir),
"file": "TransCom.vmr.new.m%m.nc",
"file_freq": "1MS",
......
......@@ -232,14 +232,14 @@ def setup_isotopes(tmpdir):
'version': 'std'
},
'components': {
'fluxes': {
'flux': {
'file_freq': "1MS",
'parameters': {
'CH4_biof': {
'plugin': {
'name': 'LMDZ',
'version': 'sflx',
'type': 'fluxes'
'type': 'flux'
},
'hresol': 'hpixels',
'vresol': 'vpixels',
......@@ -261,7 +261,7 @@ def setup_isotopes(tmpdir):
'plugin': {
'name': 'LMDZ',
'version': 'sflx',
'type': 'fluxes'
'type': 'flux'
},
'hresol': 'hpixels',
'vresol': 'vpixels',
......@@ -283,7 +283,7 @@ def setup_isotopes(tmpdir):
'plugin': {
'name': 'LMDZ',
'version': 'sflx',
'type': 'fluxes'
'type': 'flux'
},
'hresol': 'hpixels',
'vresol': 'vpixels',
......@@ -305,7 +305,7 @@ def setup_isotopes(tmpdir):
'plugin': {
'name': 'LMDZ',
'version': 'sflx',
'type': 'fluxes'
'type': 'flux'
},
'hresol': 'hpixels',
'vresol': 'vpixels',
......@@ -327,7 +327,7 @@ def setup_isotopes(tmpdir):
'plugin': {
'name': 'LMDZ',
'version': 'sflx',
'type': 'fluxes'
'type': 'flux'
},
'hresol': 'hpixels',
'vresol': 'vpixels',
......@@ -355,7 +355,7 @@ def setup_isotopes(tmpdir):
'plugin': {
'name': 'LMDZ',
'version': 'sflx',
'type': 'fluxes'
'type': 'flux'
},
'hresol': 'regions',
"regions_infos": {
......@@ -380,7 +380,7 @@ def setup_isotopes(tmpdir):
'plugin': {
'name': 'LMDZ',
'version': 'sflx',
'type': 'fluxes'
'type': 'flux'
},
'hresol': 'regions',
"regions_infos": {
......@@ -405,7 +405,7 @@ def setup_isotopes(tmpdir):
'plugin': {
'name': 'LMDZ',
'version': 'sflx',
'type': 'fluxes'
'type': 'flux'
},
'hresol': 'regions',
"regions_infos": {
......@@ -430,7 +430,7 @@ def setup_isotopes(tmpdir):
'plugin': {
'name': 'LMDZ',
'version': 'sflx',
'type': 'fluxes'
'type': 'flux'
},
'hresol': 'regions',
"regions_infos": {
......@@ -455,7 +455,7 @@ def setup_isotopes(tmpdir):
'plugin': {
'name': 'LMDZ',
'version': 'sflx',
'type': 'fluxes'
'type': 'flux'
},
'hresol': 'regions',
"regions_infos": {
......@@ -486,7 +486,7 @@ def setup_isotopes(tmpdir):
'plugin': {
'name': 'LMDZ',
'version': 'ic',
'type': 'fields'},
'type': 'field'},
'hresol': 'bands',
'bands_lat': [-90.1, -60, -30, 0, 30, 60, 90.1],
'bands_lon': [-180.1, -150, -120, -90, -60, -30, 0,
......@@ -505,7 +505,7 @@ def setup_isotopes(tmpdir):
'plugin': {
'name': 'LMDZ',
'version': 'ic',
'type': 'fields'},
'type': 'field'},
'hresol': 'bands',
'bands_lat': [-90.1, -60, -30, 0, 30, 60, 90.1],
'bands_lon': [-180.1, -150, -120, -90, -60, -30, 0,
......@@ -520,7 +520,7 @@ def setup_isotopes(tmpdir):
'plugin': {
'name': 'LMDZ',
'version': 'prescrconcs',
'type': 'fields'},
'type': 'field'},
'file_freq': "1MS",
'parameters': {
'OH': {
......@@ -540,7 +540,7 @@ def setup_isotopes(tmpdir):
"plugin": {
"name": 'LMDZ',
"version": 'photochem',
"type": 'fields'},
"type": 'field'},
"dir": '{}/simple/kinetic/'.format(data_dir),
"file": "TransCom.vmr.new.m%m.nc",
"file_freq": "1MS",
......
......@@ -68,14 +68,14 @@ def setup_n2o(tmpdir):
'version': 'std'
},
'components': {
'fluxes': {
'flux': {
'file_freq': "1YS",
'parameters': {
'N2O_agric': {
'plugin': {
'name': 'LMDZ',
'version': 'sflx',
'type': 'fluxes'
'type': 'flux'
},
'hresol': 'hpixels',
'vresol': 'vpixels',
......@@ -98,7 +98,7 @@ def setup_n2o(tmpdir):
'plugin': {
'name': 'LMDZ',
'version': 'sflx',
'type': 'fluxes'
'type': 'flux'
},
'hresol': 'hpixels',
'vresol': 'vpixels',
......@@ -121,7 +121,7 @@ def setup_n2o(tmpdir):
'plugin': {
'name': 'LMDZ',
'version': 'sflx',
'type': 'fluxes'
'type': 'flux'
},
'hresol': 'hpixels',
'vresol': 'vpixels',
......@@ -144,7 +144,7 @@ def setup_n2o(tmpdir):
'plugin': {
'name': 'LMDZ',
'version': 'sflx',
'type': 'fluxes'
'type': 'flux'
},
'hresol': 'hpixels',
'vresol': 'vpixels',
......@@ -167,7 +167,7 @@ def setup_n2o(tmpdir):
'plugin': {
'name': 'LMDZ',
'version': 'sflx',
'type': 'fluxes'
'type': 'flux'
},
'hresol': 'hpixels',
'vresol': 'vpixels',
......@@ -196,7 +196,7 @@ def setup_n2o(tmpdir):
'plugin': {
'name': 'LMDZ',
'version': 'ic',
'type': 'fields'},
'type': 'field'},
'hresol': 'bands',
'bands_lat': [-90.1, -60, -30, 0, 30, 60, 90.1],
'bands_lon': [-180.1, -150, -120, -90, -60, -30, 0,
......@@ -211,7 +211,7 @@ def setup_n2o(tmpdir):
'plugin': {
'name': 'LMDZ',
'version': 'prescrconcs',
'type': 'fields'},
'type': 'field'},
'file_freq': "1MS",
'parameters': {
'O1D': {
......@@ -224,7 +224,7 @@ def setup_n2o(tmpdir):
"plugin": {
"name": 'LMDZ',
"version": 'photochem',
"type": 'fields'},
"type": 'field'},
"dir": '{}/kinetic/'.format(input_dir),
"file": "kinetic.lmdz9696.%Y.%m.nc",
"file_freq": "1MS",
......
......@@ -82,13 +82,13 @@ def ref_tm5(tmpdir):
'version': 'std'
},
'components': {
'fluxes': {
'flux': {
'parameters': {
'CH4': {
'plugin': {
'name': 'TM5',
'version': 'std',
'type': 'fluxes'
'type': 'flux'
},