Skip to content

Commit

Permalink
Gantt chart: misc fixes and documentation (bids-standard#363)
Browse files Browse the repository at this point in the history
* misc fixes and start doc

* manage black exclude via gitignore

* switch precommit large file check back on, license year

* add documentation

* fix link

* adjust linkcheck settings

* Update LICENSE

* fix bids dashboard links
  • Loading branch information
sappelhoff authored Jan 10, 2024
1 parent 3610df1 commit 52082cb
Show file tree
Hide file tree
Showing 14 changed files with 40 additions and 32 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ __pycache__
.sass-cache
tools/inputs
tools/*.html
env/
_pages/bids_timeline.html
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repos:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
# - id: check-added-large-files
- id: check-added-large-files
- id: check-case-conflict

- repo: https://github.com/codespell-project/codespell
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Attribution 4.0 International

Copyright (c) 2020-2023, BIDS Contributors.
Copyright (c) 2020, BIDS Contributors.

=======================================================================

Expand Down
2 changes: 1 addition & 1 deletion _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"url": "http://bids.neuroimaging.io",
"sameAs": [
"https://en.wikipedia.org/wiki/Brain_Imaging_Data_Structure",
"https://twitter.com/BIDSstandard"
"https://x.com/BIDSstandard"
]
}
</script>
Expand Down
6 changes: 3 additions & 3 deletions _layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"url": "http://bids.neuroimaging.io",
"sameAs": [
"https://en.wikipedia.org/wiki/Brain_Imaging_Data_Structure",
"https://twitter.com/BIDSstandard"
"https://x.com/BIDSstandard"
]
}
</script>
Expand Down Expand Up @@ -106,7 +106,7 @@
{% if site.show_footer %}
<footer class="site-footer">
<div class="container">
<a href="https://x.com/BIDSstandard?ref_src=twsrc%5Etfw" target="_blank">X</a>
<a href="https://x.com/BIDSstandard" target="_blank">X</a>
<a href="https://fosstodon.org/@bidsstandard/" target="_blank">Mastodon</a>
<a href="https://bsky.app/profile/bidsstandard.bsky.social/" target="_blank">Bluesky</a>
</div>
Expand All @@ -127,7 +127,7 @@
anchors.add('h6');
</script>

<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
<script async src="https://platform.x.com/widgets.js" charset="utf-8"></script>

{% include tracking.html %}

Expand Down
4 changes: 2 additions & 2 deletions _pages/governance.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ Past members of the Maintainers group are:
If you need to contact the maintainers on a specific topic you can use the following emails:

- bids-website and domain ( [Stefan Appelhoff](mailto:bids.maintenance+website@gmail.com) )
- [Twitter account](https://twitter.com/bidsstandard){:target="_blank"} ( [Stefan Appelhoff](mailto:bids.maintenance+twitter@gmail.com) )
- [Twitter account](https://x.com/bidsstandard){:target="_blank"} ( [Stefan Appelhoff](mailto:bids.maintenance+twitter@gmail.com) )
- [Mastodon account](https://fosstodon.org/@bidsstandard){:target="_blank"} ( [Rémi Gau](mailto:bids.maintenance+youtube@gmail.com) )
- [Youtube account](https://www.youtube.com/@brainimagingdatastructure6721){:target="_blank"} ( [Rémi Gau](mailto:bids.maintenance+youtube@gmail.com) )

Expand Down Expand Up @@ -272,7 +272,7 @@ letter via a "read-only" Google Document addressed to the BIDS Steering
Group. The open letter will be posted on: the [BIDS-Specification
GitHub](https://github.com/bids-standard/bids-specification){:target="_blank"}, [Google
Group](https://groups.google.com/forum/#!forum/bids-discussion){:target="_blank"}, and
[Twitter](https://twitter.com/BIDSstandard){:target="_blank"}. This proposal will state
[Twitter](https://x.com/BIDSstandard){:target="_blank"}. This proposal will state
what their group aims and goals are.

### BIDS Community
Expand Down
2 changes: 1 addition & 1 deletion _pages/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ If you are interested in receiving occasional updates around BIDS, feel free to

- The `bids-discussions` Google Group for [updates via email](https://groups.google.com/g/bids-discussion){:target="_blank"}
- Follow BIDS on:
- [x](https://x.com/BIDSstandard?ref_src=twsrc%5Etfw){:target="_blank"}
- [x](https://x.com/BIDSstandard){:target="_blank"}
- [Mastodon](https://fosstodon.org/@bidsstandard/){:target="_blank"}
- [Bluesky](https://bsky.app/profile/bidsstandard.bsky.social/){:target="_blank"}
- Join the [Brainhack Mattermost](https://mattermost.brainhack.org/) for a number of BIDS-related channels
Expand Down
2 changes: 1 addition & 1 deletion _posts/2022-10-29-BIDS-Version-1.8.0-Release.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ along with the complete changelog:
[https://bids-specification.readthedocs.io/en/v1.8.0/CHANGES.html](https://bids-specification.readthedocs.io/en/v1.8.0/CHANGES.html){:target="_blank"}

See also the corresponding tweet-thread:
[https://twitter.com/BIDSstandard/status/1586327298608955392](https://twitter.com/BIDSstandard/status/1586327298608955392){:target="_blank"}
[https://x.com/BIDSstandard/status/1586327298608955392](https://x.com/BIDSstandard/status/1586327298608955392){:target="_blank"}

A huge thanks to all contributors involved!
5 changes: 2 additions & 3 deletions _posts/2023-07-06-Steering-Group-minutes.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,7 @@ Zotero collection for tracking BIDS related publications, BEPs, etc:

The BIDS grant writing kit could be updated

There is also a github for this:
[[https://github.com/Remi-Gau/bids\_citations/blob/main/dashboard.md]{.underline}](https://github.com/Remi-Gau/bids_citations/blob/main/dashboard.md)
See also this [GitHub repo](https://github.com/bids-standard/grant_writing_kit/blob/main/README.md#dashboards)

This info should also be displayed on the BIDS.io website

Expand All @@ -163,7 +162,7 @@ Suggested to include grant writing boilerplate info about BIDS stats
Add rationale at the beginning of both the [[BIDS grant writing
kit]{.underline}](https://docs.google.com/document/d/1Q7JTOvUqt05YQfnbvGoP1SZQy_CGkNEVcsVZeS4D5_o/edit#heading=h.pb4yuopfe1pt)
and [[Remi's github
dashboard]{.underline}](https://github.com/Remi-Gau/bids_citations/blob/main/dashboard.md)
dashboard]{.underline}](https://github.com/bids-standard/grant_writing_kit/blob/main/README.md#dashboards)

Is the BIDS granting writing kit meant to support building the BIDS
community or for users to mention BIDS in their grants.
Expand Down
2 changes: 1 addition & 1 deletion md_link_check_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"pattern": "^/get_involved$"
},
{
"pattern": "^https://twitter.com/[BIDSbids]*standard.*"
"pattern": "^https://x.com/[BIDSbids]*standard.*"
},
{
"pattern": "drupal.org\/governance"
Expand Down
10 changes: 1 addition & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
[tool.black]
line-length = 99
target-version = ['py39']
exclude = '''
(
/(
\.git
| env
)/
)
'''
target-version = ["py39"]
12 changes: 12 additions & 0 deletions tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,15 @@ This README file describes the tools under the `/tools` directory of the bids-we
1. From the command line, navigate to `tools`, and then run `make all`
1. Clean up, check the newly added files, commit

## Update the Gantt chart of completed BEPs

There are two ways of creating Gantt charts for a BIDS timeline.
First install all Python requirements under `tools/requirements.txt`.
Then, use one of the following two methods:

1. `python -u tools/bep_gantt_html_create` creates a file: `_pages/bids_timeline.html` that you can inspect in your browser.
This file depends on the `tools/timeline.csv` data, which you should keep up to date.
1. `python -u tools/bep_gantt_mermaid_insert` directly inserts code for a "mermaid" Gantt chart into the Get Involved page of the website.
You can inspect how that chart looks by building the website using Jekyll and serving locally.
This code depends on data from the files `beps_completed.yml` files in the `_data` directory.
You should keep that file up to date.
14 changes: 8 additions & 6 deletions tools/bep_gant_chart.py → tools/bep_gantt_html_create.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Creates a gant chart for the completed BEPs.
"""Creates a Gantt chart for the completed BEPs.
Also include a timeline of the main BIDS events.
"""
Expand All @@ -10,7 +10,7 @@
import pandas as pd
import plotly.express as px
import plotly.graph_objects as go
import ruamel.yaml as yaml
from ruamel.yaml import YAML
from pyzotero import zotero

INCLUDE_PATCHES = False
Expand All @@ -31,7 +31,8 @@ def create_bep_timeline() -> type[go.Figure]:
completd_beps = data_dir() / "beps_completed.yml"

with open(completd_beps, "r") as f:
data = yaml.safe_load(f)
yaml = YAML(typ="safe", pure=True)
data = yaml.load(f)

df = []

Expand Down Expand Up @@ -140,9 +141,9 @@ def add_publications_to_timeline(fig: go.Figure) -> type[go.Figure]:
dois = []
dates = []
for item in items:
titles.append(item["data"].get("title"))
dois.append(item["data"]["DOI"])
dates.append(item["data"]["date"])
titles.append(item["data"].get("title", "n/a"))
dois.append(item["data"].get("DOI", "n/a"))
dates.append(item["data"].get("date", "n/a"))

fig.add_trace(
go.Scatter(
Expand Down Expand Up @@ -191,6 +192,7 @@ def main():
fig.show()

# save as html
# NOTE: This file is ignored in git (see .gitignore)
fig.write_html(root_dir() / "_pages" / "bids_timeline.html")


Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""Creates a gant chart for the completed BEPs"""
"""Creates a Gantt chart for the completed BEPs"""
from __future__ import annotations

from pathlib import Path

import pandas as pd
import ruamel.yaml as yaml
from ruamel.yaml import YAML
from rich import print


Expand All @@ -30,7 +30,8 @@ def get_bep_timeline() -> pd.DataFrame:
completd_beps = data_dir() / "beps_completed.yml"

with open(completd_beps, "r") as f:
data = yaml.safe_load(f)
yaml = YAML(typ="safe", pure=True)
data = yaml.load(f)

df = []

Expand Down

0 comments on commit 52082cb

Please sign in to comment.