Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions datasets/flwr_datasets/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@


def _instantiate_partitioners(
partitioners: dict[str, Partitioner | int]
partitioners: dict[str, Partitioner | int],
) -> dict[str, Partitioner]:
"""Transform the partitioners from the initial format to instantiated objects.

Expand Down Expand Up @@ -95,7 +95,7 @@ def _instantiate_partitioners(


def _instantiate_merger_if_needed(
merger: Preprocessor | dict[str, tuple[str, ...]] | None
merger: Preprocessor | dict[str, tuple[str, ...]] | None,
) -> Preprocessor | None:
"""Instantiate `Merger` if preprocessor is merge_config."""
if merger and isinstance(merger, dict):
Expand Down Expand Up @@ -197,7 +197,7 @@ def _create_division_indices_ranges(


def _check_division_config_types_correctness(
division: list[float] | tuple[float, ...] | dict[str, float]
division: list[float] | tuple[float, ...] | dict[str, float],
) -> None:
if isinstance(division, (list | tuple)):
if not all(isinstance(x, float) for x in division):
Expand All @@ -216,7 +216,7 @@ def _check_division_config_types_correctness(


def _check_division_config_values_correctness(
division: list[float] | tuple[float, ...] | dict[str, float]
division: list[float] | tuple[float, ...] | dict[str, float],
) -> None:
if isinstance(division, (list | tuple)):
if not all(0 < x <= 1 for x in division):
Expand Down Expand Up @@ -254,7 +254,7 @@ def _check_division_config_values_correctness(


def _check_division_config_correctness(
division: list[float] | tuple[float, ...] | dict[str, float]
division: list[float] | tuple[float, ...] | dict[str, float],
) -> None:
_check_division_config_types_correctness(division)
_check_division_config_values_correctness(division)
Expand Down
2 changes: 1 addition & 1 deletion datasets/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ audio = ["soundfile", "librosa"]
types-requests = "==2.31.0.20240125"
types-setuptools = "==69.0.0.20240125"
isort = "==5.13.2"
black = { version = "==24.10.0", extras = ["jupyter"] }
black = { version = "==25.11.0", extras = ["jupyter"] }
taplo = "==0.9.3"
docformatter = "==1.7.5"
mypy = "==1.8.0"
Expand Down
2 changes: 1 addition & 1 deletion dev/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ packages = [{ include = "devtool", from = "./" }]
python = "^3.9"
clang-format = "==17.0.6"
isort = "==5.13.2"
black = { version = "==24.10.0" }
black = { version = "==25.11.0" }
taplo = "==0.9.3"
docformatter = "==1.7.5"
rope = "==1.13.0"
Expand Down
10 changes: 6 additions & 4 deletions framework/docs/source/build.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
.. meta::
:description: Learn how to build Flower apps with step-by-step guides on installation, configuration, strategy implementation, model checkpoints, and more.

Build Flower apps
=================
###################
Build Flower apps
###################

How-to guides
-------------
***************
How-to guides
***************

Problem-oriented how-to guides show step-by-step how to achieve a specific goal.

Expand Down
25 changes: 15 additions & 10 deletions framework/docs/source/contribute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
.. meta::
:description: Join the Flower community! Explore tutorials and guides to contribute code, documentation, translations, and more to advance federated learning with Flower.

Contribute
==========
############
Contribute
############

The Flower community welcomes contributions. The following docs are intended to help
along the way.

Tutorials
---------
***********
Tutorials
***********

A learning-oriented series of tutorials, the best place to start.

Expand All @@ -20,8 +22,9 @@ A learning-oriented series of tutorials, the best place to start.
contributor-tutorial-contribute-on-github
contributor-tutorial-get-started-as-a-contributor

How-to guides
-------------
***************
How-to guides
***************

Problem-oriented how-to guides show step-by-step how to achieve a specific goal.

Expand All @@ -36,8 +39,9 @@ Problem-oriented how-to guides show step-by-step how to achieve a specific goal.
contributor-how-to-contribute-translations
contributor-how-to-build-docker-images

Explanations
------------
**************
Explanations
**************

Understanding-oriented concept guides explain and discuss key topics and underlying
ideas behind Flower and collaborative AI.
Expand All @@ -48,8 +52,9 @@ ideas behind Flower and collaborative AI.

contributor-explanation-public-and-private-apis

References
----------
************
References
************

Information-oriented API reference and other reference material.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Public and private APIs
=======================
#########################
Public and private APIs
#########################

In Python, everything is public. To enable developers to understand which components can
be relied upon, Flower declares a public API. Components that are part of the public API
Expand All @@ -19,8 +20,9 @@ Everything listed in the reference documentation is part of the public API. This
document explains how Flower maintainers define the public API and how you can determine
whether a component is part of the public API or not by reading the Flower source code.

Flower public API
-----------------
*******************
Flower public API
*******************

Flower has a well-defined public API. Let's look at this in more detail.

Expand Down Expand Up @@ -106,8 +108,9 @@ Therefore:
This approach is also implemented in the tooling that automatically builds API reference
docs.

Flower public API of private packages
-------------------------------------
***************************************
Flower public API of private packages
***************************************

We also use this to define the public API of private subpackages. Public, in this
context, means the API that other ``flwr`` subpackages should use. For example,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
How to Build Docker Flower Images Locally
=========================================
###########################################
How to Build Docker Flower Images Locally
###########################################

Flower provides pre-made docker images on `Docker Hub <https://hub.docker.com/u/flwr>`_
that include all necessary dependencies for running the SuperLink, SuperNode or
Expand Down Expand Up @@ -28,8 +29,9 @@ environment.
building the image. All available build arguments for each image are listed in one of
the tables below.

Building the Base Image
-----------------------
*************************
Building the Base Image
*************************

.. list-table::
:widths: 25 45 15 15
Expand Down Expand Up @@ -94,8 +96,9 @@ In this example, we specify our image name as ``flwr_base`` and the tag as ``0.1
Remember that the build arguments as well as the name and tag can be adapted to your
needs. These values serve as examples only.

Building a Flower Binary Image
------------------------------
********************************
Building a Flower Binary Image
********************************

.. list-table::
:widths: 25 45 15 15
Expand Down Expand Up @@ -143,8 +146,9 @@ After creating the image, we can test whether the image is working:

$ docker run --rm flwr_superlink:0.1.0 --help

Direct Reference Examples
-------------------------
***************************
Direct Reference Examples
***************************

.. code-block:: bash
:substitutions:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Contribute translations
=======================
#########################
Contribute translations
#########################

Since `Flower 1.5
<https://flower.ai/docs/framework/ref-changelog.html#v1-5-0-2023-08-31>`_ we have
Expand All @@ -14,8 +15,9 @@ Our translation project is publicly available over on `Weblate
<https://hosted.weblate.org/projects/flower-docs/framework/>`_, this where most of the
work will happen.

Contribute to existing languages
--------------------------------
**********************************
Contribute to existing languages
**********************************

.. youtube:: 10_Xfy5BOfQ
:width: 100%
Expand Down Expand Up @@ -60,8 +62,9 @@ the string.
For more information about translating using Weblate, you can check out this `in-depth
guide <https://docs.weblate.org/en/latest/user/translating.html>`_.

Add new languages
-----------------
*******************
Add new languages
*******************

If you want to add a new language, you will first have to contact us, either on `Slack
<https://flower.ai/join-slack>`_, or by opening an issue on our `GitHub repo
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Develop in VSCode Dev Containers
================================
##################################
Develop in VSCode Dev Containers
##################################

When working on the Flower framework we want to ensure that all contributors use the
same developer environment to format code or run tests. For this purpose we are using
Expand All @@ -22,8 +23,9 @@ the VSCode Remote Containers extension. What is it? Read the following quote:
Source: `Official VSCode documentation
<https://code.visualstudio.com/docs/devcontainers/containers>`_

Getting started
---------------
*****************
Getting started
*****************

Configuring and setting up the ``Dockerfile`` as well the configuration for the
devcontainer can be a bit more involved. The good thing is you don't have to do it.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
Install development versions
============================
##############################
Install development versions
##############################

Install development versions of Flower
--------------------------------------
****************************************
Install development versions of Flower
****************************************

Using Poetry (recommended)
~~~~~~~~~~~~~~~~~~~~~~~~~~
==========================

Install a ``flwr`` pre-release from PyPI: update the ``flwr`` dependency in
``pyproject.toml`` and then reinstall (don't forget to delete ``poetry.lock`` (``rm
Expand All @@ -30,7 +32,7 @@ Please refer to the Poetry documentation for further details: `Poetry Dependency
Specification <https://python-poetry.org/docs/dependency-specification/>`_

Using pip (recommended on Colab)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
================================

Install a ``flwr`` pre-release from PyPI:

Expand All @@ -57,8 +59,9 @@ Install ``flwr`` from a specific GitHub branch (``branch-name``):
'flwr[simulation]@git+https://github.com/adap/flower.git@branch-name#subdirectory=framework'``
(with extras)

Open Jupyter Notebooks on Google Colab
--------------------------------------
****************************************
Open Jupyter Notebooks on Google Colab
****************************************

Open the notebook
``framework/docs/source/tutorial-series-get-started-with-flower-pytorch.ipynb``:
Expand Down
24 changes: 14 additions & 10 deletions framework/docs/source/contributor-how-to-release-flower.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
Release Flower
==============
################
Release Flower
################

This document describes the current release process. It may or may not change in the
future.

During the release
------------------
********************
During the release
********************

The version number of a release is stated in ``./framework/pyproject.toml``. To release
a new version of Flower, the following things need to happen (in that order):
Expand All @@ -21,8 +23,9 @@ a new version of Flower, the following things need to happen (in that order):
correct artifacts and the relevant part of the changelog.
3. Check the draft release on GitHub, and if everything is good, publish it.

After the release
-----------------
*******************
After the release
*******************

Create a pull request which contains the following changes:

Expand All @@ -35,11 +38,12 @@ Create a pull request which contains the following changes:
Merge the pull request on the same day (i.e., before a new nightly release gets
published to PyPI).

Publishing a pre-release
------------------------
**************************
Publishing a pre-release
**************************

Pre-release naming
~~~~~~~~~~~~~~~~~~
==================

PyPI supports pre-releases (alpha, beta, release candidate). Pre-releases MUST use one
of the following naming patterns:
Expand Down Expand Up @@ -68,7 +72,7 @@ details consult the `Semantic Versioning Specification
precedence).

Pre-release classification
~~~~~~~~~~~~~~~~~~~~~~~~~~
==========================

Should the next pre-release be called alpha, beta, or release candidate?

Expand Down
Loading
Loading