__main__#

Calling module for the SkySim package.

class skysim.__main__.CustomArgumentParser(prog=None, usage=None, description=None, epilog=None, parents=[], formatter_class=<class 'argparse.HelpFormatter'>, prefix_chars='-', fromfile_prefix_chars=None, argument_default=None, conflict_handler='error', add_help=True, allow_abbrev=True, exit_on_error=True)[source]

Override of the default ArgumentParser to change the error message.

error(message: string)[source]

Prints a usage message incorporating the message to stderr and exits.

If you override this in a subclass, it should not return – it should either exit or raise an exception.

Entrypoint#

skysim.__main__.main(args=None)[source]#

Entrypoint for the SkySim package.

Calls the following functions directly:

Parameters:
argslist[str] | None , default None

When called via command line, this is None, and argparse captures the arguments directly. When running main() inside of python (e.g., with pytest), args holds a list of arguments.

Returns:
pathlib.Path

Path object to the created file. Returned if --debug flag is set.

None

Returned if --debug flag is unset.

Raises:
ValueError, ConnectionError

Re-raised from their creation inside the SkySim code if and only if the –debug flag is set.

SystemExit

Supercedes internal errors to produce a cleaner error message if the –debug flag is not set.

Additional Functions#

parse_cli_args(args)

Parse command line arguments.

confirm_config_file(input_config_path)

Pre-validate the existence of a config file.

handle_overwrite(plot_settings, options)

Check if files will be overwritten and take action based on cli flags (--verbose and --overwrite).

check_for_overwrite(plot_settings)

Check if SkySim will overwrite any existing files.