Skip to content

Commit

Permalink
Remove experimental / add preview feature warnings (#3187)
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljanes authored Apr 1, 2024
1 parent 9842e41 commit 9420424
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
4 changes: 1 addition & 3 deletions src/py/flwr/client/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
TRANSPORT_TYPES,
)
from flwr.common.exit_handlers import register_exit_handlers
from flwr.common.logger import log, warn_deprecated_feature, warn_experimental_feature
from flwr.common.logger import log, warn_deprecated_feature
from flwr.common.message import Error
from flwr.common.object_ref import load_app, validate
from flwr.common.retry_invoker import RetryInvoker, exponential
Expand Down Expand Up @@ -385,8 +385,6 @@ def _load_client_app() -> ClientApp:
return ClientApp(client_fn=client_fn)

load_client_app_fn = _load_client_app
else:
warn_experimental_feature("`load_client_app_fn`")

# At this point, only `load_client_app_fn` should be used
# Both `client` and `client_fn` must not be used directly
Expand Down
7 changes: 7 additions & 0 deletions src/py/flwr/client/client_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from flwr.client.mod.utils import make_ffn
from flwr.client.typing import ClientFn, Mod
from flwr.common import Context, Message, MessageType
from flwr.common.logger import warn_preview_feature

from .typing import ClientAppCallable

Expand Down Expand Up @@ -123,6 +124,8 @@ def train_decorator(train_fn: ClientAppCallable) -> ClientAppCallable:
if self._call:
raise _registration_error(MessageType.TRAIN)

warn_preview_feature("ClientApp-register-train-function")

# Register provided function with the ClientApp object
# Wrap mods around the wrapped step function
self._train = make_ffn(train_fn, self._mods)
Expand Down Expand Up @@ -151,6 +154,8 @@ def evaluate_decorator(evaluate_fn: ClientAppCallable) -> ClientAppCallable:
if self._call:
raise _registration_error(MessageType.EVALUATE)

warn_preview_feature("ClientApp-register-evaluate-function")

# Register provided function with the ClientApp object
# Wrap mods around the wrapped step function
self._evaluate = make_ffn(evaluate_fn, self._mods)
Expand Down Expand Up @@ -179,6 +184,8 @@ def query_decorator(query_fn: ClientAppCallable) -> ClientAppCallable:
if self._call:
raise _registration_error(MessageType.QUERY)

warn_preview_feature("ClientApp-register-query-function")

# Register provided function with the ClientApp object
# Wrap mods around the wrapped step function
self._query = make_ffn(query_fn, self._mods)
Expand Down
4 changes: 1 addition & 3 deletions src/py/flwr/client/grpc_rere_client/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
PING_RANDOM_RANGE,
)
from flwr.common.grpc import create_channel
from flwr.common.logger import log, warn_experimental_feature
from flwr.common.logger import log
from flwr.common.message import Message, Metadata
from flwr.common.retry_invoker import RetryInvoker
from flwr.common.serde import message_from_taskins, message_to_taskres
Expand Down Expand Up @@ -103,8 +103,6 @@ def grpc_request_response( # pylint: disable=R0914, R0915
create_node : Optional[Callable]
delete_node : Optional[Callable]
"""
warn_experimental_feature("`grpc-rere`")

if isinstance(root_certificates, str):
root_certificates = Path(root_certificates).read_bytes()

Expand Down
8 changes: 4 additions & 4 deletions src/py/flwr/common/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,13 @@ def configure(
log = logger.log # pylint: disable=invalid-name


def warn_experimental_feature(name: str) -> None:
"""Warn the user when they use an experimental feature."""
def warn_preview_feature(name: str) -> None:
"""Warn the user when they use a preview feature."""
log(
WARN,
"""EXPERIMENTAL FEATURE: %s
"""PREVIEW FEATURE: %s
This is an experimental feature. It could change significantly or be removed
This is a preview feature. It could change significantly or be removed
entirely in future versions of Flower.
""",
name,
Expand Down
3 changes: 3 additions & 0 deletions src/py/flwr/server/server_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from typing import Callable, Optional

from flwr.common import Context, RecordSet
from flwr.common.logger import warn_preview_feature
from flwr.server.strategy import Strategy

from .client_manager import ClientManager
Expand Down Expand Up @@ -120,6 +121,8 @@ def main_decorator(main_fn: ServerAppCallable) -> ServerAppCallable:
""",
)

warn_preview_feature("ServerApp-register-main-function")

# Register provided function with the ServerApp object
self._main = main_fn

Expand Down

0 comments on commit 9420424

Please sign in to comment.