Skip to content

getml.project

This module helps you handle your current project.

load

load(bundle: str, name: Optional[str] = None) -> None

Loads a project from a bundle and connects to it.

PARAMETER DESCRIPTION
bundle

The .getml bundle file to load.

TYPE: str

name

A name for the project contained in the bundle. If None, the name will be extracted from the bundle.

TYPE: Optional[str] DEFAULT: None

Source code in getml/project/attrs.py
75
76
77
78
79
80
81
82
83
84
85
86
@module_function
def load(bundle: str, name: Optional[str] = None) -> None:
    """
    Loads a project from a bundle and connects to it.

    Args:
        bundle: The `.getml` bundle file to load.

        name: A name for the project contained in the bundle.
            If None, the name will be extracted from the bundle.
    """
    return comm._load_project(bundle, name)

delete

delete() -> None

Deletes the currently connected project. All related pipelines, data frames and hyperopts will be irretrievably deleted.

Source code in getml/project/attrs.py
89
90
91
92
93
94
95
@module_function
def delete() -> None:
    """
    Deletes the currently connected project. All related pipelines,
    data frames and hyperopts will be irretrievably deleted.
    """
    comm._delete_project(_name())

restart

restart() -> None

Suspends and then relaunches the currently connected project. This will kill all jobs currently running on that process.

Source code in getml/project/attrs.py
 98
 99
100
101
102
103
104
@module_function
def restart() -> None:
    """
    Suspends and then relaunches the currently connected project.
    This will kill all jobs currently running on that process.
    """
    comm._set_project(_name(), restart=True)

save

save(
    filename: Optional[Union[PathLike, str]] = None,
    target_dir: Optional[str] = None,
    replace: bool = False,
) -> None

Saves the currently connected project to disk.

PARAMETER DESCRIPTION
filename

The name of the .getml bundle file

TYPE: Optional[Union[PathLike, str]] DEFAULT: None

replace

Whether to replace an existing bundle.

TYPE: bool DEFAULT: False

Deprecated

1.5: The target_dir argument is deprecated.

Source code in getml/project/attrs.py
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
@module_function
def save(
    filename: Optional[Union[PathLike, str]] = None,
    target_dir: Optional[str] = None,
    replace: bool = False,
) -> None:
    """
    Saves the currently connected project to disk.

    Args:
        filename: The name of the `.getml` bundle file

        replace: Whether to replace an existing bundle.

    Deprecated:
        1.5: The `target_dir` argument is deprecated.
    """
    if target_dir is not None:
        warnings.warn(
            "The target_dir argument is deprecated. Use filename with a path instead.",
            DeprecationWarning,
        )
        bundle_name = filename if filename else f"{_name()}.getml"
        filename = Path(target_dir) / bundle_name
    return comm._save_project(_name(), filename, replace)

suspend

suspend() -> None

Suspends the currently connected project.

Source code in getml/project/attrs.py
134
135
136
137
138
139
@module_function
def suspend() -> None:
    """
    Suspends the currently connected project.
    """
    return comm._suspend_project(_name())

switch

switch(name: str) -> None

Creates a new project or loads an existing one.

If there is no project called name present on the Engine, a new one will be created. See the User guide for more information.

PARAMETER DESCRIPTION
name

Name of the new project.

TYPE: str

Source code in getml/project/attrs.py
142
143
144
145
146
147
148
149
150
151
152
153
@module_function
def switch(name: str) -> None:
    """Creates a new project or loads an existing one.

    If there is no project called `name` present on the Engine, a new one will
    be created. See the [User guide][project-management] for more
    information.

    Args:
        name: Name of the new project.
    """
    comm._set_project(name)

data_frames

getml.project.data_frames
An instance of getml.project.DataFrames.

hyperopts

getml.project.hyperopts
An instance of getml.project.Hyperopts.

pipelines

getml.project.pipelines
An instance of getml.project.Pipelines.

name

getml.project.name
Holds the name of the current project.