mp_time_split package

Subpackages

Submodules

mp_time_split.core module

This is a skeleton file that can serve as a starting point for a Python console script. To run this script uncomment the following lines in the [options.entry_points] section in setup.cfg:

console_scripts =
     fibonacci = ${package}.skeleton:run

Then run pip install . (or pip install -e . for editable mode) which will install the command fibonacci inside your current environment. Besides console scripts, the header (i.e. until _logger…) of this file can also be used as template for Python modules. .. note:: This file can be renamed depending on your needs or safely removed if not needed.

References

class mp_time_split.core.MPTimeSplit(num_sites: Tuple[int, int] | None = None, elements: List[str] | None = None, exclude_elements: List[str] | Literal['noble', 'radioactive', 'noble+radioactive'] | None = None, use_theoretical: bool = False, mode: str = 'TimeSeriesSplit', target: str = 'energy_above_hull', save_dir=None)[source]

Bases: object

fetch_data(one_by_one=False)[source]
get_test_data()[source]
get_train_and_val_data(fold)[source]
load(url=None, checksum=None, dummy=False, force_download=False)[source]
mp_time_split.core.fib(n)[source]

Fibonacci example function

Parameters:

n (int) – integer

Returns:

n-th Fibonacci number

Return type:

int

mp_time_split.core.get_data_home(data_home=None)[source]

Selects the home directory to look for datasets, if the specified home directory doesn’t exist the directory structure is built

Modified from source: https://github.com/hackingmaterials/matminer/blob/76a529b769055c729d62f11a419d319d8e2f838e/matminer/datasets/utils.py#L26-L43 # noqa:E501

Parameters:

data_home (str) – folder to look in, if None a default is selected

Returns (str)

mp_time_split.core.main(args)[source]

Wrapper allowing fib() to be called with string arguments in a CLI fashion Instead of returning the value from fib(), it prints the result to the stdout in a nicely formatted message. :param args: command line parameters as list of strings

(for example ["--verbose", "./data"]).

mp_time_split.core.parse_args(args)[source]

Parse command line parameters :param args: command line parameters as list of strings

(for example ["--help"]).

Returns:

command line parameters namespace

Return type:

argparse.Namespace

mp_time_split.core.run()[source]

Calls main() passing the CLI arguments extracted from sys.argv This function can be used as entry point to create console scripts with setuptools.

mp_time_split.core.setup_logging(loglevel)[source]

Setup basic logging :param loglevel: minimum loglevel for emitting messages :type loglevel: int

Module contents