Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add table of baselines to docs #2400

Merged
merged 35 commits into from
Oct 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
fd461a4
Add script
charlesbvll Sep 5, 2023
926b77f
Ignore files changed and created
charlesbvll Sep 5, 2023
63eaea3
Build baseline docs in the same script
charlesbvll Sep 5, 2023
b9585bb
Merge branch 'main' of https://github.com/adap/flower into build-base…
charlesbvll Sep 5, 2023
d982da4
Update gitignore to ignore png files
charlesbvll Sep 5, 2023
a36ece4
Remove pictures correctly
charlesbvll Sep 5, 2023
f0b9379
Remove images correctly
charlesbvll Sep 5, 2023
d09f148
Merge branch 'main' into build-baselines-docs
tanertopal Sep 6, 2023
0b2608f
Merge branch 'main' into build-baselines-docs
jafermarq Sep 12, 2023
d51f902
wip
jafermarq Sep 20, 2023
0b7154c
merge w/ main
jafermarq Sep 20, 2023
3f85242
multirow
jafermarq Sep 20, 2023
443d7fc
rm
jafermarq Sep 20, 2023
35b5fb5
Remove brackets and add link
charlesbvll Sep 21, 2023
05af340
Use more recognizable tokens for anchors
charlesbvll Sep 21, 2023
837f9a9
Merge branch 'main' of https://github.com/adap/flower into table-for-…
charlesbvll Sep 21, 2023
be269b1
Rename anchor
charlesbvll Sep 21, 2023
dfa903b
Try fixing the CI
charlesbvll Sep 21, 2023
e979ebd
Remove angle brackets
charlesbvll Sep 21, 2023
d57076d
Revert change
charlesbvll Sep 21, 2023
24b9eb9
Add debug command
charlesbvll Sep 21, 2023
8e45778
Remove debug command
charlesbvll Sep 21, 2023
30d0fcd
Merge branch 'main' into table-for-baseline-docs
jafermarq Oct 10, 2023
6aa94cd
merge
jafermarq Oct 12, 2023
ce0243a
support several images in readme
jafermarq Oct 12, 2023
d8a35d0
Merge branch 'main' into build-baselines-docs
jafermarq Oct 12, 2023
0f3d3f3
reflect in changelog
jafermarq Oct 12, 2023
f5deeae
buil versioned docs as last stage
jafermarq Oct 12, 2023
b18df73
smaller font pt16
jafermarq Oct 12, 2023
0fb8878
Merge branch 'main' into table-for-baseline-docs
jafermarq Oct 12, 2023
5c83007
Merge branch 'build-baselines-docs' into table-for-baseline-docs
jafermarq Oct 12, 2023
ac9d890
added to changelog
jafermarq Oct 12, 2023
62a6bd5
merge
jafermarq Oct 12, 2023
02718ec
Merge branch 'main' into table-for-baseline-docs
tanertopal Oct 12, 2023
bb668e1
Merge branch 'main' into table-for-baseline-docs
danieljanes Oct 14, 2023
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
2 changes: 2 additions & 0 deletions baselines/doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Flower Baselines

Flower Baselines are a collection of organised scripts used to reproduce results from well-known publications or benchmarks. You can check which baselines already exist and/or contribute your own baseline.

.. BASELINES_TABLE_ANCHOR

Tutorials
~~~~~~~~~

Expand Down
46 changes: 46 additions & 0 deletions dev/build-baseline-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,48 @@ initial_text=$(cat <<-END
END
)

table_body="\\
.. list-table:: \\
:widths: 15 15 50\\
:header-rows: 1\\
\\
* - Method\\
- Dataset\\
- Tags\\
.. BASELINES_TABLE_ENTRY\\
"


function add_table_entry ()
{
# extract lines from markdown file between --- and ---, preserving newlines and store in variable called metadata
metadata=$(awk '/^---$/{flag=1; next} flag; /^---$/{exit}' $1/README.md)

# get text after "title:" in metadata using sed
title=$(echo "$metadata" | sed -n 's/title: //p')

# get text after "url:" in metadata using sed
url=$(echo "$metadata" | sed -n 's/url: //p')

# get text after "labels:" in metadata using sed
labels=$(echo "$metadata" | sed -n 's/labels: //p' | sed 's/\[//g; s/\]//g')

# get text after "dataset:" in metadata using sed
dataset=$(echo "$metadata" | sed -n 's/dataset: //p' | sed 's/\[//g; s/\]//g')

table_entry="\\
* - \`$1 <$1.html>\`_\\
- $dataset\\
- $labels\\
\\
.. BASELINES_TABLE_ENTRY\
"
}


# Create Sphinx table block and header
! sed -i '' -e "s/.. BASELINES_TABLE_ANCHOR/$table_body/" $INDEX

! grep ":caption: References" $INDEX && echo "$initial_text" >> $INDEX && echo "" >> $INDEX

rm -f "baselines/doc/source/*.md"
Expand Down Expand Up @@ -46,6 +88,10 @@ for d in $(printf '%s\n' */ | sort -V); do
# For each baseline, insert the name of the baseline into the index file
echo " $baseline" >> $INDEX

# Add entry to the table
add_table_entry $baseline
! sed -i '' -e "s/.. BASELINES_TABLE_ENTRY/$table_entry/" $INDEX

fi
fi
done
Expand Down
2 changes: 1 addition & 1 deletion doc/source/ref-changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

- FedProx ([#2210](https://github.com/adap/flower/pull/2210), [#2286](https://github.com/adap/flower/pull/2286))

- Baselines Docs ([#2290](https://github.com/adap/flower/pull/2290))
- Baselines Docs ([#2290](https://github.com/adap/flower/pull/2290), [#2400](https://github.com/adap/flower/pull/2400))

- **Update Flower Examples** ([#2384](https://github.com/adap/flower/pull/2384)), ([#2425](https://github.com/adap/flower/pull/2425))

Expand Down