isofit.data.build_examples

Builds the examples from their template files for a given ISOFIT ini

Attributes

Bash

Pyth

OEScript

Examples

Classes

Example

IsofitExample

Template for building scripts that directly call the Isofit object

ApplyOEExample

Template for building scripts that use apply_oe

Functions

update(obj, **flags)

Recursively updates string values with .format. This operation occurs in-place.

updateTemplate(template[, output])

Updates a given template and writes it out to another file

createScript(script, template)

Creates an executable script file for a given template and arguments

build(example[, validate])

Builds an example directory

cli(example, no_validate)

Builds the ISOFIT examples

Module Contents

Bash[source]
Pyth[source]
OEScript[source]
class Example(name, requires, validate={})[source]
name[source]
requires[source]
validate_flags[source]
validate()[source]

Passthrough method to validate required ISOFIT downloads

setPath(path)[source]

Sets the working path for the example

Parameters:

path (pathlib.Path) – Base path to the directory in which the example is located

Returns:

Returns False if the example directory is not found

Return type:

None | False

abstract build()[source]
makeConfigs()[source]

Creates configs based off the template files from an example directory

class IsofitExample(name, requires, validate={})[source]

Bases: Example

Template for building scripts that directly call the Isofit object

build()[source]

Makes a formatted bash script

Parameters:
  • example (pathlib.Path) – Path to the example root

  • path (pathlib.Path) – Path to the subset of scripts to generate scripts for

makeScripts(path)[source]
class ApplyOEExample(name, requires, validate={})[source]

Bases: Example

Template for building scripts that use apply_oe

build()[source]
makeApplyOE(path)[source]

Creates apply_oe scripts using ‘args’ template files

Examples[source]
update(obj, **flags)[source]

Recursively updates string values with .format. This operation occurs in-place.

Parameters:

obj (dict | list) – Object to iterate over each child value and attempt to format

updateTemplate(template: str, output: str = None)[source]

Updates a given template and writes it out to another file

Parameters:
  • template (str) – Path to template file to load and update

  • output (str, default=None) – Path to write the updated template to

Returns:

config – The updated template dictionary

Return type:

dict

createScript(script: str, template: dict)[source]

Creates an executable script file for a given template and arguments

Parameters:
  • script (str) – Path to write the script to

  • template (dict) – Template being used (eg. Bash or Pyth)

build(example, validate=True)[source]

Builds an example directory

Parameters:
  • example (pathlib.Path) – Path to the example root

  • validate (bool, default=True) – Validates the required extra downloads for each example. Disabling this will allow examples to build but does not guarantee they will work

cli(example, no_validate)[source]

Builds the ISOFIT examples