materials_commons.cli.subcommands.dataset module

class materials_commons.cli.subcommands.dataset.DatasetSubcommand[source]

Bases: materials_commons.cli.list_objects.ListObjects

Args: cmdname: List[str]

Names to use for ‘mc X Y …’, for instance: [“casm”, “prim”] for “mc casm prim”

typename: str

With capitalization, for instance: “Process”

typename_plural: str

With capitalization, for instance: “Processes”

desc: str

Used for help command description

requires_project: bool

If True and not in current project, raise MCCLIException

non_proj_member: bool

Enable get_all_from_remote. If non_proj_member and proj_member, enable –all option to query all projects.

proj_member: bool

Enable get_all_from_project. Restrict queries to current project by default

expt_member: bool

Enable get_all_from_experiment. Include –expt option to restrict queries to current experiment

dataset_member: bool

Enable get_all_from_dataset. Includes –dataset option to restrict queries to specified dataset

list_columns: List[str]

List of column names

headers: List[str]

List of column header names, use list_columns if None

deletable: bool

If true, enable –delete

dry_runable: bool

If true, enable –dry-run

has_owner: bool

If true, enable –owner

creatable: bool

If true, object can be created via derived class ‘create’ function

custom_actions: List of str
Custom action names which are called via:

<name>(self, args, outout=sys.stdout)

custom_selection_actions: List of str
Custom action names which are called via:

<name>(self, objects, args, outout=sys.stdout)

request_confirmation_actions: Dict of name:msg

Dictionary of names of custom_selection_actions which require prompting the user for confirmation before executing. The value is the message shown at the prompt. Delete is always confirmed and is not included here.

add_custom_options(parser)[source]
clone_as(objects, args, out=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)[source]

Create a new dataset with the selected dataset’s file selection, samples, and processes

create(args, out=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)[source]

Create new dataset

Using:

mc dataset –create [–desc <dataset description>] <dataset_name>

delete(objects, args, dry_run, out=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)[source]

Delete datasets

Using:

mc dataset –id <dataset_id> –proj –delete mc dataset <dataset_name_search> –proj –delete

desc = 'List, create, publish, and download datasets. By default lists project datasets. With `--all` lists all public datasets.'
down(objects, args, out=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)[source]

Download dataset zipfile, –down

Note

The downloaded dataset is named dataset.<dataset_uuid>.zip

get_all_from_project(proj)[source]
get_all_from_remote(remote)[source]
goto(objects, args, out=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)[source]

Open selected datasets in a web browser

goto_globus(objects, args, out=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)[source]

Open globus manager for selected datasets in a web browser

list_data(obj, args)[source]
print_details(obj, args, out=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)[source]
publish(objects, args, out=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)[source]

Publish public dataset

Using:

mc dataset –id <dataset_id> –proj –publish mc dataset <dataset_name_search> –proj –publish

unpublish(objects, args, out=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)[source]

Unpublish dataset

Using:

mc dataset –id <dataset_id> –proj –unpublish mc dataset <dataset_name_search> –proj –unpublish

materials_commons.cli.subcommands.dataset.make_parser()[source]

Make argparse.ArgumentParser for mc dataset

materials_commons.cli.subcommands.dataset.print_dataset_details(client, project_id, dataset, file_selection=False, out=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)[source]
materials_commons.cli.subcommands.dataset.print_published_dataset_details(client, dataset, out=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)[source]