Policy used for setting locations for Variable access.
More...
#include <Layout.h>
Policy used for setting locations for Variable access.
- Note
- Using std::enable_shared_from_this as part of the pybind11 interface. We pass this to ObsGroup as a shared_ptr. See https://pybind11.readthedocs.io/en/stable/advanced/smart_ptrs.html#std-shared-ptr
Definition at line 35 of file Layout.h.
◆ MergeMethod
Enumerator |
---|
Concat | Concatenate complementary variables entry-by-entry.
|
Definition at line 49 of file Layout.h.
◆ Policies
Enumerator |
---|
None | Do no manipulation of the Group / Variable layout.
|
ObsGroup | Transform "Variable@Group" into "Group/Variable". Ensure that group names match a few predefined keys.
|
ObsGroupODB | Uses an auxiliary YAML dictionary to convert ODB variable/group naming conventions to IODA equivalents. Transform "Variable@Group" into "Group/Variable". Ensure that the new group names match a few predefined keys.
|
Definition at line 38 of file Layout.h.
◆ ~DataLayoutPolicy()
ioda::detail::DataLayoutPolicy::~DataLayoutPolicy |
( |
| ) |
|
|
virtual |
◆ DataLayoutPolicy()
ioda::detail::DataLayoutPolicy::DataLayoutPolicy |
( |
| ) |
|
◆ _py_generate1()
static std::shared_ptr<const DataLayoutPolicy> ioda::detail::DataLayoutPolicy::_py_generate1 |
( |
const std::string & |
polid | ) |
|
|
inlinestatic |
◆ _py_generate2()
◆ doMap()
std::string ioda::detail::DataLayoutPolicy::doMap |
( |
const std::string & |
str | ) |
const |
|
virtual |
Map a user-specified Variable path to the correct location.
This allows us to keep the frontend paths consistent, and we can instead do a path transformation to hide implementation details from end users.
The default policy is to pass paths expressed with forward slashes ("MetaData/Longitude") unchanged. If we pass paths using '@' notation, then reverse the path component (i.e. "TB@ObsValue" becomes "ObsValue/TB").
- Note
- We can apply these policies in both the frontend and inside of the engines.
- Parameters
-
inStr | is the user-provided string. Ex: "TB@ObsValue" or "MetaData/Latitude", or even a fundamental dimension ("ChannelNumber"). |
- Returns
- A canonical path, always of the form "Group/Variable". In case of a dimension scale, then there is no group name, but for every other Variable, there is a Group name.
Reimplemented in ioda::detail::DataLayoutPolicy_ObsGroup_ODB, and ioda::detail::DataLayoutPolicy_ObsGroup.
Definition at line 70 of file Layout.cpp.
◆ generate() [1/4]
std::shared_ptr< const DataLayoutPolicy > ioda::detail::DataLayoutPolicy::generate |
( |
const std::string & |
polid, |
|
|
const std::string & |
mapPath |
|
) |
| |
|
static |
Factory generator (ODB-specific) mapPath
path to a yaml file that defines how input file variables should be renamed upon import to ioda.
Definition at line 39 of file Layout.cpp.
◆ generate() [2/4]
std::shared_ptr< const DataLayoutPolicy > ioda::detail::DataLayoutPolicy::generate |
( |
const std::string & |
polid = "" | ) |
|
|
static |
Factory generator.
Definition at line 28 of file Layout.cpp.
◆ generate() [3/4]
std::shared_ptr< const DataLayoutPolicy > ioda::detail::DataLayoutPolicy::generate |
( |
Policies |
pol, |
|
|
const std::string & |
mapPath |
|
) |
| |
|
static |
Factory generator (ODB-specific) mapPath
path to a yaml file that defines how input file variables should be renamed upon import to ioda.
Definition at line 50 of file Layout.cpp.
◆ generate() [4/4]
Factory generator.
Definition at line 34 of file Layout.cpp.
◆ getComplementaryPosition()
size_t ioda::detail::DataLayoutPolicy::getComplementaryPosition |
( |
const std::string & |
str | ) |
const |
|
virtual |
◆ getInputsNeeded()
size_t ioda::detail::DataLayoutPolicy::getInputsNeeded |
( |
const std::string & |
str | ) |
const |
|
virtual |
◆ getMergeMethod()
◆ getOutputNameFromComponent()
std::string ioda::detail::DataLayoutPolicy::getOutputNameFromComponent |
( |
const std::string & |
str | ) |
const |
|
virtual |
◆ getOutputVariableDataType()
std::type_index ioda::detail::DataLayoutPolicy::getOutputVariableDataType |
( |
const std::string & |
str | ) |
const |
|
virtual |
◆ getUnit()
std::pair< bool, std::string > ioda::detail::DataLayoutPolicy::getUnit |
( |
const std::string & |
| ) |
const |
|
virtual |
Returns the variable's unit if it has been specified.
- Returns
- A pair of (found, unit) indicating if a unit was found and what it is.
- Exceptions
-
If | the input is not listed in Variables section of mapping file. |
Reimplemented in ioda::detail::DataLayoutPolicy_ObsGroup_ODB.
Definition at line 96 of file Layout.cpp.
◆ initializeStructure()
void ioda::detail::DataLayoutPolicy::initializeStructure |
( |
Group_Base & |
| ) |
const |
|
virtual |
◆ isComplementary()
bool ioda::detail::DataLayoutPolicy::isComplementary |
( |
const std::string & |
str | ) |
const |
|
virtual |
◆ isMapped()
bool ioda::detail::DataLayoutPolicy::isMapped |
( |
const std::string & |
| ) |
const |
|
virtual |
◆ name()
std::string ioda::detail::DataLayoutPolicy::name |
( |
| ) |
const |
|
virtual |
The documentation for this class was generated from the following files: