Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOC] improved formatting of tag section in extension templates #5812

Merged
merged 1 commit into from Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 16 additions & 1 deletion extension_templates/alignment.py
Expand Up @@ -69,10 +69,25 @@ class MyAligner(BaseAligner):
# optional todo: override base class estimator default tags here if necessary
# these are the default values, only add if different to these.
_tags = {
# packaging info
# --------------
"authors": ["author1", "author2"], # authors, GitHub handles
"maintainers": ["maintainer1", "maintainer2"], # maintainers, GitHub handles
# author = significant contribution to code at some point
# maintainer = algorithm maintainer role, "owner"
# specify one or multiple authors and maintainers, only for sktime contribution
# remove maintainer tag if maintained by sktime core team
#
"python_version": None, # PEP 440 python version specifier to limit versions
"python_dependencies": None, # PEP 440 python dependencies specifier,
# e.g., "numba>0.53", or a list, e.g., ["numba>0.53", "numpy>=1.19.0"]
# delete if no python dependencies or version limitations
#
# estimator tags
# --------------
"capability:multiple-alignment": False, # can align more than two sequences?
"capability:distance": False, # does compute/return overall distance?
"capability:distance-matrix": False, # does compute/return distance matrix?
"python_version": None, # PEP 440 python version specifier to limit versions
}

# todo: add any hyper-parameters and components to constructor
Expand Down
23 changes: 16 additions & 7 deletions extension_templates/classification.py
Expand Up @@ -70,6 +70,22 @@ class MyTimeSeriesClassifier(BaseClassifier):
# optional todo: override base class estimator default tags here if necessary
# these are the default values, only add if different to these.
_tags = {
# packaging info
# --------------
"authors": ["author1", "author2"], # authors, GitHub handles
"maintainers": ["maintainer1", "maintainer2"], # maintainers, GitHub handles
# author = significant contribution to code at some point
# maintainer = algorithm maintainer role, "owner"
# specify one or multiple authors and maintainers, only for sktime contribution
# remove maintainer tag if maintained by sktime core team
#
"python_version": None, # PEP 440 python version specifier to limit versions
"python_dependencies": None, # PEP 440 python dependencies specifier,
# e.g., "numba>0.53", or a list, e.g., ["numba>0.53", "numpy>=1.19.0"]
# delete if no python dependencies or version limitations
#
# estimator tags
# --------------
"X_inner_mtype": "numpy3D", # which type do _fit/_predict accept, usually
"y_inner_mtype": "numpy1D", # which type do _fit/_predict return, usually
# this is either "numpy3D", "pd-multiindex" or "nested_univ" (nested df). Other
Expand All @@ -81,13 +97,6 @@ class MyTimeSeriesClassifier(BaseClassifier):
"capability:train_estimate": False,
"capability:contractable": False,
"capability:multithreading": False,
"python_version": None, # PEP 440 python version specifier to limit versions
# specify one or multiple authors and maintainers, only for sktime contribution
"authors": ["author1", "author2"], # authors, GitHub handles
"maintainers": ["maintainer1", "maintainer2"], # maintainers, GitHub handles
# author = significant contribution to code at some point
# maintainer = algorithm maintainer role, "owner"
# remove maintainer tag if maintained by sktime core team
}

# todo: add any hyper-parameters and components to constructor
Expand Down
22 changes: 16 additions & 6 deletions extension_templates/clustering.py
Expand Up @@ -65,19 +65,29 @@ class MyClusterer(BaseClusterer):
# optional todo: override base class estimator default tags here if necessary
# these are the default values, only add if different to these.
_tags = {
# packaging info
# --------------
"authors": ["author1", "author2"], # authors, GitHub handles
"maintainers": ["maintainer1", "maintainer2"], # maintainers, GitHub handles
# author = significant contribution to code at some point
# maintainer = algorithm maintainer role, "owner"
# specify one or multiple authors and maintainers, only for sktime contribution
# remove maintainer tag if maintained by sktime core team
#
"python_version": None, # PEP 440 python version specifier to limit versions
"python_dependencies": None, # PEP 440 python dependencies specifier,
# e.g., "numba>0.53", or a list, e.g., ["numba>0.53", "numpy>=1.19.0"]
# delete if no python dependencies or version limitations
#
# estimator tags
# --------------
"X_inner_mtype": "numpy3D", # which type do _fit/_predict accept, usually
# this is either "numpy3D" or "nested_univ" (nested pd.DataFrame). Other
# types are allowable, see datatypes/panel/_registry.py for options.
"capability:multivariate": False,
"capability:unequal_length": False,
"capability:missing_values": False,
"capability:multithreading": False,
# specify one or multiple authors and maintainers, only for sktime contribution
"authors": ["author1", "author2"], # authors, GitHub handles
"maintainers": ["maintainer1", "maintainer2"], # maintainers, GitHub handles
# author = significant contribution to code at some point
# maintainer = algorithm maintainer role, "owner"
# remove maintainer tag if maintained by sktime core team
}

