You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
##📦 How to install extra packages for your DES model.
46
47
47
-
- Is based on [Pyodide](https://github.com/pyodide/pyodide)
48
-
- Uses [IPython](https://github.com/ipython/ipython) for the code execution (access to IPython magics, support for the inline Matplotlib backend, *etc*)
49
-
- Provides a way to dynamically install packages with ``piplite`` (**e.g.**``await piplite.install("ipywidgets")``)
50
-
-**Does not support** sleeping with ``from time import sleep``
51
-
-**Does not support** pre-installing packages
48
+
The repo contains two environment files. To install more dependencies for your DES model and analysis you need to edit the ``environment.yml`` file.
52
49
53
-
#### jupyterlite-xeus-python:
50
+
The template ``environment.yml`` is as follows:
54
51
55
-
- Is based on [xeus-python](https://github.com/jupyter-xeus/xeus-python)
56
-
- Uses [IPython](https://github.com/ipython/ipython) for the code execution (access to IPython magics, support for the inline Matplotlib backend, *etc*)
57
-
-**Does not provide** a way to dynamically install packages (yet. We are working on building a ``mamba`` package manager for WASM)
58
-
-**Supports** sleeping with ``from time import sleep``
59
-
-**Supports** pre-installing packages from ``emscripten-forge`` and ``conda-forge``, by providing an ``environment.yml`` file defining the runtime environment
60
52
61
-
## 💡 How to make your own deployment
62
-
63
-

53
+
```yml
54
+
name: xeus-python-kernel
55
+
channels:
56
+
- https://repo.mamba.pm/emscripten-forge
57
+
- conda-forge
58
+
dependencies:
59
+
- xeus-python
60
+
- ipycanvas
61
+
- simpy=4.1.1
62
+
- numpy
63
+
- pandas
64
+
- matplotlib
65
+
```
64
66
65
-
Then your site will be published under https://{USERNAME}.github.io/{DEMO_REPO_NAME}
67
+
**Key points:**
66
68
67
-
## 📦 How to install extra packages
69
+
* There are two channels in use.
70
+
* `encription-forge` contains specific versions of the packages for web assembly These include `numpy` `pandas`, and `matplotlib`. Other popular packages include `scipy`, `scikit-learn` and `pytest`.
71
+
* `conda-forge` for other installs you can use conda-forge. Only ``no-arch`` packages from ``conda-forge`` can be installed (simpy qualifies)
72
+
* Note that `numpy`, `pandas` and `matplotlib` have specific versions available on `enscription-forge`. For this reason we recommend not including the package version number.
73
+
* `simpy` is installed from `conda-forge` we were therefore able to freeze the version to 4.1.1 to aid reproducibility.
74
+
* At the time of writing the xeus-python kernal will use python 3.11.3
68
75
69
-
You can pre-install extra packages for xeus-python by adding them to the ``environment.yml`` file.
76
+
As an example modification assume that you wanted to add two new packages: `plotly`and `scipy`. The first `plotly` is available ``no-arch`` from conda-forge so it is safe to include and if you wanted to you could try to include a version number. There is a specific version of `scipy` is available on `encription-forge`
70
77
71
-
For example, if you want to create a JupyterLite deployment with NumPy and Matplotlib pre-installed, you would need to edit the ``environment.yml`` file as following:
78
+
Our modified environment looks like:
72
79
73
80
```yml
74
81
name: xeus-python-kernel
@@ -77,11 +84,30 @@ channels:
77
84
- conda-forge
78
85
dependencies:
79
86
- xeus-python
87
+
- ipycanvas
88
+
- simpy=4.1.1
80
89
- numpy
90
+
- pandas
81
91
- matplotlib
92
+
- plotly
93
+
- scipy
82
94
```
83
95
84
-
Only ``no-arch`` packages from ``conda-forge`` and packages from ``emscripten-forge`` can be installed.
85
-
- **How do I know if a package is ``no-arch`` on ``conda-forge``?** ``no-arch`` means that the package is OS-independent, usually pure-python packages are ``no-arch``. To check if your package is ``no-arch`` on ``conda-forge``, check if the "Platform" entry is "no-arch" in the https://beta.mamba.pm/channels/conda-forge?tab=packages page. If your package is not ``no-arch`` but is a pure Python package, then you should probably update the feedstock to turn your package into a ``no-arch`` one.
86
-

87
-
- **How do I know if my package is on ``emscripten-forge``?** You can see the list of packages pubished on ``emscripten-forge`` [here](https://beta.mamba.pm/channels/emscripten-forge?tab=packages). In case your package is missing, or it's not up-to-date, feel free to open an issue or a PR on https://github.com/emscripten-forge/recipes.
96
+
If you wanted to use an alternative simulation package to `simpy` this would need to be available on `conda-forge` and be ``no-arch``. An example package is `salabim`. A modification of the enviroment is:
0 commit comments