gunshotmatch_pipeline.projects
Metadata for project pipelines.
Classes:
|
Settings applied for all projects. |
Mixin class providing |
|
|
Settings for a specific project. |
|
Reference data projects to process through the pipeline. |
Functions:
|
Process projects with common methods and config. |
-
class
GlobalSettings(output_directory='output', method=None, config=None, data_directory=None)[source] Bases:
Config,LoaderMixinSettings applied for all projects.
- Parameters
output_directory (
str) – Relative or absolute path to the directory the output files should be placed in. Default'output'.method (
Optional[str]) – Relative or absolute filename to the method TOML file. The table name is “method”. DefaultNone.config (
Optional[str]) – Relative or absolute filename to the configuration TOML file. The table name is “config”. DefaultNone.data_directory (
Optional[str]) – Relative or absolute path to the directory containing the data files. DefaultNone.
The method and config files may point to the same TOML file.
Attributes:
Relative or absolute filename to the configuration TOML file.
Relative or absolute path to the directory containing the data files.
Relative or absolute filename to the method TOML file.
Relative or absolute path to the directory the output files should be placed in.
-
config -
Relative or absolute filename to the configuration TOML file. The table name is “gunshotmatch”.
-
data_directory -
Relative or absolute path to the directory containing the data files.
-
method -
Relative or absolute filename to the method TOML file. The table name is “method”.
-
class
LoaderMixin[source] Bases:
objectMixin class providing
load_method()andload_config()methods.Methods:
Load the configuration for this project from the specified file.
Load the method for this project from the specified file.
-
class
ProjectSettings(name, datafiles, method=None, config=None, data_directory=None)[source] Bases:
Config,LoaderMixinSettings for a specific project.
- Parameters
name (
str) – The project name.datafiles (
List[str]) – List of input datafiles (paths relative to the data_directory option)method (
Optional[str]) – Relative or absolute filename to the method TOML file. The table name is “method”. DefaultNone.config (
Optional[str]) – Relative or absolute filename to the configuration TOML file. The table name is “config”. DefaultNone.data_directory (
Optional[str]) – Relative or absolute path to the directory containing the data files. DefaultNone.
Attributes:
Relative or absolute filename to the configuration TOML file.
Relative or absolute path to the directory containing the data files.
List of input datafiles (paths relative to the data_directory option)
Relative or absolute filename to the method TOML file.
The project name.
Methods:
Returns an iterator over paths to the datafiles.
-
config -
Relative or absolute filename to the configuration TOML file. The table name is “config”.
-
data_directory -
Relative or absolute path to the directory containing the data files.
-
get_datafile_paths()[source] Returns an iterator over paths to the datafiles.
The paths start with
data_directoryif set.
-
method -
Relative or absolute filename to the method TOML file. The table name is “method”.
-
class
Projects(global_settings=GlobalSettings(output_directory='output', method=None, config=None, data_directory=None), per_project_settings={})[source] Bases:
ConfigReference data projects to process through the pipeline.
- Parameters
global_settings (
GlobalSettings) – Settings applied for all projects. DefaultGlobalSettings(output_directory='output', method=None, config=None, data_directory=None).per_project_settings (
Dict[str,ProjectSettings]) – Settings for specific projects. Default{}.
Methods:
from_json(json_string)Parse a
Projectsfrom a JSON string.from_toml(toml_string)Parse a
Projectsfrom a TOML string.get_project_settings(project_name)Returns the settings for the given project, taking into account the global settings.
Returns whether all projects have common configuration.
Returns whether all projects have a common method.
Iterate
Projectobjects loaded from disk.Iterate over the per-project settings, taking into account the global settings.
load_project(project_name)Load a previously created project.
to_toml()Convert a
Configurationto a TOML string.Attributes:
Settings applied for all projects.
Settings for specific projects.
-
get_project_settings(project_name)[source] Returns the settings for the given project, taking into account the global settings.
- Parameters
project_name (
str)- Return type
-
global_settings Type:
GlobalSettingsSettings applied for all projects.
-
iter_project_settings()[source] Iterate over the per-project settings, taking into account the global settings.
- Return type
-
per_project_settings Type:
Dict[str,ProjectSettings]Settings for specific projects.
-
to_toml()[source] Convert a
Configurationto a TOML string.- Return type