Пример #1
0
    def fetch_hash(self) -> str:
        """Fetches the hash of an artifact.

        You may also want to check `fetch_hash docs page`_.
           https://docs.neptune.ai/api-reference/field-types#.fetch_hash
        """
        raise NeptuneException("Should be never called.")
Пример #2
0
    def fetch_files_list(self) -> List[ArtifactFileData]:
        """Fetches the list of files in an artifact and their metadata.

        You may also want to check `fetch_files_list docs page`_.
           https://docs.neptune.ai/api-reference/field-types#.fetch_files_list
        """
        raise NeptuneException("Should be never called.")
Пример #3
0
    def fetch_last(self):
        """Fetches last value stored in the series from Neptune servers.

        Available for following field types (`Field types docs page`_):
            * `FloatSeries`
            * `StringSeries`

        Returns:
            Fetches last value stored in the series from Neptune servers.

        .. _Field types docs page:
           https://docs.neptune.ai/api-reference/field-types
        """
        raise NeptuneException("Should be never called.")
Пример #4
0
    def clear(self, wait: bool = False):
        """Removes all tags from the `StringSet`.

        Args:
            wait (bool, optional): If `True` the client will wait to send all tracked metadata to the server first.
                This makes the call synchronous.
                Defaults to `False`.

        You may also want to check `clear docs page`_.

        .. _clear docs page:
           https://docs.neptune.ai/api-reference/field-types#.clear
        """
        raise NeptuneException("Should be never called.")
Пример #5
0
def init_project(
    *,
    name: Optional[str] = None,
    api_token: Optional[str] = None,
    mode: str = Mode.ASYNC.value,
    flush_period: float = 5,
    proxies: Optional[dict] = None,
) -> Project:
    verify_type("name", name, (str, type(None)))
    verify_type("api_token", api_token, (str, type(None)))
    verify_type("mode", mode, str)
    verify_type("flush_period", flush_period, (int, float))
    verify_type("proxies", proxies, (dict, type(None)))

    if mode == Mode.OFFLINE:
        raise NeptuneException("Project can't be initialized in OFFLINE mode")

    backend = get_backend(mode, api_token=api_token, proxies=proxies)
    project_obj = project_name_lookup(backend, name)

    project_lock = threading.RLock()

    operation_processor = get_operation_processor(
        mode,
        container_id=project_obj.id,
        container_type=Project.container_type,
        backend=backend,
        lock=project_lock,
        flush_period=flush_period,
    )

    background_jobs = []

    project = Project(
        project_obj.id,
        backend,
        operation_processor,
        BackgroundJobList(background_jobs),
        project_lock,
        project_obj.workspace,
        project_obj.name,
    )
    if mode != Mode.OFFLINE:
        project.sync(wait=False)

    # pylint: disable=protected-access
    project._startup(debug_mode=mode == Mode.DEBUG)
    return project
Пример #6
0
    def download_last(self, destination: str = None) -> None:
        """Downloads the stored file or files to the working directory or specified destination.

        Args:
            destination (str, optional): Path to where the file(s) should be downloaded.
                If `None` file will be downloaded to the working directory.
                If `destination` is a directory, the file will be downloaded to the specified directory with a filename
                composed from field name and extension (if present).
                If `destination` is a path to a file, the file will be downloaded under the specified name.
                Defaults to `None`.

        You may also want to check `download_last docs page`_.

        .. _download_last docs page:
           https://docs.neptune.ai/api-reference/field-types#.download_last
        """
        raise NeptuneException("Should be never called.")
Пример #7
0
    def remove(self,
               values: Union[str, Iterable[str]],
               wait: bool = False) -> None:
        """Removes the provided tag or tags from the set.

        Args:
            values (str or collection of str): Tag or tags to be removed.
            wait (bool, optional): If `True` the client will wait to send all tracked metadata to the server first.
                This makes the call synchronous.
                Defaults to `False`.

        You may also want to check `remove docs page`_.

        .. _remove docs page:
           https://docs.neptune.ai/api-reference/field-types#.remove
        """
        raise NeptuneException("Should be never called.")
Пример #8
0
    def fetch_values(self, include_timestamp: Optional[bool] = True):
        """Fetches all values stored in the series from Neptune servers.

        Available for following field types (`Field types docs page`_):
            * `FloatSeries`
            * `StringSeries`

        Args:
            include_timestamp (bool, optional): Whether the fetched data should include the timestamp field.
                Defaults to `True`.

        Returns:
            ``Pandas.DataFrame``: containing all the values and their indexes stored in the series field.

        .. _Field types docs page:
           https://docs.neptune.ai/api-reference/field-types
        """
        raise NeptuneException("Should be never called.")
Пример #9
0
    def fetch(self):
        """Fetches fields value or in case of a namespace fetches values of all non-File Atom fields as a dictionary.

        Available for following field types (`Field types docs page`_):
            * `Integer`
            * `Float`
            * `Boolean`
            * `String`
            * `DateTime`
            * `StringSet`
            * `Namespace handler`

        Returns:
            Value stored in the field or in case of a namespace a dictionary containing all non-Atom fields values.

        .. _Field types docs page:
           https://docs.neptune.ai/api-reference/field-types
        """
        raise NeptuneException("Should be never called.")
Пример #10
0
    def delete_files(self,
                     paths: Union[str, Iterable[str]],
                     wait: bool = False) -> None:
        """Delete the file or files specified by paths from the `FileSet` stored on the Neptune servers.

        Args:
            paths (str or collection of str): `Path` or paths to files or folders to be deleted.
                Note that these are paths relative to the FileSet itself e.g. if the `FileSet` contains
                file `example.txt`, `varia/notes.txt`, `varia/data.csv` to delete whole subfolder you would pass
                varia as the argument.
            wait (bool, optional): If `True` the client will wait to send all tracked metadata to the server.
                This makes the call synchronous.
                Defaults to `None`.

        You may also want to check `delete_files docs page`_.

        .. _delete_files docs page:
            https://docs.neptune.ai/api-reference/field-types#.delete_files
        """
        raise NeptuneException("Should be never called.")
Пример #11
0
    def download(self, destination: str = None) -> None:
        """Downloads the stored file or files to the working directory or specified destination.

        Available for following field types (`Field types docs page`_):
            * `File`
            * `FileSeries`
            * `FileSet`
            * `Artifact`

        Args:
            destination (str, optional): Path to where the file(s) should be downloaded.
                If `None` file will be downloaded to the working directory.
                If `destination` is a directory, the file will be downloaded to the specified directory with a filename
                composed from field name and extension (if present).
                If `destination` is a path to a file, the file will be downloaded under the specified name.
                Defaults to `None`.

        .. _Field types docs page:
           https://docs.neptune.ai/api-reference/field-types
        """
        raise NeptuneException("Should be never called.")