+ 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.
+ """
+
+ for plot in cpta[u"plots"]:
+ # Add layout to the plots:
+ layout = plot.get(u"layout", None)
+ if layout is not None:
+ try:
+ plot[u"layout"] = \
+ self.configuration[u"plot-layouts"][layout]
+ except KeyError:
+ raise PresentationError(
+ f"Layout {layout} is not defined in the "
+ f"configuration section."
+ )
+ # Add data sets:
+ if isinstance(plot.get(u"data", None), str):
+ data_set = plot[u"data"]
+ try:
+ plot[u"data"] = \
+ self.configuration[u"data-sets"][data_set]
+ except KeyError:
+ raise PresentationError(
+ f"Data set {data_set} is not defined in "
+ f"the configuration section."
+ )
+ self._specification[u"cpta"] = cpta