Skip to content

Commit

Permalink
Formatting for entire openfl namespace (including experimental) (#998)
Browse files Browse the repository at this point in the history
* Point linter and formatter to full openfl namespace

Signed-off-by: Shah, Karan <[email protected]>

* Migrate to absolute imports

Signed-off-by: Shah, Karan <[email protected]>

* Replace f-strings with lazy interpolation

Signed-off-by: Shah, Karan <[email protected]>

* Fix wrong import

Signed-off-by: Shah, Karan <[email protected]>

* Fix fstring bug from auto-substitution

Signed-off-by: Shah, Karan <[email protected]>

* Temporarily remove copyright headers

Signed-off-by: Shah, Karan <[email protected]>

* Top-level blanklines remove

Signed-off-by: Shah, Karan <[email protected]>

* Fix C0415: All imports top-level.

Signed-off-by: Shah, Karan <[email protected]>

* Fix residual import errors

Signed-off-by: Shah, Karan <[email protected]>

* Fix more residual import errors

Signed-off-by: Shah, Karan <[email protected]>

* [residual] Revert toplevel import of fw loaders

Signed-off-by: Shah, Karan <[email protected]>

* Add pylint exceptions of C0415

Signed-off-by: Shah, Karan <[email protected]>

* Fix R1725 - python3 style super

Signed-off-by: Shah, Karan <[email protected]>

* Fix R0205 - useless object inheritance

Signed-off-by: Shah, Karan <[email protected]>

* Fix W1406, C0325

Signed-off-by: Shah, Karan <[email protected]>

* Add license headers

Signed-off-by: Shah, Karan <[email protected]>

* Apply formatting

Signed-off-by: Shah, Karan <[email protected]>

* Silence F821 and fix dict.fromkeys

Signed-off-by: Shah, Karan <[email protected]>

* Update linter action with new lint script

Signed-off-by: Shah, Karan <[email protected]>

* Update flake8 line-length to 100

Signed-off-by: Shah, Karan <[email protected]>

* Apply formatting changes

Signed-off-by: Shah, Karan <[email protected]>

* Remove keyword args in dict.fromkeys

Signed-off-by: Shah, Karan <[email protected]>

* Update linter requirements

Signed-off-by: Shah, Karan <[email protected]>

* Switch to classname type checking to avoid circular imports

Signed-off-by: Shah, Karan <[email protected]>

* Disable certify test due to import bug

Signed-off-by: Shah, Karan <[email protected]>

* Replace with SPDX identifier license

Signed-off-by: Shah, Karan <[email protected]>

* Fix wrong import

Signed-off-by: Shah, Karan <[email protected]>

---------

Signed-off-by: Shah, Karan <[email protected]>
  • Loading branch information
MasterSkepticista authored Jul 24, 2024
1 parent 37b59b1 commit 660ad32
Show file tree
Hide file tree
Showing 193 changed files with 5,690 additions and 5,369 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Lint with Flake8
name: Check code format

on:
pull_request:
Expand All @@ -21,11 +21,9 @@ jobs:
uses: actions/setup-python@v3
with:
python-version: "3.8"
- name: Install dependencies
- name: Install linters
run: |
python -m pip install --upgrade pip
pip install -r requirements-linters.txt
pip install .
- name: Lint with flake8
run: |
flake8 --show-source
- name: Lint using built-in script
run: bash shell/lint.sh
9 changes: 4 additions & 5 deletions openfl/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Copyright (C) 2020-2023 Intel Corporation
# Copyright 2020-2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""openfl base package."""
from .__version__ import __version__
# flake8: noqa
#from .interface.model import get_model


from openfl.__version__ import __version__
6 changes: 4 additions & 2 deletions openfl/__version__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Copyright (C) 2020-2023 Intel Corporation
# Copyright 2020-2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0


"""openfl version information."""
__version__ = '1.5'
__version__ = "1.5"
36 changes: 15 additions & 21 deletions openfl/component/__init__.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
# Copyright (C) 2020-2023 Intel Corporation
# Copyright 2020-2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

"""openfl.component package."""

from .aggregator import Aggregator
from .assigner import Assigner
from .assigner import RandomGroupedAssigner
from .assigner import StaticGroupedAssigner
from .collaborator import Collaborator
from .straggler_handling_functions import StragglerHandlingFunction
from .straggler_handling_functions import CutoffTimeBasedStragglerHandling
from .straggler_handling_functions import PercentageBasedStragglerHandling

__all__ = [
'Assigner',
'RandomGroupedAssigner',
'StaticGroupedAssigner',
'Aggregator',
'Collaborator',
'StragglerHandlingFunction',
'CutoffTimeBasedStragglerHandling',
'PercentageBasedStragglerHandling'
]
from openfl.component.aggregator.aggregator import Aggregator
from openfl.component.assigner.assigner import Assigner
from openfl.component.assigner.random_grouped_assigner import RandomGroupedAssigner
from openfl.component.assigner.static_grouped_assigner import StaticGroupedAssigner
from openfl.component.collaborator.collaborator import Collaborator
from openfl.component.straggler_handling_functions.cutoff_time_based_straggler_handling import (
CutoffTimeBasedStragglerHandling,
)
from openfl.component.straggler_handling_functions.percentage_based_straggler_handling import (
PercentageBasedStragglerHandling,
)
from openfl.component.straggler_handling_functions.straggler_handling_function import (
StragglerHandlingFunction,
)
9 changes: 2 additions & 7 deletions openfl/component/aggregator/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# Copyright (C) 2020-2023 Intel Corporation
# Copyright 2020-2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

"""Aggregator package."""

from .aggregator import Aggregator

__all__ = [
'Aggregator',
]
from openfl.component.aggregator.aggregator import Aggregator
Loading

0 comments on commit 660ad32

Please sign in to comment.