Skip to content

Commit

Permalink
Copy files from other working repository, rf-shimming-7t-neurolibre
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieuboudreau committed Feb 7, 2024
1 parent 575130d commit 952acb3
Show file tree
Hide file tree
Showing 16 changed files with 1,553 additions and 41 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: deploy-book

# Only run this when the v2 branch changes
on:
push:
branches:
- main
# If your git repository has the Jupyter Book within some-subfolder next to
# unrelated files, you can make this run only if a file within that specific
# folder has been modified.
# paths:
# - source/**

# This job installs dependencies, build the book, and pushes it to `gh-pages`
jobs:
deploy-book:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

# Install dependencies
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8

- name: Install dependencies
run: |
pip install -r binder/requirements.txt
- name: Download data
run: |
cd content
repo2data -r ../binder/data_requirement.json
cd ..
- name: Postbuild
run: |
chmod +xxx binder/postBuild
binder/postBuild
# Build the book
- name: Build the book
run: |
jupyter-book build content/index.ipynb --builder singlehtml
# Push the book's HTML to github-pages
- name: GitHub Pages action
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./content/_build/_page/index/singlehtml
58 changes: 17 additions & 41 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
# Dataset
ds004906

# Apple files
.DS_Store

# Visual Studio
.vscode

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand All @@ -23,12 +14,12 @@ dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
Expand Down Expand Up @@ -58,7 +49,6 @@ coverage.xml
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
Expand All @@ -81,7 +71,6 @@ instance/
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
Expand All @@ -92,9 +81,7 @@ profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
Expand All @@ -103,22 +90,7 @@ ipython_config.py
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
Expand Down Expand Up @@ -155,15 +127,19 @@ dmypy.json
# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/
_build/

# macos garbage
.DS_Store

# builds
*.html

# Cython debug symbols
cython_debug/
# data
*.zip
content/data/
content/neuromod-anat-brain-qmri/
content/spinalcord_results/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
# Cloned repos
content/analysis*
5 changes: 5 additions & 0 deletions binder/colab_output.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"src": "https://drive.google.com/uc?id=1-8-EsLKDpV2LqcQmhzPguiyUb1xJyM4j",
"dst": "../data",
"projectName": "rf-shimming-7t-colab"
}
5 changes: 5 additions & 0 deletions binder/data_requirement.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"src": "https://drive.google.com/uc?id=1OY-lEDIqcSJY_Mymo6Fd8vfhY5L7phXr",
"dst": "../data",
"projectName": "rf-shimming-7t"
}
26 changes: 26 additions & 0 deletions binder/environment_archive.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: notebook

channels:
- default
- conda-forge

dependencies:
- pip
- matplotlib
- nibabel
- numpy
- pandas
- scipy
- statsmodels
- plotly
- pandas
- markdown
- wget
- jupyterlab-mathjax3
- osfclient
- pip:
- jupyter-book==0.13.0
- repo2data
- datalad-installer
- pybids
- yes
22 changes: 22 additions & 0 deletions binder/postBuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
set -e

touch ~/.bashrc
cd content
repo2data -r ../binder/data_requirement.json
cd ..
git clone https://github.com/spinalcordtoolbox/spinalcordtoolbox ~/content/sct
cd ~/content/sct
yes | ./install_sct
echo 'export PATH=~/content/sct/bin:$PATH' >> ~/.bashrc
echo 'export MPLBACKEND='Agg'' >> ~/.bashrc

echo 'export PATH=~/content/sct/bin:$PATH' >> ~/.bash_profile
echo 'export MPLBACKEND='Agg'' >> ~/.bash_profile

echo 'export PATH=~/content/sct/bin:$PATH' >> ~/.bash_login
echo 'export MPLBACKEND='Agg'' >> ~/.bash_login

echo 'export PATH=~/content/sct/bin:$PATH' >> ~/.profile
echo 'export MPLBACKEND='Agg'' >> ~/.profile
cd ~/
1 change: 1 addition & 0 deletions binder/runtime.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python-3.8
37 changes: 37 additions & 0 deletions content/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Book settings
# Learn more at https://jupyterbook.org/customize/config.html

title: RF Shimming 7T
logo: logo.png

# Force re-execution of notebooks on each build.
# See https://jupyterbook.org/content/execute.html
execute:
execute_notebooks: force

launch_buttons:
notebook_interface: "jupyterlab"

# Information about where the book exists on the web
repository:
url: https://github.com/shimming-toolbox/rf-shimming-7t-neurolibre # Online location of your book
path_to_book: content # Optional path to your book, relative to the repository root
branch: main # Which branch of the repository should be used when creating links (optional)

only_build_toc_files: true

execute:
timeout: 600

sphinx:
local_extensions : # A list of local extensions to load by sphinx specified by "name: path" items
recursive_update : false # A boolean indicating whether to overwrite the Sphinx config (true) or recursively update
config : # key-value pairs to directly over-ride the Sphinx configuration
bibtex_reference_style: author_year
bibtex_default_style: plain
bibtex_tooltips: true
html_static_path: ['_static']
html_css_files: ['custom.css']

bibtex_bibfiles:
- ../paper.bib
2 changes: 2 additions & 0 deletions content/_neurolibre.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
book_layout: traditional
single_page: index.ipynb
52 changes: 52 additions & 0 deletions content/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
p {
text-align: justify;
}
a {
color: #870000!important;
}
a:hover {
color: brick!important;
}
a:visited {
color: #6f42c1!important;
}
body, h1, h2, h3, h4, h5 {
font-family: 'STIX Two Text';
}
h1 {
color: #342727!important;
}
.caption {
text-align:justify;
line-height:1.25;
font-size:80%
}

#site-navigation {
display: none;
}

#main-content{
margin: 0 auto;
}


.fa, .far, .fas {
color: red;
}

.header-article::after{
content: url('https://neurolibre.org/assets/joss2-b7ea8dd1f24ce2b0825db17e3495576253ba4c64df3384a66354713d76c40a75.svg');
width: 150px;
height: 80px;
position: relative;
right: 10px;
}

.header-article::before{
content: url('https://raw.githubusercontent.com/neurolibre/brand/b5e10e051a0059824ca2f4204e1288927e551d49/svg/neurolibre_logo.svg');
width: 33px;
height: 33px;
position: absolute;
left: 10px;
}
5 changes: 5 additions & 0 deletions content/_toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Table of contents
# Learn more at https://jupyterbook.org/customize/toc.html

format: jb-article
root: paper
Loading

0 comments on commit 952acb3

Please sign in to comment.