# todo: add any hyper-parameters and components to constructor
Expand Down
28 changes: 16 additions & 12 deletions extension_templates/forecasting.py
Expand Up @@ -152,18 +152,9 @@ class MyForecaster(BaseForecaster):
# only needs to be set if capability:pred_int is True
# if False, exception raised if proba methods are called with in-sample fh
#
# dependency tags: python version and soft dependencies
# -----------------------------------------------------
#
# python version requirement
"python_version": None,
# valid values: str, PEP 440 valid python version specifiers
# raises exception at construction if local python version is incompatible
#
# soft dependency requirement
"python_dependencies": None,
# valid values: str or list of str
# raises exception at construction if modules at strings cannot be imported
# ----------------------------------------------------------------------------
# packaging info - only required for sktime contribution or 3rd party packages
# ----------------------------------------------------------------------------
#
# ownership and contribution tags
# -------------------------------
Expand All @@ -181,6 +172,19 @@ class MyForecaster(BaseForecaster):
"maintainers": ["maintainer1", "maintainer2"],
# valid values: str or list of str, should be GitHub handles
# remove tag if maintained by sktime core team
#
# dependency tags: python version and soft dependencies
# -----------------------------------------------------
#
# python version requirement
"python_version": None,
# valid values: str, PEP 440 valid python version specifiers
# raises exception at construction if local python version is incompatible
#
# soft dependency requirement
"python_dependencies": None,
# valid values: str or list of str
# raises exception at construction if modules at strings cannot be imported
}
# in case of inheritance, concrete class should typically set tags
# alternatively, descendants can set tags in __init__ (avoid this if possible)
Expand Down
29 changes: 16 additions & 13 deletions extension_templates/param_est.py
Expand Up @@ -102,19 +102,9 @@ class MyTimeSeriesParamFitter(BaseParamFitter):
# valid values: boolean True (yes), False (no)
# if False, raises exception if X passed has more than one variable
#
#
# dependency tags: python version and soft dependencies
# -----------------------------------------------------
#
# python version requirement
"python_version": None,
# valid values: str, PEP 440 valid python version specifiers
# raises exception at construction if local python version is incompatible
#
# soft dependency requirement
"python_dependencies": None,
# valid values: str or list of str
# raises exception at construction if modules at strings cannot be imported
# ----------------------------------------------------------------------------
# packaging info - only required for sktime contribution or 3rd party packages
# ----------------------------------------------------------------------------
#
# ownership and contribution tags
# -------------------------------
Expand All @@ -132,6 +122,19 @@ class MyTimeSeriesParamFitter(BaseParamFitter):
"maintainers": ["maintainer1", "maintainer2"],
# valid values: str or list of str, should be GitHub handles
# remove tag if maintained by sktime core team
#
# dependency tags: python version and soft dependencies
# -----------------------------------------------------
#
# python version requirement
"python_version": None,
# valid values: str, PEP 440 valid python version specifiers
# raises exception at construction if local python version is incompatible
#
# soft dependency requirement
"python_dependencies": None,
# valid values: str or list of str
# raises exception at construction if modules at strings cannot be imported
}
# in case of inheritance, concrete class should typically set tags
# alternatively, descendants can set tags in __init__ (avoid this if possible)
Expand Down
28 changes: 16 additions & 12 deletions extension_templates/split.py
Expand Up @@ -88,18 +88,9 @@ class MySplitter(BaseSplitter):
# calls split ("iloc") or split_loc ("loc"). Setting this can give
# performance advantages, e.g., if "loc" is faster to obtain.
#
# dependency tags: python version and soft dependencies
# -----------------------------------------------------
#
# python version requirement
"python_version": None,
# valid values: str, PEP 440 valid python version specifiers
# raises exception at construction if local python version is incompatible
#
# soft dependency requirement
"python_dependencies": None,
# valid values: str or list of str
# raises exception at construction if modules at strings cannot be imported
# ----------------------------------------------------------------------------
# packaging info - only required for sktime contribution or 3rd party packages
# ----------------------------------------------------------------------------
#
# ownership and contribution tags
# -------------------------------
Expand All @@ -117,6 +108,19 @@ class MySplitter(BaseSplitter):
"maintainers": ["maintainer1", "maintainer2"],
# valid values: str or list of str, should be GitHub handles
# remove tag if maintained by sktime core team
#
# dependency tags: python version and soft dependencies
# -----------------------------------------------------
#
# python version requirement
"python_version": None,
# valid values: str, PEP 440 valid python version specifiers
# raises exception at construction if local python version is incompatible
#
# soft dependency requirement
"python_dependencies": None,
# valid values: str or list of str
# raises exception at construction if modules at strings cannot be imported
}

