Command-line Interface

Quick Reference

datamodel

Command-line tool for handling SDSS datamodels

datamodel [OPTIONS] COMMAND [ARGS]...

Commands

design

Design a new datamodel for a new file

generate

Generate a datamodel file for a SDSS data product

install

Install a user copy of the datamodel product at Utah

move

Move a datamodel from one location to another

remove

Remove a release from a datamodel

tree

Interact with the SDSS tree product

update

Update datamodels with new template content

validate

Commands related to datamodel validation

Commands

generate

Generate a datamodel file for a SDSS data product

generate [OPTIONS]

Options

-n, --filename <filename>

the name of a file on disk

-f, --file_species <file_species>

unique name of the product file species

-p, --path <path>

symbolic path to the file

-l, --location <location>

symbolic location of the file

-e, --env_label <env_label>

environment variable name of the root location

-k, --keywords <keywords>

template variable keyword=value pair(s)

-a, --access_path_name <access_path_name>

name of the sdss_access path, if different than file species

-s, --science_product

set product as a recommended science product

-t, --tree_ver <tree_ver>

the SDSS tree configuration

-r, --release <release>

the SDSS data release

-F, --force

force override of a stub cache

-Fr, --force-release <force_release>

a specific release to force override

-c, --use-cache <use_cache>

specify an existing cached release to use

-h, --hdus-only

set to True to only use the user descriptions/comments from the specified cached release

-m, --md-group <md_group>

the release group to use when writing out the example markdown file

Options:

WORK | IPL | DR

-v, --verbose

turn on verbosity

-w, --with-git

set to use the auto git commit process

design

Design a datamodel for a new file

design [OPTIONS]

Options

-f, --file_species <file_species>

Required unique name of the product file species

-p, --path <path>

symbolic path to the file

-l, --location <location>

symbolic location of the file

-e, --env_label <env_label>

environment variable name of the root location

-c, --create

create a file on disk from a designed datamodel

-k, --keywords <keywords>

optional keywords into DataModel.generate_designed_file

-v, --verbose

turn on verbosity

install

Install the datamodel product at Utah

install [OPTIONS]

Options

-b, --branch <branch>

install a specific branch of the datamodel product

-F, --force

force a (re)install of the datamodel product

-v, --verbose

turn on verbosity

-d, --debug

turn on debugging

-t, --test

test the install without installing

tree

Interact with the SDSS tree product

tree [OPTIONS] COMMAND [ARGS]...

add

Add new access paths into the tree git product

tree add [OPTIONS]

Options

-r, --release <release>

the SDSS data release

-w, --work-ver <work_ver>

the SDSS tree config work version, i.e. sdss5 or sdsswork

-b, --branch <branch>

install a specific branch of the tree product

-l, --local

use an existing local tree repo

-t, --test

test the update without performing write ops

-s, --skip-push

skips the git push step

check

Check the product path definitions are correct in tree

tree check [OPTIONS]

Options

-r, --release <release>

the SDSS data release

-v, --verbose

turn on verbosity

update-dm

Update datamodel stubs with new access paths

tree update-dm [OPTIONS]

Options

-b, --branch <branch>

install a specific branch of the datamodel product

-t, --test

test the update without performing write ops

-c, --commit-to-git

manually commit to git

validate

Commands related to datamodel validation

validate [OPTIONS] COMMAND [ARGS]...

check

Check that all YAML datamodel have corresponding JSON datamodels

validate check [OPTIONS]

redo

Rewrite all datamodel stubs for a given file species

validate redo [OPTIONS]

Options

-f, --file_species <file_species>

Required unique name of the product file species

-r, --release <release>

the SDSS data release

-v, --verbose

turn on verbosity

move

Move a datamodel from a SANDBOX to a final location

move [OPTIONS]

Options

-s, --file_species <file_species>

Required unique name of the product file species

-f, --from-release <from_release>

Required the release to move from

-t, --to-release <to_release>

Required the release to move to

-p, --to-path <to_path>

the new abstract path

-e, --to-envvar <to_envvar>

the new envvar

-v, --verbose

turn on verbosity

-m, --move

move the example file

-r, --parent

move the example file parent directory

-l, --symlink

create a symlink from the old to the new file

-c, --species

move an entire file species

-n, --test

test without moving

update

Update existing datamodels with any new content added into the template

update [OPTIONS]

Options

-f, --file_species <file_species>

unique name of the product file species

-r, --release <release>

Required the SDSS data release

-v, --verbose

turn on verbosity

remove

Remove a release from a datamodel

remove [OPTIONS]

Options

-f, --file_species <file_species>

Required unique name of the product file species

-r, --release <release>

Required the SDSS data release

-v, --verbose

turn on verbosity

Cli Differences

In datamodel 0.2.1, the command-line tools switched from argparse to click for improved cli handling and consolidation of sub-commands under an umbrella cli. The behavior and syntax is mostly the same with the exception of the following:

  • commands are no longer snake case, but rather two separate words. i.e. datamodel_generate -> datamodel generate

  • each -k, --keywords argument to datamodel generate must now be specified individually, as click does not allow the equivalent of narg="*". See click multiple vs argparse nargs. i.e. -k plate=8485 ifu=1901 -> -k plate=8485 -k ifu=1901

For backwards compatibility, we retain the original snake_case scripts, which call the underlying click command. If you pip-install the datamodel product, you can call ``