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] Remove optional from docstrings #1458

Merged
merged 3 commits into from
Apr 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
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -2387,6 +2387,15 @@
"contributions": [
"doc"
]
},
{
"login": "griegner",
"name": "Gabriel Riegner",
"avatar_url": "https://avatars.githubusercontent.com/u/54326829?v=4",
"profile": "https://github.com/griegner",
"contributions": [
"doc"
]
}
],
"commitType": "docs"
Expand Down
6 changes: 3 additions & 3 deletions aeon/annotation/base/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ class BaseSeriesAnnotator(BaseEstimator):

Parameters
----------
fmt : str {"dense", "sparse"}, optional (default="dense")
fmt : str {"dense", "sparse"}, default="dense"
annotation output format:
* If "sparse", a sub-series of labels for only the outliers in X is returned,
* If "dense", a series of labels for all values in X is returned.
labels : str {"indicator", "score"}, optional (default="indicator")
labels : str {"indicator", "score"}, default="indicator"
annotation output labels:
* If "indicator", returned values are boolean, indicating whether a value is an
outlier,
Expand Down Expand Up @@ -210,7 +210,7 @@ def fit_predict(self, X, Y=None):
----------
X : pd.DataFrame, pd.Series or np.ndarray
Data to be transformed
Y : pd.Series or np.ndarray, optional (default=None)
Y : pd.Series or np.ndarray, default=None
Target values of data to be predicted.

Returns
Expand Down
10 changes: 5 additions & 5 deletions aeon/anomaly_detection/_stray.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@ class STRAY(BaseTransformer):

Parameters
----------
alpha : float, optional (default=0.01)
alpha : float, default=0.01
Threshold for determining the cutoff for outliers. Observations are
considered outliers if they fall in the (1 - alpha) tail of
the distribution of the nearest-neighbor distances between exemplars.
k : int, optional (default=10)
k : int, default=10
Number of neighbours considered.
knn_algorithm : str {"auto", "ball_tree", "kd_tree", "brute"}, optional
(default="brute")
Algorithm used to compute the nearest neighbors, from
sklearn.neighbors.NearestNeighbors
p : float, optional (default=0.5)
p : float, default=0.5
Proportion of possible candidates for outliers. This defines the starting point
for the bottom up searching algorithm.
size_threshold : int, optional (default=50)
size_threshold : int, default=50
Sample size to calculate an emperical threshold.
outlier_tail : str {"min", "max"}, optional (default="max")
outlier_tail : str {"min", "max"}, default="max"
Direction of the outlier tail.