# todo: add any hyper-parameters and components to constructor
Expand Down
29 changes: 16 additions & 13 deletions extension_templates/transformer.py
Expand Up @@ -239,19 +239,9 @@ class MyTransformer(BaseTransformer):
# valid values: boolean True (yes), False (no)
# used for search index and validity checking, does not raise direct exception
#
#
# dependency tags: python version and soft dependencies
# -----------------------------------------------------
#
# python version requirement
"python_version": None,
# valid values: str, PEP 440 valid python version specifiers
# raises exception at construction if local python version is incompatible
#
# soft dependency requirement
"python_dependencies": None,
# valid values: str or list of str
# raises exception at construction if modules at strings cannot be imported
# ----------------------------------------------------------------------------
# packaging info - only required for sktime contribution or 3rd party packages
# ----------------------------------------------------------------------------
#
# ownership and contribution tags
# -------------------------------
Expand All @@ -269,6 +259,19 @@ class MyTransformer(BaseTransformer):
"maintainers": ["maintainer1", "maintainer2"],
# valid values: str or list of str, should be GitHub handles
# remove tag if maintained by sktime core team
#
# dependency tags: python version and soft dependencies
# -----------------------------------------------------
#
# python version requirement
"python_version": None,
# valid values: str, PEP 440 valid python version specifiers
# raises exception at construction if local python version is incompatible
#
# soft dependency requirement
"python_dependencies": None,
# valid values: str or list of str
# raises exception at construction if modules at strings cannot be imported
}
# in case of inheritance, concrete class should typically set tags
# alternatively, descendants can set tags in __init__
Expand Down
12 changes: 8 additions & 4 deletions sktime/forecasting/base/_base.py
Expand Up @@ -82,6 +82,14 @@ class BaseForecaster(BaseEstimator):
# default tag values - these typically make the "safest" assumption
# for more extensive documentation, see extension_templates/forecasting.py
_tags = {
# packaging info
# --------------
"authors": "sktime developers", # author(s) of the object
"maintainers": "sktime developers", # current maintainer(s) of the object
"python_version": None, # PEP 440 python version specifier to limit versions
"python_dependencies": None, # str or list of str, package soft dependencies
# estimator type
# --------------
"object_type": "forecaster", # type of object
"scitype:y": "univariate", # which y are fine? univariate/multivariate/both
"ignores-exogeneous-X": False, # does estimator ignore the exogeneous X?
Expand All @@ -95,10 +103,6 @@ class BaseForecaster(BaseEstimator):
"X-y-must-have-same-index": True, # can estimator handle different X/y index?
"enforce_index_type": None, # index type that needs to be enforced in X/y
"fit_is_empty": False, # is fit empty and can be skipped?
"python_version": None, # PEP 440 python version specifier to limit versions
"python_dependencies": None, # str or list of str, package soft dependencies
"authors": "sktime developers", # author(s) of the object
"maintainers": "sktime developers", # current maintainer(s) of the object
}

# configs and default config values
Expand Down
11 changes: 8 additions & 3 deletions sktime/proba/base.py
Expand Up @@ -20,18 +20,23 @@ class BaseDistribution(BaseObject):

# default tag values - these typically make the "safest" assumption
_tags = {
# packaging info
# --------------
"authors": "sktime developers", # author(s) of the object
"maintainers": "sktime developers", # current maintainer(s) of the object
"python_version": None, # PEP 440 python version specifier to limit versions
"python_dependencies": None, # str or list of str, package soft dependencies
# estimator type
# --------------
"object_type": "distribution", # type of object, e.g., 'distribution'
"python_version": None, # PEP 440 python version specifier to limit versions
"python_dependencies": None, # string or str list of pkg soft dependencies
"reserved_params": ["index", "columns"],
"capabilities:approx": ["energy", "mean", "var", "pdfnorm"],
"approx_mean_spl": 1000, # sample size used in MC estimates of mean
"approx_var_spl": 1000, # sample size used in MC estimates of var
"approx_energy_spl": 1000, # sample size used in MC estimates of energy
"approx_spl": 1000, # sample size used in other MC estimates
"bisect_iter": 1000, # max iters for bisection method in ppf
"authors": "sktime developers", # author(s) of the object
"maintainers": "sktime developers", # current maintainer(s) of the object
}

def __init__(self, index=None, columns=None):
Expand Down