+ self._specification[u"static"] = self._cfg_yaml[idx]
+
+ logging.info(u"Done.")
+
+ def _parse_elements_tables(self, table):
+ """Parse tables from the specification YAML file.
+
+ :param table: Table to be parsed from the specification file.
+ :type table: dict
+ :raises PresentationError: If wrong data set is used.
+ """
+
+ try:
+ table[u"template"] = self._replace_tags(
+ table[u"template"],
+ self._specification[u"environment"][u"paths"])
+ except KeyError:
+ pass
+
+ # Add data sets
+ try:
+ for item in (u"reference", u"compare"):
+ if table.get(item, None):
+ data_set = table[item].get(u"data", None)
+ if isinstance(data_set, str):
+ table[item][u"data"] = \
+ self.configuration[u"data-sets"][data_set]
+ data_set = table[item].get(u"data-replacement", None)
+ if isinstance(data_set, str):
+ table[item][u"data-replacement"] = \
+ self.configuration[u"data-sets"][data_set]
+
+ if table.get(u"history", None):
+ for i in range(len(table[u"history"])):
+ data_set = table[u"history"][i].get(u"data", None)
+ if isinstance(data_set, str):
+ table[u"history"][i][u"data"] = \
+ self.configuration[u"data-sets"][data_set]
+ data_set = table[u"history"][i].get(
+ u"data-replacement", None)
+ if isinstance(data_set, str):
+ table[u"history"][i][u"data-replacement"] = \
+ self.configuration[u"data-sets"][data_set]
+
+ if table.get(u"columns", None):
+ for i in range(len(table[u"columns"])):
+ data_set = table[u"columns"][i].get(u"data-set", None)
+ if isinstance(data_set, str):
+ table[u"columns"][i][u"data-set"] = \
+ self.configuration[u"data-sets"][data_set]
+ data_set = table[u"columns"][i].get(
+ u"data-replacement", None)
+ if isinstance(data_set, str):
+ table[u"columns"][i][u"data-replacement"] = \
+ self.configuration[u"data-sets"][data_set]
+
+ except KeyError:
+ raise PresentationError(
+ f"Wrong data set used in {table.get(u'title', u'')}."
+ )
+
+ self._specification[u"tables"].append(table)
+
+ def _parse_elements_plots(self, plot):
+ """Parse plots from the specification YAML file.
+
+ :param plot: Plot to be parsed from the specification file.
+ :type plot: dict
+ :raises PresentationError: If plot layout is not defined.
+ """
+
+ # Add layout to the plots:
+ layout = plot[u"layout"].get(u"layout", None)
+ if layout is not None:
+ plot[u"layout"].pop(u"layout")
+ try:
+ for key, val in (self.configuration[u"plot-layouts"]
+ [layout].items()):
+ plot[u"layout"][key] = val
+ except KeyError:
+ raise PresentationError(
+ f"Layout {layout} is not defined in the "
+ f"configuration section."
+ )
+ self._specification[u"plots"].append(plot)
+
+ def _parse_elements_files(self, file):
+ """Parse files from the specification YAML file.
+
+ :param file: File to be parsed from the specification file.
+ :type file: dict
+ """
+
+ try:
+ file[u"dir-tables"] = self._replace_tags(
+ file[u"dir-tables"],
+ self._specification[u"environment"][u"paths"])
+ except KeyError:
+ pass
+ self._specification[u"files"].append(file)
+
+ def _parse_elements_cpta(self, cpta):
+ """Parse cpta from the specification YAML file.
+
+ :param cpta: cpta to be parsed from the specification file.
+ :type cpta: dict
+ :raises PresentationError: If wrong data set is used or if plot layout
+ is not defined.
+ """