Attributes
Expand Down
2 changes: 1 addition & 1 deletion aeon/benchmarking/benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def add_estimator(
----------
estimator : BaseEstimator object
Estimator to add to the benchmark.
estimator_id : str, optional (default=None)
estimator_id : str, default=None
Identifier for estimator. If none given then uses estimator's class name.

"""
Expand Down
2 changes: 1 addition & 1 deletion aeon/benchmarking/forecasting.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def add_task(
Splitter used for generating validation folds.
scorers : a list of Callable scoring functions
Each scoring function output will be included in the results.
task_id : str, optional (default=None)
task_id : str, default=None
Identifier for the benchmark task. If none given then uses dataset loader
name combined with cv_splitter class name.

Expand Down
2 changes: 1 addition & 1 deletion aeon/clustering/_kernel_k_means.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class TimeSeriesKernelKMeans(BaseClusterer):
convergence.
verbose: bool, default=False
Verbosity mode.
n_jobs : int or None, optional (default=None)
n_jobs : int or None, default=None
The number of jobs to run in parallel for GAK cross-similarity matrix
computations.
``None`` means 1 unless in a :obj:`joblib.parallel_backend` context.
Expand Down
4 changes: 2 additions & 2 deletions aeon/datasets/_data_loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,10 +493,10 @@ def _load_tsc_dataset(
Parameters
----------
name : string, file name to load from
split: None or one of "TRAIN", "TEST", optional (default=None)
split: None or one of "TRAIN", "TEST", default=None
Whether to load the train or test instances of the problem.
By default it loads both train and test instances (in a single container).
return_X_y: bool, optional (default=True)
return_X_y: bool, default=True
If True, returns (features, target) separately instead of a single
dataframe with columns for features and the target.
return_data_type : str, optional, default = None
Expand Down
32 changes: 16 additions & 16 deletions aeon/datasets/_single_problem_loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def load_gunpoint(split=None, return_X_y=True, return_type="numpy3d"):
return_X_y: bool, default=True
If True, returns (features, target) separately instead of as single data
structure.
return_type: string, optional (default="numpy3d")
return_type: string, default="numpy3d"
Data structure to use for time series, should be either "numpy2d" or "numpy3d".

Raises
Expand Down Expand Up @@ -97,7 +97,7 @@ def load_osuleaf(split=None, return_X_y=True, return_type="numpy3d"):
return_X_y: bool, default=True
If True, returns (features, target) separately instead of as single data
structure.
return_type: string, optional (default="numpy3d")
return_type: string, default="numpy3d"
Data structure to use for time series, should be either "numpy2d" or "numpy3d".

Raises
Expand Down Expand Up @@ -143,7 +143,7 @@ def load_italy_power_demand(split=None, return_X_y=True, return_type="numpy3d"):
return_X_y: bool, default=True
If True, returns (features, target) separately instead of as single data
structure.
return_type: string, optional (default="numpy3d")
return_type: string, default="numpy3d"
Data structure to use for time series, should be either "numpy2d" or "numpy3d".

Raises
Expand Down Expand Up @@ -196,7 +196,7 @@ def load_unit_test(split=None, return_X_y=True, return_type="numpy3d"):
return_X_y: bool, default=True
If True, returns (features, target) separately instead of as single data
structure.
return_type: string, optional (default="numpy3d")
return_type: string, default="numpy3d"
Data structure containing series, should be either "numpy2d" or "numpy3d".

Raises
Expand Down Expand Up @@ -245,7 +245,7 @@ def load_arrow_head(split=None, return_X_y=True, return_type="numpy3d"):
return_X_y: bool, default=True
If True, returns (features, target) separately instead of as single data
structure.
return_type: string, optional (default="numpy3d")
return_type: string, default="numpy3d"
Data structure to use for time series, should be either "numpy2d" or "numpy3d".

Raises
Expand Down Expand Up @@ -293,7 +293,7 @@ def load_acsf1(split=None, return_X_y=True, return_type="numpy3d"):
return_X_y: bool, default=True
If True, returns (features, target) separately instead of as single data
structure.
return_type: string, optional (default="numpy3d")
return_type: string, default="numpy3d"
Data structure to use for time series, should be either "numpy2d" or "numpy3d".

Raises
Expand Down Expand Up @@ -342,7 +342,7 @@ def load_basic_motions(split=None, return_X_y=True, return_type="numpy3d"):
return_X_y: bool, default=True
If True, returns (features, target) separately instead of as single data
structure.
return_type: string, optional (default="numpy3d")
return_type: string, default="numpy3d"
Data structure to use for time series, should be "numpy3d" or "np-list".

Raises
Expand Down Expand Up @@ -430,10 +430,10 @@ def load_japanese_vowels(split=None, return_X_y=True, return_type="np-list"):

Parameters
----------
split: None or one of "TRAIN", "TEST", optional (default=None)
split: None or one of "TRAIN", "TEST", default=None
Whether to load the train or test instances of the problem. By default it
loads both train and test instances into a single array.
return_X_y: bool, optional (default=True)
return_X_y: bool, default=True
If True, returns (features, target) separately instead of a single
dataframe with columns for features and the target.
return_type: string, default="np-list"
Expand Down Expand Up @@ -510,7 +510,7 @@ def load_longley(y_name="TOTEMP"):

Parameters
----------
y_name: str, optional (default="TOTEMP")
y_name: str, default="TOTEMP"
Name of target variable (y)

Returns
Expand Down Expand Up @@ -1029,14 +1029,14 @@ def load_covid_3month(split=None, return_X_y=True, return_type="numpy3d"):

Parameters
----------
split: None or str{"train", "test"}, optional (default=None)
split: None or str{"train", "test"}, default=None
Whether to load the train or test partition of the problem. By
default, it loads both.
return_X_y: bool, optional (default=True)
return_X_y: bool, default=True
If True, returns (features, target) separately instead of a single
dataframe with columns for
features and the target.
return_type: string, optional (default="numpy3d")
return_type: string, default="numpy3d"
Data structure to use for time series, should be either "numpy2d" or "numpy3d".

Returns
Expand Down Expand Up @@ -1084,14 +1084,14 @@ def load_cardano_sentiment(split=None, return_X_y=True, return_type="numpy3d"):

Parameters
----------
split: None or str{"train", "test"}, optional (default=None)
split: None or str{"train", "test"}, default=None
Whether to load the train or test partition of the problem. By
default, it loads both.
return_X_y: bool, optional (default=True)
return_X_y: bool, default=True
If True, returns (features, target) separately instead of a single
dataframe with columns for
features and the target.
return_type: string, optional (default="numpy3d")
return_type: string, default="numpy3d"
Data structure to use for time series, should be either "numpy2d" or "numpy3d".

Returns
Expand Down
10 changes: 5 additions & 5 deletions aeon/forecasting/ardl.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def _fit(self, y, X=None, fh=None):
if self.get_tag("y_input_type")=="univariate":
guaranteed to have a single column/variable
A 1-d endogenous response variable. The dependent variable.
X : optional (default=None)
X : default=None
guaranteed to be of a type in self.get_tag("X_inner_type")
Exogeneous time series to fit to.
Exogenous variables to include in the model. Either a DataFrame or
Expand Down Expand Up @@ -392,10 +392,10 @@ def _predict(self, fh, X=None):

Parameters
----------
fh : guaranteed to be ForecastingHorizon or None, optional (default=None)
fh : guaranteed to be ForecastingHorizon or None, default=None
The forecasting horizon with the steps ahead to to predict.
If not passed in _fit, guaranteed to be passed here
X : optional (default=None)
X : default=None
guaranteed to be of a type in self.get_tag("X_inner_type")
Exogeneous time series for the forecast

Expand Down Expand Up @@ -442,10 +442,10 @@ def _update(self, y, X=None, update_params=True):
if self.get_tag("y_input_type")=="multivariate":
guaranteed to have 2 or more columns
if self.get_tag("y_input_type")=="both": no restrictions apply
X : optional (default=None)
X : default=None
guaranteed to be of a type in self.get_tag("X_inner_type")
Exogeneous time series for the forecast
update_params : bool, optional (default=True)
update_params : bool, default=True
whether model parameters should be updated

Returns
Expand Down