topostats.run_modules#

Run TopoStats modules.

This provides an entry point for running TopoStats as a command line programme.

Attributes#

Functions#

reconcile_config_args(→ dict)

Reconcile command line arguments with the default configuration.

_set_logging(→ None)

Set the logging level.

_log_setup(→ None)

Log the current configuration.

_parse_configuration(→ tuple[dict, dict])

Load configurations, validate and check run steps are consistent.

process(→ None)

Find and process all files.

filters(→ None)

Load files from disk and run filtering.

grains(→ None)

Load files from disk and run grain finding.

grainstats(→ None)

Load files from disk and run grainstats.

disordered_tracing(→ None)

Load files from disk and run grainstats.

nodestats(→ None)

Load files from disk and run grainstats.

ordered_tracing(→ None)

Load files from disk and run grainstats.

splining(→ None)

Load files from disk and run grainstats.

Module Contents#

topostats.run_modules.LOGGER#
topostats.run_modules.reconcile_config_args(args: argparse.Namespace | None) dict[source]#

Reconcile command line arguments with the default configuration.

Command line arguments take precedence over the default configuration. If a partial configuration file is specified (with ‘-c’ or ‘–config-file’) the defaults are over-ridden by these values (internally the configuration dictionary is updated with these values). Any other command line arguments take precedence over both the default and those supplied in a configuration file (again the dictionary is updated).

The final configuration is validated before processing begins.

Parameters:

args (argparse.Namespace) – Command line arguments passed into TopoStats.

Returns:

The configuration dictionary.

Return type:

dict

topostats.run_modules._set_logging(log_level: str | None) None[source]#

Set the logging level.

Parameters:

log_level (str) – String for the desired log-level.

topostats.run_modules._log_setup(config: dict, args: argparse.Namespace | None, img_files: dict) None[source]#

Log the current configuration.

Parameters:
  • config (dict) – Dictionary of configuration options.

  • args (argparse.Namespace | None) – Arguments function was invoked with.

  • img_files (dict) – Dictionary of image files that have been found.

topostats.run_modules._parse_configuration(args: argparse.Namespace | None = None) tuple[dict, dict][source]#

Load configurations, validate and check run steps are consistent.

Parameters:

args (None) – Arguments.

Returns:

Returns the dictionary of configuration options and a dictionary of image files found on the input path.

Return type:

tuple[dict, dict]

topostats.run_modules.process(args: argparse.Namespace | None = None) None[source]#

Find and process all files.

Parameters:

args (None) – Arguments.

topostats.run_modules.filters(args: argparse.Namespace | None = None) None[source]#

Load files from disk and run filtering.

Parameters:

args (None) – Arguments.

topostats.run_modules.grains(args: argparse.Namespace | None = None) None[source]#

Load files from disk and run grain finding.

Parameters:

args (None) – Arguments.

topostats.run_modules.grainstats(args: argparse.Namespace | None = None) None[source]#

Load files from disk and run grainstats.

Parameters:

args (None) – Arguments.

topostats.run_modules.disordered_tracing(args: argparse.Namespace | None = None) None[source]#

Load files from disk and run grainstats.

Parameters:

args (None) – Arguments.

topostats.run_modules.nodestats(args: argparse.Namespace | None = None) None[source]#

Load files from disk and run grainstats.

Parameters:

args (None) – Arguments.

topostats.run_modules.ordered_tracing(args: argparse.Namespace | None = None) None[source]#

Load files from disk and run grainstats.

Parameters:

args (None) – Arguments.

topostats.run_modules.splining(args: argparse.Namespace | None = None) None[source]#

Load files from disk and run grainstats.

Parameters:

args (None) – Arguments.