Skip to content

Commit

Permalink
Add taplo config
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesbvll committed Sep 24, 2024
1 parent a8c7244 commit b80f7ba
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 18 deletions.
8 changes: 1 addition & 7 deletions dev/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -e
cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../

taplo fmt pyproject.toml
taplo fmt

# Python
python -m flwr_tool.check_copyright src/py/flwr
Expand All @@ -19,19 +19,16 @@ find src/proto/flwr/proto -name *.proto | grep "\.proto" | xargs clang-format -i
# Examples
python -m black -q examples
python -m docformatter -i -r examples
taplo fmt examples/*/pyproject.toml

# Benchmarks
python -m isort benchmarks
python -m black -q benchmarks
python -m docformatter -i -r benchmarks
taplo fmt benchmarks/**/pyproject.toml

# E2E
python -m isort e2e
python -m black -q e2e
python -m docformatter -i -r e2e
taplo fmt e2e/*/pyproject.toml

# Notebooks
python -m black --ipynb -q doc/source/*.ipynb
Expand All @@ -41,6 +38,3 @@ python -m nbstripout examples/*/*.ipynb --extra-keys "$KEYS"

# Markdown
python -m mdformat --number doc/source examples

# Dev
taplo fmt dev/*.toml
6 changes: 1 addition & 5 deletions dev/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,7 @@ echo "- All Markdown checks passed"
echo "- Start TOML checks"

echo "- taplo: start"
taplo fmt pyproject.toml --check
taplo fmt examples/*/pyproject.toml --check
taplo fmt e2e/*/pyproject.toml --check
taplo fmt dev/*.toml --check
taplo fmt benchmarks/**/pyproject.toml --check
taplo fmt --check
echo "- taplo: done"

echo "- All TOML checks passed"
Expand Down
2 changes: 1 addition & 1 deletion examples/advanced-pytorch/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ default = "local-sim"

[tool.flwr.federations.local-sim]
options.num-supernodes = 50
options.backend.client-resources.num-cpus = 2 # each ClientApp assumes to use 2CPUs
options.backend.client-resources.num-cpus = 2 # each ClientApp assumes to use 2CPUs
options.backend.client-resources.num-gpus = 0.0 # ratio of VRAM a ClientApp has access to
[tool.flwr.federations.local-sim-gpu]
options.num-supernodes = 50
Expand Down
2 changes: 1 addition & 1 deletion examples/flowertune-vit/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ options.num-supernodes = 10

[tool.flwr.federations.local-simulation-gpu]
options.num-supernodes = 10
options.backend.client-resources.num-cpus = 2 # each ClientApp assumes to use 2CPUs
options.backend.client-resources.num-cpus = 2 # each ClientApp assumes to use 2CPUs
options.backend.client-resources.num-gpus = 0.2 # at most 5 ClientApp will run in a given GPU
2 changes: 1 addition & 1 deletion examples/quickstart-huggingface/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ options.num-supernodes = 100

[tool.flwr.federations.local-simulation-gpu]
options.num-supernodes = 100
options.backend.client-resources.num-cpus = 4 # each ClientApp assumes to use 4CPUs
options.backend.client-resources.num-cpus = 4 # each ClientApp assumes to use 4CPUs
options.backend.client-resources.num-gpus = 0.25 # at most 4 ClientApp will run in a given GPU (lower it to increase parallelism)
2 changes: 1 addition & 1 deletion examples/quickstart-mlcube/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ authors = ["The Flower Authors <[email protected]>"]

[tool.poetry.dependencies]
python = ">=3.9,<3.11"
flwr = ">=1.0,<2.0" # For development: { path = "../../", develop = true }
flwr = ">=1.0,<2.0" # For development: { path = "../../", develop = true }
tensorflow-cpu = { version = ">=2.9.1,<2.11.1 || >2.11.1", markers = "platform_machine == \"x86_64\"" }
tensorflow-macos = { version = ">=2.9.1,<2.11.1 || >2.11.1", markers = "sys_platform == \"darwin\" and platform_machine == \"arm64\"" }
mlcube = "0.0.9"
Expand Down
2 changes: 1 addition & 1 deletion examples/xgboost-quickstart/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fraction-evaluate = 0.1
# ClientApp
local-epochs = 1
params.objective = "binary:logistic"
params.eta = 0.1 # Learning rate
params.eta = 0.1 # Learning rate
params.max-depth = 8
params.eval-metric = "auc"
params.nthread = 16
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ flower-superlink = "flwr.server.app:run_superlink"
flower-supernode = "flwr.client.supernode.app:run_supernode"
flower-server-app = "flwr.server.run_serverapp:run_server_app"
flwr-clientapp = "flwr.client.clientapp:flwr_clientapp"
flower-client-app = "flwr.client.supernode:run_client_app" # Deprecated
flower-client-app = "flwr.client.supernode:run_client_app" # Deprecated

[tool.poetry.dependencies]
python = "^3.9"
Expand Down
24 changes: 24 additions & 0 deletions taplo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
include = ["**/*.toml"]
exclude = ["baselines/**", "datasets/**"]

[formatting]
align_comments = false
# Defaults below
align_entries = false
array_trailing_comma = true
array_auto_expand = true
array_auto_collapse = true
compact_arrays = true
compact_inline_tables = false
inline_table_expand = true
compact_entries = false
column_width = 80
indent_tables = false
indent_entries = false
indent_string = " "
trailing_newline = true
reorder_keys = false
reorder_arrays = false
reorder_inline_tables = false
allowed_blank_lines = 2
crlf = false

0 comments on commit b80f7ba

Please sign in to comment.