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

[INFRA] use macro to render examples in a "tree" like fashion #837

Merged
merged 46 commits into from
Aug 31, 2021

Conversation

Remi-Gau
Copy link
Collaborator

@Remi-Gau Remi-Gau commented Jul 29, 2021

fixes #807

This is a first attempt to see what it could look like to render examples differently from templates

Current issues:

  • handling directories that mix files and directories
  • extra return carriage make some examples to "spacious" vertically
  • apply to:
    • MEG
    • EEG
    • iEEG
    • PET
    • beh, physio, task...
    • derivatives
    • appendices
  • add doc
    • to code
    • to CONTRIBUTING
  • create a separate module for example code
  • move jupyter notebook
  • remove original examples

Writing complex examples can get a bit annoying: almost tempted to have examples "encoded" in separate yaml files. Might be an overkill as most examples will remain fairly simple

@Remi-Gau Remi-Gau requested a review from tsalo July 29, 2021 18:19
@Remi-Gau
Copy link
Collaborator Author

Remi-Gau commented Aug 6, 2021

I have updated all the examples that seemed relevant.

I have left the old version below for an easier before / after comparison on the rendering:
https://bids-specification--837.org.readthedocs.build/en/837/

Let me know what you think.

Once I get the green light on this on the "content", I will do some clean up and add some doc.

Copy link
Member

@sappelhoff sappelhoff left a comment

Choose a reason for hiding this comment

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

Have you tried ditching the relative imports?

That is, don't do from . import X but from <explicit-package-name> import X.

Apart from the fact that it might solve the issue here, explicit (absolute) imports are often more readable and transparent: https://stackoverflow.com/a/4209771/5201771

It'll have to be fixed in several places, also consider the fix I posted on mattermost for your tools/examplecode/__init__.py file :-)

@Remi-Gau
Copy link
Collaborator Author

Remi-Gau commented Aug 24, 2021

OK all of CI is green on this one.

the PDF looks fine to me.

let me know if I am missing something in terms of doc or something.

Copy link
Member

@sappelhoff sappelhoff left a comment

Choose a reason for hiding this comment

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

nice! just some minor comments, this is great :)

tools/mkdocs_macros_bids/__init__.py Outdated Show resolved Hide resolved
tools/mkdocs_macros_bids/macros.py Outdated Show resolved Hide resolved
tools/mkdocs_macros_bids/main.py Outdated Show resolved Hide resolved
tools/schemacode/__init__.py Show resolved Hide resolved
tools/mkdocs_macros_bids/macros.py Outdated Show resolved Hide resolved
tools/mkdocs_macros_bids/macros.py Outdated Show resolved Hide resolved
tools/filetree_example.ipynb Outdated Show resolved Hide resolved
tools/filetree_example.ipynb Show resolved Hide resolved
tools/examplecode/example.py Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
Copy link
Member

@tsalo tsalo left a comment

Choose a reason for hiding this comment

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

Everything looks great to me. I think you just need to deal with the merge conflicts, but other than that I think it's good to go.

@Remi-Gau
Copy link
Collaborator Author

Everything looks great to me. I think you just need to deal with the merge conflicts, but other than that I think it's good to go.

Thanks for the reminder @tsalo : I had totally forgotten to cross check this one.

@sappelhoff sappelhoff merged commit f21e9b2 into bids-standard:master Aug 31, 2021
@sappelhoff
Copy link
Member

Thanks a lot @Remi-Gau this is great!

@sappelhoff sappelhoff changed the title use macro to render examples in a "tree" like fashion [INFRA] use macro to render examples in a "tree" like fashion Sep 13, 2021
@Remi-Gau Remi-Gau deleted the render-examples branch November 15, 2021 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

inconsistent style for the folder structure in the examples
4 participants