Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/parameter_sweep/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
# "https://github.com/watertap-org/watertap/"
#################################################################################

from pyomo.common.deprecation import deprecation_warning

from parameter_sweep.parameter_sweep import (
ParameterSweep,
RecursiveParameterSweep,
Expand Down Expand Up @@ -138,6 +140,11 @@ def parameter_sweep(
simulation identified by the ``outputs`` argument.
"""

deprecation_warning(
"parameter_sweep function is deprecated please call the ParameterSweep class instead.",
version="0.1.0",
)

kwargs = {}
if csv_results_file_name is not None:
kwargs["csv_results_file_name"] = csv_results_file_name
Expand Down Expand Up @@ -284,6 +291,11 @@ def recursive_parameter_sweep(
simulation identified by the ``outputs`` argument.
"""

deprecation_warning(
"recursive_parameter_sweep function is deprecated please call the RecursiveParameterSweep class instead.",
version="0.1.0",
)

kwargs = {}
if csv_results_file_name is not None:
kwargs["csv_results_file_name"] = csv_results_file_name
Expand Down Expand Up @@ -454,6 +466,11 @@ def differential_parameter_sweep(
simulation identified by the ``outputs`` argument.
"""

deprecation_warning(
"differential_parameter_sweep function is deprecated please call the DifferentialParameterSweep class instead.",
version="0.1.0",
)

kwargs = {}
kwargs["build_differential_sweep_specs"] = build_differential_sweep_specs
if csv_results_file_name is not None:
Expand Down
24 changes: 12 additions & 12 deletions src/parameter_sweep/parameter_sweep.py
Original file line number Diff line number Diff line change
Expand Up @@ -809,17 +809,17 @@ def parameter_sweep(
_model = build_model
build_model = lambda: _model
deprecation_warning(
"Passing a model directly to the parameter_sweep function is deprecated \
and will not work with future implementations of parallelism.",
"Passing a model directly to the parameter_sweep function is deprecated "
"and will not work with future implementations of parallelism.",
version="0.10.0",
)

if not callable(build_sweep_params):
_sweep_params = build_sweep_params
build_sweep_params = lambda model: _sweep_params
deprecation_warning(
"Passing sweep params directly to the parameter_sweep function is deprecated \
and will not work with future implementations of parallelism.",
"Passing sweep params directly to the parameter_sweep function is deprecated "
"and will not work with future implementations of parallelism.",
version="0.10.0",
)

Expand All @@ -830,8 +830,8 @@ def parameter_sweep(
_combined_outputs = build_outputs
build_outputs = lambda model: _combined_outputs
deprecation_warning(
"Passing the output dict directly to the parameter_sweep function is deprecated \
and will not work with future implementations of parallelism.",
"Passing the output dict directly to the parameter_sweep function is deprecated "
"and will not work with future implementations of parallelism.",
version="0.10.0",
)
# This should be depreciated in future versions
Expand Down Expand Up @@ -984,17 +984,17 @@ def parameter_sweep(
_model = build_model
build_model = lambda: _model
deprecation_warning(
"Passing a model directly to the parameter_sweep function is deprecated \
and will not work with future implementations of parallelism.",
"Passing a model directly to the parameter_sweep function is deprecated "
"and will not work with future implementations of parallelism.",
version="0.10.0",
)

if not callable(build_sweep_params):
_sweep_params = build_sweep_params
build_sweep_params = lambda model: _sweep_params
deprecation_warning(
"Passing sweep params directly to the parameter_sweep function is deprecated \
and will not work with future implementations of parallelism.",
"Passing sweep params directly to the parameter_sweep function is deprecated "
"and will not work with future implementations of parallelism.",
version="0.10.0",
)

Expand All @@ -1005,8 +1005,8 @@ def parameter_sweep(
_combined_outputs = build_outputs
build_outputs = lambda model: _combined_outputs
deprecation_warning(
"Passing the output dict directly to the parameter_sweep function is deprecated \
and will not work with future implementations of parallelism.",
"Passing the output dict directly to the parameter_sweep function is deprecated "
"and will not work with future implementations of parallelism.",
version="0.10.0",
)
# This should be depreciated in future versions
Expand Down
Loading