Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnGriffiths authored Dec 12, 2024
0 parents commit fa94953
Show file tree
Hide file tree
Showing 17 changed files with 9,300 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: MyST GitHub Pages Deploy
on:
push:
# Runs on pushes targeting the default branch
branches: [main]
env:
# `BASE_URL` determines the website is served from, including CSS & JS assets
# You may need to change this to `BASE_URL: ''`
BASE_URL: /${{ github.event.repository.name }}

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: 'pages'
cancel-in-progress: false
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v3
# Set up Python
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

# Install Python dependencies
- name: Install Python dependencies
run: |
python -m venv venv
source venv/bin/activate
pip install -r binder/requirements.txt
- uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Install MyST Markdown
run: npm install -g mystmd
- name: Build HTML Assets
run: myst build --execute --html
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: './_build/html'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
162 changes: 162 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
_build/
# C extensions
*.so
.DS_Store
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
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

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# 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/latest/usage/project/#working-with-version-control
.pdm.toml
.pdm-python
.pdm-build/

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

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# 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/
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 NeuroLibre

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# mystical-article

This repository provides a NeuroLibre-compatible article template using MyST (Markedly Structured Text) for creating interactive scientific preprints.

https://events.neurolibre.org/mystical-article

## Learn the ropes of MyST through GitHub Actions

This repository includes a GitHub Actions workflow that builds the MyST-formatted preprint and publishes it to GitHub Pages.

> [!TIP]
> To enable this, you need to enable GitHub Pages in the repository settings (select GitHub Actions as the `Build and deployment` source).
Once you push your changes to the `main` branch, the GitHub Actions workflow will build the MyST-formatted preprint and publish it to your GitHub Pages.

> [!WARNING]
> The actions file (`.github/workflows/deploy.yml`) attempts to **execute** the executable content in this preprint. However, this doesn't always work smoothly in the GitHub Actions environment, as it requires starting a Jupyter Server and connecting to it. In other words, it may not generate the interactive figures as intended. Nevertheless, any changes you make to the **narrative** content will be reflected in the preprint.
The ultimate guide for authoring narrative and executable content in MyST documents is the [MyST Guide](https://mystmd.org/guide).

## The real deal: NeuroLibre workflow

Below is a decision tree guiding you through the process of preparing your living preprint before submitting it to the [NeuroLibre](https://neurolibre.org) for publication.

![Decision tree](https://github.com/neurolibre/brand/blob/main/png/myst_flow.png?raw=true)


> [!NOTE]
> This template includes executable content (simple Python code to generate interactive figures) and needs some data to be used as input. Let's take a look at how they are managed.
### The `binder` folder

* `runtime.txt` declares `python-3.10` as the Python version.
* `requirements.txt` declares the Python packages that will be installed in your reproducible runtime environment.
* `data_requirement.json` declares a download source (a simple csv file), which will be downloaded to a folder named `neurolibre-demo-dataset` (project-name).
* In your runtime environment the data will be mounted to `data/neurolibre-demo-dataset`, relative to the base if your repository.

> [!TIP]
> Feel free to make small modifications to runtime dependencies and change your code to work with the [provided data](https://raw.githubusercontent.com/plotly/datasets/master/hobbs-pearson-trials.csv). However, if you need to work with a new data, [let us know](https://github.com/neurolibre/info/issues/new?assignees=agahkarakuzu&labels=DOWNLOAD&projects=&template=data_cache.md&title=)
The complete list of REES configuration files for different programming languages can be found [here](https://mybinder.readthedocs.io/en/latest/using/config_files.html).

### NeuroLibre preview Binder X RoboNeuro preview service

We provide a [public Binder instance](https://binder-preview.conp.cloud/) to help you create reproducible, interactive computing environments. Upon successfully building a Binder, a Docker image is pushed to our private registry, tagged with the `commit hash` of your repository.

NeuroLibre can use that Docker image over and over again to build new versions of your living preprint. So hold onto that `commit hash` and keep pushing commits to work on your narrative and executable content! Unless you need to install new dependencies or modify your input data, you don't need to build a new Binder.

![](https://github.com/neurolibre/brand/blob/main/png/let_it_go.png?raw=true)

RoboNeuro will be glad to build the `latest` version of your preprint (from the `main` branch) at each request!

Once you are happy with the current shape and form of your living print, submit it to NeuroLibre! Our team will start a technical screening to ensure that your preprint is ready for publication with the help of RoboNeuro on a GitHub issue.

5 changes: 5 additions & 0 deletions _toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
format: jb-book
root: paper.md
chapters:
- file: content/figure_1.ipynb
- file: content/figure_2.md
4 changes: 4 additions & 0 deletions binder/data_requirement.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{ "src": "https://raw.githubusercontent.com/plotly/datasets/master/hobbs-pearson-trials.csv",
"dst": "../data",
"projectName": "neurolibre-demo-dataset"
}
3 changes: 3 additions & 0 deletions binder/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
plotly
networkx
pandas
1 change: 1 addition & 0 deletions binder/runtime.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python-3.10
Loading

0 comments on commit fa94953

Please sign in to comment.