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

[ENH] Add filename template legend #1219

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f49ca5e
install tools as editable via requirements
Remi-Gau Aug 17, 2022
d57614e
update doc
Remi-Gau Aug 17, 2022
453fef6
add legend
Remi-Gau Aug 17, 2022
c283e2c
update CI
Remi-Gau Aug 17, 2022
b76547b
add black to pre-commit and apply
Remi-Gau Aug 17, 2022
a33f3da
add flake8 to precommit
Remi-Gau Aug 17, 2022
866e248
lint
Remi-Gau Aug 17, 2022
b7adfcb
Merge branch 'master' into add_legend
effigies Aug 17, 2022
6e28924
Update tools/schemacode/bidsschematools/render.py
Remi-Gau Aug 17, 2022
718e2b3
Merge branch 'master' into add_legend
effigies Aug 17, 2022
bf6ad1f
Update tools/schemacode/bidsschematools/render.py
Remi-Gau Aug 18, 2022
d77e072
Merge branch 'master' into add_legend
Remi-Gau Aug 24, 2022
f519b30
update legend
Remi-Gau Aug 24, 2022
281227d
use pdf format
Remi-Gau Aug 24, 2022
9328b7c
lint
Remi-Gau Aug 24, 2022
a60078f
remove indent
Remi-Gau Aug 24, 2022
446de51
remove indent
Remi-Gau Aug 24, 2022
1ab1836
fix pdf build
Remi-Gau Aug 24, 2022
91ed8ef
lint
Remi-Gau Aug 24, 2022
0af8ce6
try fixing html rendering
Remi-Gau Aug 24, 2022
2397466
remove extra punctuation
Remi-Gau Aug 24, 2022
6b7d7f9
lint
Remi-Gau Aug 24, 2022
8f086b8
use markdown render
Remi-Gau Aug 24, 2022
7169abf
add python import sort to pre commit and apply to non-schema code
Remi-Gau Aug 24, 2022
f7625cd
lint
Remi-Gau Aug 24, 2022
86a7c30
Merge branch 'master' into add_legend
Remi-Gau Aug 24, 2022
06ff974
Update tools/schemacode/bidsschematools/render.py
Remi-Gau Aug 29, 2022
a70c060
Update .pre-commit-config.yaml
Remi-Gau Aug 29, 2022
25574bd
Update tools/schemacode/bidsschematools/render.py
Remi-Gau Aug 29, 2022
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
1 change: 0 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ jobs:
source env/bin/activate
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install ~/project/tools/schemacode/[render]
- run:
name: generate docs
command: |
Expand Down
1 change: 0 additions & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
ignore:
- "*/*/tests/*"
- "**/tests/*"

37 changes: 27 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
exclude: 'tools/schemacode/bidsschematools/tests/data/broken_dataset_description.json'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
- id: check-ast
- id: check-added-large-files
- id: check-case-conflict

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
- id: check-ast
- id: check-added-large-files
- id: check-case-conflict

- repo: https://github.com/psf/black
rev: 22.6.0
hooks:
- id: black

- repo: https://github.com/pycqa/flake8
rev: '4.0.1'
Remi-Gau marked this conversation as resolved.
Show resolved Hide resolved
hooks:
- id: flake8

- repo: https://github.com/asottile/reorder_python_imports
rev: "v3.8.2"
hooks:
- id: reorder-python-imports
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you prefer this over the more standard isort?

1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@ is to use the `requirements.txt` file contained in this repository as follows:
```bash
pip install -U pip
pip install -r requirements.txt
pip install -e tools/schemacode/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this should be restored.

```

The first command ensures you are using an up to date version of `pip`,
Expand Down
1 change: 0 additions & 1 deletion pdf_build_src/check_pandoc_log.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Inspect the pandoc log for warnings that should be raised as errors."""

# %%
import json

Expand Down
22 changes: 11 additions & 11 deletions pdf_build_src/pandoc_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,25 @@ def build_pdf(filename="bids-spec.pdf", logfile="bids-spec_pandoc_log.json"):

# Get all input files
markdown_list = []
for root, dirs, files in os.walk('.'):
for root, dirs, files in os.walk("."):
for file in files:
fpath = os.path.join(root, file)
if fpath.endswith(".md") and fpath not in EXCLUDE:
markdown_list.append(fpath)
elif fpath.endswith('index.md'):
elif fpath.endswith("index.md"):
# Special role for index.md
index_page = fpath

# Prepare the command options
cmd = [
'pandoc',
'--from=markdown_github+yaml_metadata_block',
'--include-before-body=./cover.tex',
'--include-in-header=./header.tex',
'--include-in-header=./header_setup.tex',
'--pdf-engine=xelatex',
f'--log={logfile}',
f'--output={filename}',
"pandoc",
"--from=markdown_github+yaml_metadata_block",
"--include-before-body=./cover.tex",
"--include-in-header=./header.tex",
"--include-in-header=./header_setup.tex",
"--pdf-engine=xelatex",
f"--log={logfile}",
f"--output={filename}",
]

# location of this file: This is also the working directory when
Expand All @@ -62,7 +62,7 @@ def build_pdf(filename="bids-spec.pdf", logfile="bids-spec_pandoc_log.json"):
cmd += [str(root / i) for i in ["../../metadata.yml"] + sorted(markdown_list)]

# print and run
print('running: \n\n' + '\n'.join(cmd))
print("running: \n\n" + "\n".join(cmd))
subprocess.run(cmd)


Expand Down
Loading