isofit.data.build_examples ========================== .. py:module:: isofit.data.build_examples .. autoapi-nested-parse:: Builds the examples from their template files for a given ISOFIT ini Attributes ---------- .. autoapisummary:: isofit.data.build_examples.Bash isofit.data.build_examples.Pyth isofit.data.build_examples.OEScript isofit.data.build_examples.Examples Classes ------- .. autoapisummary:: isofit.data.build_examples.Example isofit.data.build_examples.IsofitExample isofit.data.build_examples.ApplyOEExample Functions --------- .. autoapisummary:: isofit.data.build_examples.update isofit.data.build_examples.updateTemplate isofit.data.build_examples.createScript isofit.data.build_examples.build isofit.data.build_examples.cli Module Contents --------------- .. py:data:: Bash .. py:data:: Pyth .. py:data:: OEScript .. py:class:: Example(name, requires, validate={}) .. py:attribute:: name .. py:attribute:: requires .. py:attribute:: validate_flags .. py:method:: validate() Passthrough method to validate required ISOFIT downloads .. py:method:: setPath(path) Sets the working path for the example :param path: Base path to the directory in which the example is located :type path: pathlib.Path :returns: Returns False if the example directory is not found :rtype: None | False .. py:method:: build() :abstractmethod: .. py:method:: makeConfigs() Creates configs based off the template files from an example directory .. py:class:: IsofitExample(name, requires, validate={}) Bases: :py:obj:`Example` Template for building scripts that directly call the Isofit object .. py:method:: build() Makes a formatted bash script :param example: Path to the example root :type example: pathlib.Path :param path: Path to the subset of scripts to generate scripts for :type path: pathlib.Path .. py:method:: makeScripts(path) .. py:class:: ApplyOEExample(name, requires, validate={}) Bases: :py:obj:`Example` Template for building scripts that use apply_oe .. py:method:: build() .. py:method:: makeApplyOE(path) Creates apply_oe scripts using 'args' template files .. py:data:: Examples .. py:function:: update(obj, **flags) Recursively updates string values with .format. This operation occurs in-place. :param obj: Object to iterate over each child value and attempt to format :type obj: dict | list .. py:function:: updateTemplate(template: str, output: str = None) Updates a given template and writes it out to another file :param template: Path to template file to load and update :type template: str :param output: Path to write the updated template to :type output: str, default=None :returns: **config** -- The updated template dictionary :rtype: dict .. py:function:: createScript(script: str, template: dict) Creates an executable script file for a given template and arguments :param script: Path to write the script to :type script: str :param template: Template being used (eg. Bash or Pyth) :type template: dict .. py:function:: build(example, validate=True) Builds an example directory :param example: Path to the example root :type example: pathlib.Path :param validate: Validates the required extra downloads for each example. Disabling this will allow examples to build but does not guarantee they will work :type validate: bool, default=True .. py:function:: cli(example, no_validate) Builds the ISOFIT examples