diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 7d6b7786..321785c5 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -15,8 +15,13 @@ repos:
- id: check-toml
- id: pretty-format-json
- id: detect-private-key
-#- repo: local
-# hooks:
+- repo: local
+ hooks:
+ - id: export_dev_requirements
+ name: Export dev requirements
+ language: system
+ pass_filenames: false
+ entry: peodd -o requirements-dev.txt
# - id: export-requirements
# name: Export requeriments.txt
# language: system
diff --git a/README.md b/README.md
index 22086b5f..f4ee6029 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,5 @@
-# [![Unit Tests][20]][21] ![Release][31] [![Downloads][70]][71] [![Lines of code][81]](<>) [![Total lines][80]](<>) [![Files][82]](<>) [![License][50]][51]
+# [![Unit Tests][20]][21] ![Release][31] [![Downloads][70]][71] [![Lines of code][81]](<>) [![Total lines][80]](<>) [![Files][82]](<>) [![License][50]][51] [](https://mybinder.org/v2/gh/easyScience/easyDiffractionLib/develop)
+
![]()
@@ -56,6 +57,10 @@ Currently **easyDiffractionLib** is in **alpha** and has not been released on **
```
* Select one of the ***.ipynb** files
+### Via Binder
+
+Examples can also be run on the online service [binder](https://mybinder.org/). [](https://mybinder.org/v2/gh/easyScience/easyDiffractionLib/develop) and navigate to the examples folder to run one of the notebooks or create your own.
+
## Test
The installation can be verified by running the test suite:
diff --git a/binder/postBuild b/binder/postBuild
new file mode 100644
index 00000000..1b275d62
--- /dev/null
+++ b/binder/postBuild
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+pip install --extra-index-url https://easyscience.github.io/pypi -r requirements.txt
+pip install -r requirements-dev.txt
\ No newline at end of file
diff --git a/examples/Fitting.ipynb b/examples/Fitting.ipynb
index 9fb39a33..b77042cd 100644
--- a/examples/Fitting.ipynb
+++ b/examples/Fitting.ipynb
@@ -40,6 +40,12 @@
"from easyCore import np\n",
"from easyCore.Fitting.Fitting import Fitter\n",
"\n",
+ "try:\n",
+ " from easyDiffractionLib import Phase\n",
+ "except ImportError:\n",
+ " import sys, os\n",
+ " sys.path.append(os.path.abspath('..'))\n",
+ "\n",
"# esyScience, diffraction\n",
"from easyDiffractionLib import Phases\n",
"from easyDiffractionLib.sample import Sample as Job\n",
@@ -1072,4 +1078,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
-}
+}
\ No newline at end of file
diff --git a/examples/Simulation.ipynb b/examples/Simulation.ipynb
index 9b2eaa02..15f33aae 100644
--- a/examples/Simulation.ipynb
+++ b/examples/Simulation.ipynb
@@ -27,7 +27,12 @@
"source": [
"# esyScience, technique-independent\n",
"from easyCore import np\n",
- "from easyCore.Fitting.Fitting import Fitter\n",
+ "\n",
+ "try:\n",
+ " from easyDiffractionLib import Phase\n",
+ "except ImportError:\n",
+ " import sys, os\n",
+ " sys.path.append(os.path.abspath('..'))\n",
"\n",
"# esyScience, diffraction\n",
"from easyDiffractionLib import Site, Phase, Phases\n",
@@ -2525,4 +2530,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
-}
+}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 159ea884..b0e8cf53 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -42,7 +42,6 @@ pytest = "^5.2"
toml = "^0.10"
requests = '^2.24'
hvplot = "^0.7.0"
-jupyter = "^1.0.0"
ipympl = "^0.8.0"
matplotlib = "^3.4"
py3Dmol = "^1.7.0"
diff --git a/requirements-dev.txt b/requirements-dev.txt
new file mode 100644
index 00000000..57b55ece
--- /dev/null
+++ b/requirements-dev.txt
@@ -0,0 +1,7 @@
+pytest>=5.2
+toml>=0.10
+requests>=2.24
+hvplot>=0.7.0
+ipympl>=0.8.0
+matplotlib>=3.4
+py3Dmol>=1.7.0