Skip to content

Commit

Permalink
fix stacklevel error
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadnaseri committed Dec 21, 2023
1 parent bbeb1a5 commit 437de39
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/py/flwr/server/strategy/dpfedavg_adaptive.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ class DPFedAvgAdaptive(DPFedAvgFixed):
warnings.warn(
"DPFedAvgAdaptive is deprecated and will be removed in future versions.",
DeprecationWarning,
stacklevel=2,
)
"""Wrapper for configuring a Strategy for DP with Adaptive Clipping."""

# pylint: disable=too-many-arguments,too-many-instance-attributes
# pylint: disable=too-many-arguments,too-many-instance-attributes,line-too-long,missing-docstring
def __init__(
self,
strategy: Strategy,
Expand All @@ -53,6 +54,7 @@ def __init__(
warnings.warn(
"DPFedAvgAdaptive is deprecated and will be removed in future versions.",
DeprecationWarning,
stacklevel=2,
)

super().__init__(
Expand Down
4 changes: 3 additions & 1 deletion src/py/flwr/server/strategy/dpfedavg_fixed.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ class DPFedAvgFixed(Strategy):
warnings.warn(
"DPFedAvgFixed is deprecated and will be removed in future versions.",
DeprecationWarning,
stacklevel=2,
)
"""Wrapper for configuring a Strategy for DP with Fixed Clipping."""

# pylint: disable=too-many-arguments,too-many-instance-attributes
# pylint: disable=too-many-arguments,too-many-instance-attributes, line-too-long
def __init__(
self,
strategy: Strategy,
Expand All @@ -48,6 +49,7 @@ def __init__(
warnings.warn(
"DPFedAvgFixed is deprecated and will be removed in future versions.",
DeprecationWarning,
stacklevel=2,
)

super().__init__()
Expand Down

0 comments on commit 437de39

Please sign in to comment.