Skip to content

Commit dd90ddb

Browse files
authored
clarify default persistor_id (#2861)
1 parent f33336a commit dd90ddb

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

nvflare/app_common/workflows/base_model_controller.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@
3838
class BaseModelController(Controller, FLComponentWrapper, ABC):
3939
def __init__(
4040
self,
41-
persistor_id="persistor",
41+
persistor_id: str = AppConstants.DEFAULT_PERSISTOR_ID,
4242
ignore_result_error: bool = False,
4343
allow_empty_global_weights: bool = False,
4444
task_check_period: float = 0.5,
4545
):
4646
"""FLModel based controller.
4747
4848
Args:
49-
persistor_id (str, optional): ID of the persistor component. Defaults to "persistor".
49+
persistor_id (str, optional): ID of the persistor component. Defaults to AppConstants.DEFAULT_PERSISTOR_ID ("persistor").
5050
ignore_result_error (bool, optional): whether this controller can proceed if client result has errors.
5151
Defaults to False.
5252
allow_empty_global_weights (bool, optional): whether to allow empty global weights. Some pipelines can have

nvflare/app_common/workflows/model_controller.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,21 @@
1616
from typing import Callable, List, Union
1717

1818
from nvflare.app_common.abstract.fl_model import FLModel
19+
from nvflare.app_common.app_constant import AppConstants
1920
from nvflare.app_common.workflows.base_model_controller import BaseModelController
2021

2122

2223
class ModelController(BaseModelController, ABC):
2324
def __init__(
2425
self,
2526
*args,
26-
persistor_id: str = "persistor",
27+
persistor_id: str = AppConstants.DEFAULT_PERSISTOR_ID,
2728
**kwargs,
2829
):
2930
"""Model Controller API for FLModel-based Controller.
3031
3132
Args:
32-
persistor_id (str, optional): ID of the persistor component. Defaults to "".
33+
persistor_id (str, optional): ID of the persistor component. Defaults to AppConstants.DEFAULT_PERSISTOR_ID ("persistor").
3334
"""
3435
super().__init__(*args, persistor_id, **kwargs)
3536

0 commit comments

Comments
 (0)