Repository navigation
docs: add quickstart and concepts pages with drift-proof code blocks - #56
Merged
Merged
Conversation
- quickstart.rst: a first federated training run; the shown code is embedded via literalinclude from the runnable script test-files/quickstart.py, so documentation blocks cannot drift from the executable source - concepts.rst: the four building blocks (dataset, model, server, client), algorithm hooks, and the fixed per-round order - index.rst: Getting started now lists install, quickstart, concepts - examples.rst: the empty placeholder page becomes an orphan redirect stub pointing to quickstart - cli.rst: replace the hand-copied YAML block, which had drifted from example-configs/all-alg-fedprox-femnist.yml and was not parseable, with a literalinclude of the source file - test/test_tutorial_scripts.py: behavioral smoke tests for the tutorial scripts, executed under runpy with an isolated log directory; asserts the tutorial runtime budget from each run's config.json and that every literalinclude target in the docs exists - zh_CN translations for the new and updated pages
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #56 +/- ##
==========================================
+ Coverage 82.32% 82.39% +0.07%
==========================================
Files 55 55
Lines 5640 5640
==========================================
+ Hits 4643 4647 +4
+ Misses 997 993 -4 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
docs/source/quickstart.rst): a first federated training run (FedAvg onFedSynthetic). Every shown code block is embedded via Sphinxliteralincludefrom the runnable scripttest-files/quickstart.py, so the docs and the executable source cannot drift apart. Fragment boundaries in the script are delimited by marker comments (# --- begin/end: core ---).docs/source/concepts.rst): the four building blocks (FedDataset / model / Server / Client), the algorithm-hook model (20 registered algorithms customize hooks, not the loop), and the fixed per-round execution order.examples.rstplaceholder becomes an:orphan:redirect stub pointing to the new pages, preserving old URLs; itszh_CNcatalog is updated instead of deleted.docs/source/cli.rst: the hand-copied YAML block had drifted fromexample-configs/all-alg-fedprox-femnist.yml(indentation, algorithm list, interpolated values) and was not parseable as-is; it is now aliteralincludeof the source file.test/test_tutorial_scripts.py: behavioral smoke tests that execute the tutorial scripts in-process (runpy withrun_name="__main__", isolated temporary log directory,sys.pathrestored afterwards), assert the tutorial runtime budget from each run'sconfig.json(num_iters <= 5,num_clients <= 30, one local epoch), and verify that everyliteralincludetarget in the docs exists.Validation
pytest test/test_tutorial_scripts.py test/test_executors.py test/test_hook_contract.py test/test_nodes.py test/test_messages.py test/test_custom.py: 44 passed.