Skip to content

Commit 845cabb

Browse files
authored
Merge pull request #1033 from karpovantonme/docs/docstring-parameters-match-signatures
Fix docstring parameters that do not match the signatures
2 parents bc972bd + c409e77 commit 845cabb

5 files changed

Lines changed: 28 additions & 20 deletions

File tree

autoemulate/calibration/bayes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def __init__(
4242
----------
4343
emulator: Emulator
4444
Fitted Emulator object.
45-
parameters_range : dict[str, tuple[float, float]]
45+
parameter_range : dict[str, tuple[float, float]]
4646
A dictionary mapping input parameter names to their (min, max) ranges.
4747
observations: dict[str, TensorLike]
4848
A dictionary of observations for each output.
@@ -70,10 +70,10 @@ def __init__(
7070
Notes
7171
-----
7272
The model assumes:
73-
- Uniform priors for calibrated parameters (bounds given by `parameters_range`)
73+
- Uniform priors for calibrated parameters (bounds given by `parameter_range`)
7474
- Gaussian likelihood with no correlation between outputs
7575
All non-calibrated parameters are set to a constant value. This is chosen as the
76-
midpoint value of `parameters_range`.
76+
midpoint value of `parameter_range`.
7777
"""
7878
TorchDeviceMixin.__init__(self, device=device)
7979
self.parameter_range = parameter_range

autoemulate/core/results.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,8 @@ def best_result(self, metric: str | Metric | None = None) -> Result:
185185
metric: str | Metric | None
186186
The name of the metric to use for comparison. If None, uses the first
187187
available metric found in the results. The metric should exist in the
188-
test_metrics of the results.
189-
metric_maximize: bool | None
190-
Whether higher values are better for the metric. If None, defaults to True
191-
(assumes higher is better). Set to False for metrics like RMSE or MAE where
192-
lower is better.
188+
test_metrics of the results. Whether higher or lower values are better is
189+
taken from the metric itself (`Metric.maximize`).
193190
194191
Returns
195192
-------

autoemulate/core/sensitivity_analysis.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,20 +1236,20 @@ def _plot_sa_heatmap(
12361236
12371237
Parameters
12381238
----------
1239-
results: pd.DataFrame
1239+
si_df: pd.DataFrame
12401240
Sensitivity index dataframe with columns ['index', 'parameter',
12411241
'output', 'value'].
12421242
index: str
12431243
The type of sensitivity index to plot (e.g., 'ST').
1244-
top_n: int | None
1245-
Number of top parameters to include. If None, returns all. Defaults to
1246-
None.
1244+
parameters: list[str]
1245+
Parameters to include, in the order they should appear as columns.
12471246
cmap: str
12481247
Matplotlib colormap. Defaults to 'coolwarm'.
12491248
normalize: bool
1250-
Wheterto normalize values to [0, 1]. Defaults to True.
1251-
figsize: tuple | None
1252-
Figure size as (width, height) in inches. Defaults to None.
1249+
Whether to normalize values to [0, 1]. Defaults to True.
1250+
fig_size: tuple | None
1251+
Figure size as (width, height) in inches. If None, it is derived from
1252+
the heatmap layout. Defaults to None.
12531253
12541254
Returns
12551255
-------

autoemulate/emulators/gaussian_process/exact.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ def __init__(
8181
Input features, expected to be a 2D tensor of shape (n_samples, n_features).
8282
y: TensorLike
8383
Target values, expected to be a 2D tensor of shape (n_samples, n_tasks).
84+
standardize_x: bool
85+
Whether to standardize the input features with a `StandardizeTransform`
86+
before fitting. Defaults to False.
87+
standardize_y: bool
88+
Whether to standardize the target values with a `StandardizeTransform`
89+
before fitting. Defaults to True.
8490
likelihood_cls: type[MultitaskGaussianLikelihood]
8591
Likelihood class to use for the model. Defaults to
8692
`MultitaskGaussianLikelihood`.
@@ -370,6 +376,12 @@ def __init__(
370376
Input features, expected to be a 2D tensor of shape (n_samples, n_features).
371377
y: TensorLike
372378
Target values, expected to be a 2D tensor of shape (n_samples, n_tasks).
379+
standardize_x: bool
380+
Whether to standardize the input features with a `StandardizeTransform`
381+
before fitting. Defaults to False.
382+
standardize_y: bool
383+
Whether to standardize the target values with a `StandardizeTransform`
384+
before fitting. Defaults to True.
373385
likelihood_cls: type[MultitaskGaussianLikelihood]
374386
Likelihood class to use for the model. Defaults to
375387
`MultitaskGaussianLikelihood`.
@@ -389,9 +401,7 @@ def __init__(
389401
False, it will return the posterior distribution over the modelled function.
390402
Defaults to False.
391403
epochs: int
392-
Number of training epochs.
393-
activation: type[nn.Module]
394-
Activation function to use in the model. Defaults to `nn.ReLU`.
404+
Number of training epochs. Defaults to 50.
395405
lr: float
396406
Learning rate for the optimizer. Defaults to 2e-1.
397407
early_stopping: EarlyStopping | None
@@ -401,7 +411,8 @@ def __init__(
401411
GPU). Defaults to None.
402412
scheduler_cls: type[LRScheduler] | None
403413
Learning rate scheduler class. If None, no scheduler is used. Defaults to
404-
scheduler_params: dict
414+
None.
415+
scheduler_params: dict | None
405416
Additional keyword arguments for the learning rate scheduler.
406417
"""
407418
# Init device

autoemulate/learners/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ def query(
290290
291291
Parameters
292292
----------
293-
*arg: TensorLike or None
293+
x: TensorLike or None
294294
Optional input samples.
295295
296296
Returns

0 commit comments

Comments
 (0)