modnet.ext_data module

This module defines some remote datasets that can be downloaded into the user’s installation.

class modnet.ext_data.Usage(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

cross_nmi = 2
feature_db = 3
class modnet.ext_data.Dataset(url, description, filename, md5, usage)

Bases: tuple

Create new instance of Dataset(url, description, filename, md5, usage)

description

Alias for field number 1

filename

Alias for field number 2

md5

Alias for field number 3

url

Alias for field number 0

usage

Alias for field number 4

modnet.ext_data.load_ext_dataset(dataset_name, expected_type)

Load one of the preset datasets from the DATASETS constant. Will not overwrite any existing local data with remote datasets. Checks hashes against what is expected and will not depickle if unrecognised.

Parameters:
  • dataset_name (str) – The name (key) of the dataset in DATASETS.

  • expected_type (Union[Usage, str]) – A string representing the expected usage of the dataset, e.g. '_MODData' or 'cross_nmi' or 'feature_db'.

Returns:

The path to the downloaded or previously installed model.