Reference of internal modules¶
commandfile
Module¶
- class anduril.commandfile.CommandFile¶
Bases:
object
Provides access to the filenames of input and output ports as well as parameters values.
- classmethod from_file(filename)¶
Parse a command file and return a corresponding CommandFile instance. Raise ValueError if there are errors in the command file. Raise IOError if the command file can not be read. Raise TypeError if filename is of incorrect type.
- get_filename()¶
- get_input(port_name)¶
Return the filename corresponding to given input port, or None if the port does not exist or if the filename is not defined.
- get_input_array_index(port_name)¶
Return the filename corresponding to given input port index file, or None if the port does not exist or if the filename is not defined.
- get_input_ports()¶
Return a list of input port names.
- get_metadata(metadata_name)¶
Return the value of a metadata item, or None if the item is not defined. The value is always a string, if defined.
- get_output(port_name)¶
Return the filename corresponding to given output port, or None if the port does not exist or if the filename is not defined.
- get_output_array_index(port_name)¶
Return the filename corresponding to given output port index file, or None if the port does not exist or if the filename is not defined.
- get_output_ports()¶
Return a list of output port names.
- get_parameter(param_name, param_type='string')¶
Return the value of an parameter, or None if the parameter is not defined. For string parameters, the empty string is a possible output value. The type of the returned object depends on param_type. Legal values are “string”, “int”, “float” and “boolean”. For example, if param_type is “boolean”, the parameter is converted to a Python bool object. Raise ValueError if a numeric or Boolean conversion fails.
- get_parameter_list()¶
Return a list of parameter names.
- get_tempdir()¶
Create a temporary directory or reuse one, and return the location as a string.
- set_filename(filename)¶
- set_input(port_name, filename)¶
Set the filename corresponding to given input port.
- set_metadata(metadata_name, value)¶
Set the value of a metadata item.
- set_output(port_name, filename)¶
Set the filename corresponding to given output port.
- set_parameter(param_name, value)¶
Set the value of a parameter.
- write_error(message)¶
Write a message to the error stream.
- write_log(message)¶
Write a message to the log stream.
- write_to_file(filename=None)¶
- anduril.commandfile.string_record_to_dict(s)¶
Converts a std.recordToString() string into a Dict of key=value pairs. The types are guessed. Returns either bool, int, float or str type values.
>>> record_dict = anduril.string_record_to_dict("key1=value1,key2=value2"); >>> print(record_dict['key1']) 'value1'
componentfile
Module¶
- class anduril.componentfile.ComponentFile(filename)¶
Bases:
object
A class representing component.xml files.
- get_author()¶
- get_category()¶
- get_doc()¶
- get_documentation()¶
- get_input_doc(input)¶
- get_input_type(input)¶
- get_inputs()¶
- get_launcher()¶
- get_launcher_argument(name)¶
- get_name()¶
- get_output_doc(output)¶
- get_output_type(output)¶
- get_outputs()¶
- get_parameter_default(parameter)¶
- get_parameter_doc(parameter)¶
- get_parameter_type(parameter)¶
- get_parameters()¶
- get_path()¶
- get_requirements()¶
- get_testcases()¶
- get_version()¶
- input_is_array(input)¶
- input_is_optional(input)¶
- is_function()¶
- iter_inputs()¶
- iter_outputs()¶
- iter_parameters()¶
- output_is_array(output)¶
bundlerepository
Module¶
- class anduril.bundlerepository.Bundle¶
Bases:
object
Provides access to the components.
- classmethod from_folder(path)¶
Parse environment and return a corresponding Repository instance. Raise ValueError if there are errors in the Bundles.
- get_component(name)¶
Return the Component corresponding to given name, or None if the Component does not exist.
- get_components()¶
Return the components.
- get_depends()¶
Get a list of dependencies
- get_name()¶
return bundle name
- get_path()¶
return bundle path
- search_component(key)¶
Return a list of tuples of Components with match type.
- set_component(component)¶
Set a new component in the Bundle.
- set_depends(name)¶
Add a dependency
- set_name(name)¶
set bundle name
- set_path(path)¶
set bundle name
- class anduril.bundlerepository.Repository¶
Bases:
object
Provides access to the bundles.
- classmethod from_env()¶
Parse environment and return a corresponding Repository instance. Raise ValueError if there are errors in the Bundles.
- get_all_component_names()¶
Return all components as a list of bundle and component.
- get_bundle(name)¶
Return the Bundle corresponding to given name, or None if the bundle does not exist.
- get_bundle_names()¶
Return the Bundle names as a list.
- get_bundles()¶
Return the Bundles.
- get_component(name, bundle=None)¶
Return component and the bundle it is found in. If multiple components with same name, first returned. Help search by providing bundle name.
- get_components(name)¶
Return the components of a named bundle.
- search_component(key)¶
Return a list of tuples of Components with match type.
- search_component_close_match(key)¶
Return a list of Components whose name closely matches key
- set_bundle(name, bundle)¶
Set a new bundle in the Repository.
statefile
Module¶
- class anduril.statefile.NetworkNode(row, path)¶
Bases:
object
- delete_family()¶
- get_children()¶
- get_component()¶
- get_disabled()¶
- get_endtime()¶
- get_errorfile()¶
- get_input(name)¶
- get_input_instances()¶
- get_input_size(name, numeric=False)¶
- get_input_values()¶
- get_inputnames()¶
- get_inputs()¶
- get_logfile()¶
- get_name()¶
- get_numfiles()¶
- get_output(name)¶
- get_output_size(name, numeric=False)¶
- get_outputnames()¶
- get_parameter_dict()¶
- get_parameters()¶
- get_parents()¶
- get_parents_list(others)¶
- get_path()¶
- get_port_size(path)¶
- get_runtime()¶
- get_starttime()¶
- get_suretime()¶
- get_version()¶
- parserow()¶
- set_cf()¶
- set_children(others)¶
- set_family(others)¶
- set_input_sizes()¶
- set_output_sizes()¶
- set_parents(others)¶
- set_port_sizes()¶
- set_stats()¶
- anduril.statefile.humanize_size(size, precision=1)¶
- anduril.statefile.i_sort(s)¶
Instace name sorter
generators.documentation
Module¶
- anduril.generators.documentation.component_markdown(component, short, bundle=None)¶
Print component documentation with markdown syntax
returns string
- args:
component Anduril ComponentFile object
short Boolean, if True, returns short listing
bundle optional string, written as Bundle name
generators.script
Module¶
- anduril.generators.script.code_input_replace(code, repository, bundle=None)¶
Replace input files with a INPUT component instance
- anduril.generators.script.component_usage(component)¶
Return string of component example usage
- anduril.generators.script.copy_to_clipboard(s)¶
Use command xclip to copy string to clip board
- anduril.generators.script.head_foot(name='')¶
Generate header and footer for an anduril script
- anduril.generators.script.testcase(bundle, component, testcase)¶
Return Anduril script to run a testcase for a component.
- example:
repository=Repository.from_env()
bundle=repository.get_bundle(“my_bundle_name”)
print(testcase(bundle, “component_name”, “case1”))
- anduril.generators.script.validate_testcases(bundle_name=None)¶
Return a list of broken test cases. Creates the bundle repository from env (ANDURIL_BUNDLES)