Skip to content

Commit

Permalink
Merge pull request pyiron#5 from pyiron/binder
Browse files Browse the repository at this point in the history
Move mybinder configuration .binder
  • Loading branch information
jan-janssen authored Mar 20, 2021
2 parents a8da71a + 32caea1 commit dc0a8e0
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 26 deletions.
File renamed without changes.
11 changes: 11 additions & 0 deletions .binder/postBuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# install environment
mamba env update --name notebook --file environment.yml

# move pyiron config to home directory
mv .binder/.pyiron .

# import dataset
bash .github/ci_support/import_dataset.sh

# install nglview
bash .github/ci_support/install_nglview.sh
7 changes: 5 additions & 2 deletions .github/ci_support/build_notebooks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
# pyiron config
python .github/ci_support/pyironconfig.py

# install
bash binder/postBuild
# import dataset
bash .github/ci_support/import_dataset.sh

# install nglview
bash .github/ci_support/install_nglview.sh

# conda install papermill
conda install -c conda-forge papermill
Expand Down
12 changes: 12 additions & 0 deletions .github/ci_support/import_dataset.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
for ds in $(ls calculation/*.tar.gz); do
cp ${ds} .
cp calculation/export.csv .
file=$(basename ${ds} .tar.gz)
python << EOF
from pyiron_base import Project
Project("calculation").unpack("${file}")
EOF
rm $(basename ${ds})
rm export.csv
done
9 changes: 9 additions & 0 deletions .github/ci_support/install_nglview.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

# ngl view for jupyter
jupyter nbextension install nglview --py --sys-prefix
jupyter nbextension enable nglview --py --sys-prefix

# ngl view for jupyter lab
jupyter labextension install @jupyter-widgets/jupyterlab-manager --no-build
jupyter labextension install nglview-js-widgets --minimize=False
2 changes: 1 addition & 1 deletion .github/workflows/notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
auto-update-conda: true
python-version: 3.8
environment-file: binder/environment.yml
environment-file: environment.yml
auto-activate-base: false
- name: Tests
shell: bash -l {0}
Expand Down
23 changes: 0 additions & 23 deletions binder/postBuild

This file was deleted.

File renamed without changes.

0 comments on commit dc0a8e0

Please sign in to comment.