gradient package

Subpackages

Submodules

gradient.config module

gradient.config.get_api_key(config_dir_path, config_file_name)
gradient.config.get_help_colors_dict(use_colors, help_headers_color, help_options_color)
class gradient.config.config

Bases: object

DEBUG = True
CONFIG_HOST = 'https://dev-api.paperspace.io'
CONFIG_LOG_HOST = 'https://logs-dev.paperspace.io'
CONFIG_EXPERIMENTS_HOST = 'https://development-services.paperspace.io/experiments/v1'
CONFIG_EXPERIMENTS_HOST_V2 = 'https://services.paperspace.io/experiments/v2/'
CONFIG_SERVICE_HOST = 'https://development-services.paperspace.io'
CONFIG_DIR_PATH = '/home/togi/.paperspace'
CONFIG_FILE_NAME = 'config.json'
PAPERSPACE_API_KEY = '66ca3c0b014fb4aea09a24772cf4f8'
HELP_HEADERS_COLOR = 'yellow'
HELP_OPTIONS_COLOR = 'green'
USE_CONSOLE_COLORS = True
HELP_COLORS_DICT = {'help_headers_color': 'yellow', 'help_options_color': 'green'}
USE_VPC = False

gradient.constants module

class gradient.constants.ExperimentType

Bases: object

SINGLE_NODE = 1
GRPC_MULTI_NODE = 2
MPI_MULTI_NODE = 3
HYPERPARAMETER_TUNING = 4
classmethod get_type_str(state_int)
class gradient.constants.ExperimentState

Bases: object

CREATED = 1
PROVISIONED = 2
NETWORK_SETUP = 3
RUNNING = 4
STOPPED = 5
ERROR = 6
FAILED = 7
CANCELLED = 8
NETWORK_TEARDOWN = 9
PENDING = 10
PROVISIONING = 11
NETWORK_SETTING_UP = 12
NETWORK_TEARING_DOWN = 13
classmethod get_state_str(state_int)
class gradient.constants.Region

Bases: object

CA1 = 'West Coast (CA1)'
NY2 = 'East Coast (NY2)'
AMS1 = 'Europe (AMS1)'
class gradient.constants.RunMode

Bases: object

RUN_MODE_DEFAULT = 1
RUN_MODE_PYTHON_COMMAND = 2
RUN_MODE_SHELL_COMMAND = 3
RUN_MODE_PYTHON_MODULE = 4

gradient.exceptions module

exception gradient.exceptions.ApplicationError

Bases: Exception

exception gradient.exceptions.BadResponseError

Bases: gradient.exceptions.ApplicationError

exception gradient.exceptions.PresignedUrlUnreachableError

Bases: gradient.exceptions.ApplicationError

exception gradient.exceptions.ProjectAccessDeniedError

Bases: gradient.exceptions.ApplicationError

exception gradient.exceptions.PresignedUrlAccessDeniedError

Bases: gradient.exceptions.ApplicationError

exception gradient.exceptions.PresignedUrlConnectionError

Bases: gradient.exceptions.ApplicationError

exception gradient.exceptions.PresignedUrlMalformedResponseError

Bases: gradient.exceptions.ApplicationError

exception gradient.exceptions.PresignedUrlError

Bases: gradient.exceptions.ApplicationError

exception gradient.exceptions.S3UploadFailedError

Bases: gradient.exceptions.ApplicationError

exception gradient.exceptions.ReceivingDataFailedError

Bases: gradient.exceptions.ApplicationError

exception gradient.exceptions.WrongPathError

Bases: gradient.exceptions.ApplicationError

exception gradient.exceptions.MutuallyExclusiveParametersUsedError

Bases: Exception

gradient.logger module

class gradient.logger.Logger

Bases: object

log(message, color=None, err=False)
error(message)
warning(message)
debug(message)

gradient.login module

gradient.login.is_error_or_missing_keys_print(res, *required_keys)
gradient.login.login(email=None, password=None, apiToken=None)
gradient.login.apikey()
gradient.login.set_apikey(apikey)
gradient.login.logout()

gradient.main module

gradient.main.main()

gradient.utils module

gradient.utils.get_terminal_lines(fallback=48)
gradient.utils.print_json_pretty(res)
gradient.utils.response_error_check(res)
gradient.utils.requests_exception_to_error_obj(e)
gradient.utils.status_code_to_error_obj(status_code)
gradient.utils.validate_workspace_input(input_data)
class gradient.utils.PathParser

Bases: object

LOCAL_DIR = 0
LOCAL_FILE = 1
GIT_URL = 2
S3_URL = 3
classmethod parse_path(path)
static is_local_dir(path)
static is_local_zip_file(path)
static is_git_url(path)
static is_s3_url(path)

gradient.version module

gradient.version_checker module

exception gradient.version_checker.PackageNotFoundError

Bases: Exception

class gradient.version_checker.VersionChecker

Bases: object

is_up_to_date(module_name, current_version)
get_version_from_repository(module_name, repository_url='http://pypi.python.org/pypi')
class gradient.version_checker.GradientVersionChecker

Bases: object

classmethod look_for_new_version_with_timeout()
static look_for_new_version()

gradient.workspace module

class gradient.workspace.MultipartEncoder(fields)

Bases: object

__init__(fields)

Initialize self. See help(type(self)) for accurate signature.

get_monitor()
class gradient.workspace.MultipartEncoderWithProgressbar(fields)

Bases: gradient.workspace.MultipartEncoder

class gradient.workspace.WorkspaceHandler(logger_=None)

Bases: object

__init__(logger_=None)
Parameters

logger – gradient.logger

handle(input_data)
class gradient.workspace.S3WorkspaceHandler(experiments_api, logger_=None, multipart_encoder_cls=<class 'gradient.workspace.MultipartEncoder'>)

Bases: gradient.workspace.WorkspaceHandler

DEFAULT_MULTIPART_ENCODER_CLS

alias of MultipartEncoder

__init__(experiments_api, logger_=None, multipart_encoder_cls=<class 'gradient.workspace.MultipartEncoder'>)
Parameters
handle(input_data)
class gradient.workspace.S3WorkspaceHandlerWithProgressbar(experiments_api, logger_=None, multipart_encoder_cls=<class 'gradient.workspace.MultipartEncoder'>)

Bases: gradient.workspace.S3WorkspaceHandler

DEFAULT_MULTIPART_ENCODER_CLS

alias of MultipartEncoderWithProgressbar

Module contents