# Path: clustertools/datacube.py
# def build_datacube(exp_name, storage_factory=PickleStorage, force=True,
#                    autopacking=False, **default_meta):
#     """
#     default_meta: mapping str -> str
#         The (potientially) missing metadata
#     """
#     storage = storage_factory(experiment_name=exp_name)
#     parameters_ls, results_ls = storage.load_params_and_results(**default_meta)
#     return Datacube(parameters_ls, results_ls, exp_name, force=force,
#                     autopacking=autopacking)


import sys
import argparse
        import numpy as np
from clustertools import build_datacube
`BasicUsage`. Under the hood, Clustertools generated the individual
computations, managed their states and logging and saved the results.

We are now ready to load all the results and analyze them. Clustertools provides
a `Datacube` class, easily built throught the function `build_datacube` which
expects the name of the experiment.

`Datacube` is built around two main concepts. On the one hand, we have the
inputs of the computations, which are called variables. On the other, we have
the results, which are called -- drum roll -- results.

We can further distinguish between two types of variables. When a variable has
the same value throughout the whole experiment, it is a constant or as we call
it, a metadata. If it is not a metadata, it is a paremeter. The different values
it can take form the domain of that parameter.

To see the content of that datacube, run `python 002_results.py`
"""

if __name__ == '__main__':
    parser = argparse.ArgumentParser(description=__DOC__,
                                     formatter_class=argparse.RawTextHelpFormatter)
    parser.add_argument('-s', '--suffix', default='',
                        help='A suffix to name the experiment '
                             '(will be added to \'Basic usage\'')
    args = parser.parse_args()
    exp_name = "BasicUsage{}".format(args.suffix)

    # Load the data of experiment `BasicUsage` (from `001_basic_usage.py`) and
    # create a datacube with it.

# Path: clustertools/datacube.py
# def build_datacube(exp_name, storage_factory=PickleStorage, force=True,
#                    autopacking=False, **default_meta):
#     """
#     default_meta: mapping str -> str
#         The (potientially) missing metadata
#     """
#     storage = storage_factory(experiment_name=exp_name)
#     parameters_ls, results_ls = storage.load_params_and_results(**default_meta)
#     return Datacube(parameters_ls, results_ls, exp_name, force=force,
#                     autopacking=autopacking)


# Path: examples/002_results.py
import sys
import argparse
        import numpy as np
from clustertools import build_datacube

`BasicUsage`. Under the hood, Clustertools generated the individual
computations, managed their states and logging and saved the results.

We are now ready to load all the results and analyze them. Clustertools provides
a `Datacube` class, easily built throught the function `build_datacube` which
expects the name of the experiment.

`Datacube` is built around two main concepts. On the one hand, we have the
inputs of the computations, which are called variables. On the other, we have
the results, which are called -- drum roll -- results.

We can further distinguish between two types of variables. When a variable has
the same value throughout the whole experiment, it is a constant or as we call
it, a metadata. If it is not a metadata, it is a paremeter. The different values
it can take form the domain of that parameter.

To see the content of that datacube, run `python 002_results.py`
"""

if __name__ == '__main__':
    parser = argparse.ArgumentParser(description=__DOC__,
                                     formatter_class=argparse.RawTextHelpFormatter)
    parser.add_argument('-s', '--suffix', default='',
                        help='A suffix to name the experiment '
                             '(will be added to \'Basic usage\'')
    args = parser.parse_args()
    exp_name = "BasicUsage{}".format(args.suffix)

    # Load the data of experiment `BasicUsage` (from `001_basic_usage.py`) and
    # create a datacube with it.

    cube = build_datacube(exp_name)