# Path: loom/config.py
# DEFAULTS = {
#     'seed': 0,
#     'target_mem_bytes': 4e9,
#     'schedule': {
#         'extra_passes': 500.0,
#         'small_data_size': 4e3,
#         'big_data_size': 1e9,
#         'max_reject_iters': 100,
#         'checkpoint_period_sec': 1e9,
#     },
#     'kernels': {
#         'cat': {
#             'empty_group_count': 1,
#             'row_queue_capacity': 255,
#             'parser_threads': 6,
#         },
#         'hyper': {
#             'run': True,
#             'parallel': True,
#         },
#         'kind': {
#             'iterations': 32,
#             'empty_kind_count': 32,
#             'row_queue_capacity': 255,
#             'parser_threads': 6,
#             'score_parallel': True,
#         },
#     },
#     'posterior_enum': {
#         'sample_count': 100,
#         'sample_skip': 10,
#     },
#     'generate': {
#         'row_count': 100,
#         'density': 0.5,
#         'sample_skip': 10,
#     },
#     'query': {
#         'parallel': True,
#     },
# }


import os
import sys
import subprocess
import parsable
import loom.documented
import loom.config
import loom.store
from loom.config import DEFAULTS

@parsable.command
@loom.documented.transform(
    inputs=['ingest.schema_row', 'ingest.tares', 'ingest.rows'],
    outputs=['ingest.diffs'])
def sparsify(
        schema_row_in,
        tares_in,
        rows_in='-',
        rows_out='-',
        debug=False,
        profile=None):
    '''
    Sparsify dataset WRT tare rows.
    '''
    check_call_files(
        command=['sparsify', schema_row_in, tares_in, rows_in, rows_out],
        debug=debug,
        profile=profile,
        infiles=[schema_row_in, tares_in, rows_in],
        outfiles=[rows_out])


@parsable.command
@loom.documented.transform(
    inputs=['ingest.diffs', 'seed'],
    outputs=['samples.0.shuffled'])
def shuffle(
        rows_in,
        rows_out='-',

# Path: loom/config.py
# DEFAULTS = {
#     'seed': 0,
#     'target_mem_bytes': 4e9,
#     'schedule': {
#         'extra_passes': 500.0,
#         'small_data_size': 4e3,
#         'big_data_size': 1e9,
#         'max_reject_iters': 100,
#         'checkpoint_period_sec': 1e9,
#     },
#     'kernels': {
#         'cat': {
#             'empty_group_count': 1,
#             'row_queue_capacity': 255,
#             'parser_threads': 6,
#         },
#         'hyper': {
#             'run': True,
#             'parallel': True,
#         },
#         'kind': {
#             'iterations': 32,
#             'empty_kind_count': 32,
#             'row_queue_capacity': 255,
#             'parser_threads': 6,
#             'score_parallel': True,
#         },
#     },
#     'posterior_enum': {
#         'sample_count': 100,
#         'sample_skip': 10,
#     },
#     'generate': {
#         'row_count': 100,
#         'density': 0.5,
#         'sample_skip': 10,
#     },
#     'query': {
#         'parallel': True,
#     },
# }


# Path: loom/runner.py
import os
import sys
import subprocess
import parsable
import loom.documented
import loom.config
import loom.store
from loom.config import DEFAULTS


@parsable.command
@loom.documented.transform(
    inputs=['ingest.schema_row', 'ingest.tares', 'ingest.rows'],
    outputs=['ingest.diffs'])
def sparsify(
        schema_row_in,
        tares_in,
        rows_in='-',
        rows_out='-',
        debug=False,
        profile=None):
    '''
    Sparsify dataset WRT tare rows.
    '''
    check_call_files(
        command=['sparsify', schema_row_in, tares_in, rows_in, rows_out],
        debug=debug,
        profile=profile,
        infiles=[schema_row_in, tares_in, rows_in],
        outfiles=[rows_out])


@parsable.command
@loom.documented.transform(
    inputs=['ingest.diffs', 'seed'],
    outputs=['samples.0.shuffled'])
def shuffle(
        rows_in,
        rows_out='-',

        seed=DEFAULTS['seed'],