From af6af25c82f91d0e3a78dfff6071b3b423cdf3d1 Mon Sep 17 00:00:00 2001 From: JMGaljaard Date: Mon, 30 May 2022 12:36:12 +0200 Subject: [PATCH] Update tests and resolve accidental recursion --- fltk/util/task/config/parameter.py | 8 +++++--- tests/core/client_smoke_test.py | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/fltk/util/task/config/parameter.py b/fltk/util/task/config/parameter.py index 82d98f4b..40870e4c 100644 --- a/fltk/util/task/config/parameter.py +++ b/fltk/util/task/config/parameter.py @@ -225,7 +225,7 @@ class LearningParameters: Dataclass containing configuration parameters for the learning process itself. This includes the Federated learning parameters as well as some system parameters like cuda. """ - _total_epochs: int = field(metadata=config(field_name='total_epochs')) + _total_epochs: int = field(metadata=config(field_name='totalEpochs')) cuda: bool rounds: Optional[int] = None epochs_per_round: Optional[int] = None @@ -236,8 +236,10 @@ class LearningParameters: @property def total_epochs(self): logging.warning('By default `total_epochs` is not used duruing Federated Learning. This attribute will be' - 'changed in a comming release.') - return self.total_epochs + 'changed in a coming release.') + return self._total_epochs + + @dataclass_json(letter_case=LetterCase.CAMEL) @dataclass(frozen=True) class ExperimentConfiguration: diff --git a/tests/core/client_smoke_test.py b/tests/core/client_smoke_test.py index b68a0bef..421b72ae 100644 --- a/tests/core/client_smoke_test.py +++ b/tests/core/client_smoke_test.py @@ -73,5 +73,5 @@ def test_fed_client(self, name, net: Nets, dataset: Dataset): self.assertTrue(fed_client.is_ready()) with patch.object(DS, 'get_train_dataset', fed_client.dataset): - self.assertTrue(fed_client.exec_round(1)) + self.assertTrue(fed_client.exec_round(1, 0))