Basthon Kernel issueshttps://framagit.org/basthon/basthon-kernel/-/issues2022-12-12T10:17:59Zhttps://framagit.org/basthon/basthon-kernel/-/issues/21[Feature request] Fire an event when basthon kernel is loaded2022-12-12T10:17:59ZLaurent COOPER[Feature request] Fire an event when basthon kernel is loadedI'm using basthon kernel on a custom site, and now the kernel loads asynchronously, I shall not execute my initialisation before kernel is loaded.
Would it be possible to fire an event when kernel is loaded ? I shall then put a listene...I'm using basthon kernel on a custom site, and now the kernel loads asynchronously, I shall not execute my initialisation before kernel is loaded.
Would it be possible to fire an event when kernel is loaded ? I shall then put a listener and make my initialisation when it's loaded (I've made a dirty workaround, waiting in a setimeout function for window.Basthon to be defined...)
TIAhttps://framagit.org/basthon/basthon-kernel/-/issues/14[Feature request] make a downloadable version of kernel2022-12-10T15:19:49ZLaurent COOPER[Feature request] make a downloadable version of kernelActually, I use Basthon Kernel in my own application, with an integration in my learning website like in [this example](https://lycee.educinfo.org/index.php?page=pythonascii&activite=characters).
To maintain kernel up to date, I download...Actually, I use Basthon Kernel in my own application, with an integration in my learning website like in [this example](https://lycee.educinfo.org/index.php?page=pythonascii&activite=characters).
To maintain kernel up to date, I download basthon console and I extract kernel out of it.
I would appreciate to have an up to date kernel directly from git, without the need to compile.
Would it be possible ?https://framagit.org/basthon/basthon-kernel/-/issues/18Please update scipy module2022-11-06T21:24:25Zbernard hugueneyPlease update scipy moduleThank you for the **amazing** work !
I'm so looking forward to provide Basthon versions of my Notebook for my students.
However, I will need to use [Seaborn](https://github.com/mwaskom/seaborn).
Alas it requires [a recent scipy version]...Thank you for the **amazing** work !
I'm so looking forward to provide Basthon versions of my Notebook for my students.
However, I will need to use [Seaborn](https://github.com/mwaskom/seaborn).
Alas it requires [a recent scipy version](https://github.com/pyodide/pyodide/issues/399#issuecomment-905789903)
However, on [a Basthon Notebook](https://notebook.basthon.fr/), I only have
```
import scipy
scipy.__version__
'0.17.1'
```
And even if I can import seaborn with micropip :
```
import micropip
micropip.install('seaborn')
[object Promise]
import seaborn
seaborn.__version__
'0.11.2'
```
I then have an error when trying to actually use it :
```
TypeError: resolveSymbol(...) is undefined
```
I tracked it down to a [scipy problem with pyodide](https://github.com/pyodide/pyodide/issues/677), which has now been resolved.
Indeed, on the current [Pyodide console](https://pyodide.org/en/stable/console.html), I get :
```
Welcome to the Pyodide terminal emulator 🐍
Python 3.10.2 (main, Apr 9 2022 20:52:01) on WebAssembly VM
Type "help", "copyright", "credits" or "license" for more information.
>>> import scipy
>>> scipy.__version__
'1.8.0'
```
On the same current pyodide console, I can also do :
```
>>> import micropip
>>> micropip.install('seaborn')
```
and then :
```
>>> import seaborn
>>> seaborn.__version__
'0.11.2'
```
And then, I can actually use seaborn without errors (but no output, because on a console, obviously).
So I feel that seaborn on Basthon should be possible eventually.
If you could make it so that the scipy module was upgraded enough so that I could use Seaborn, I'd be immensely grateful !
Best Regards,
Bernardhttps://framagit.org/basthon/basthon-kernel/-/issues/19postinstall of @basthon/kernel-python3 fails (in version 0.50.10) and pyodide...2022-10-19T18:54:42ZDaniel Caillibaudpostinstall of @basthon/kernel-python3 fails (in version 0.50.10) and pyodide isn't downloaded[kernel-python3/package.json](https://framagit.org/basthon/basthon-kernel/-/blob/d576d7a05f231b083d81eb3ee63445e77ed09f2f/packages/kernel-python3/package.json) says
```json
"scripts": {
"_postinstall": "PYODIDE_VERSION=$(python3 py...[kernel-python3/package.json](https://framagit.org/basthon/basthon-kernel/-/blob/d576d7a05f231b083d81eb3ee63445e77ed09f2f/packages/kernel-python3/package.json) says
```json
"scripts": {
"_postinstall": "PYODIDE_VERSION=$(python3 pyodide_version.py) && mkdir -p lib/dist/ && wget -qO- https://github.com/pyodide/pyodide/releases/download/$PYODIDE_VERSION/pyodide-build-$PYODIDE_VERSION.tar.bz2 | tar xjvf - -C lib/dist/",
```
but `pyodide_version.py` doesn't exists in the npm package.
Copying [pyodide_version.py](https://framagit.org/basthon/basthon-kernel/-/blob/d576d7a05f231b083d81eb3ee63445e77ed09f2f/packages/kernel-python3/pyodide_version.py) in node_modules/@basthon/kernel-python3/ doesn't solve the pb because `src/kernel.ts` neither exists in the npm package.
I solved temporary this pb with the manual command `PYODIDE_VERSION=0.21.3; cd node_modules/@basthon/kernel-python3/ && mkdir -p lib/dist/ && wget -qO- https://github.com/pyodide/pyodide/releases/download/$PYODIDE_VERSION/pyodide-build-$PYODIDE_VERSION.tar.bz2 | tar xjvf - -C lib/dist/`
Thanks for your work !https://framagit.org/basthon/basthon-kernel/-/issues/16Where are the files ??2022-01-21T17:24:37ZLaurent COOPERWhere are the files ??In basthon console or notebook, I can create a file with usual python process
```python
#create
fichier = open('test.txt','w')
fichier.write("test")
fichier.close()
fichier.open('test.txt',r)
for ligne in fichier:
print(ligne)
fich...In basthon console or notebook, I can create a file with usual python process
```python
#create
fichier = open('test.txt','w')
fichier.write("test")
fichier.close()
fichier.open('test.txt',r)
for ligne in fichier:
print(ligne)
fichier.close()
```
is ok
If i do not close the window, I can even read without recreating.
**but**
```python
import os
os.listdir()
```
returns an empty list.
If I use my browser and look at local storage, test.txt is nowhere in browser local storage
So... where can I find the file, and is there any possibility to make it downloadable ?
(I've read the doc and found only informations about auxiliary file, not about file created in Python)https://framagit.org/basthon/basthon-kernel/-/issues/5Memory leak in firefox2021-12-23T22:58:20ZLaurent COOPERMemory leak in firefoxUsing firefox, if I reload multiples times the basthon page, there seem to be the memory leak. On each reload, the webassembly object grow by approximately 200 Mb and the unclassified heap objects grow by approximately 200Mb also
After ...Using firefox, if I reload multiples times the basthon page, there seem to be the memory leak. On each reload, the webassembly object grow by approximately 200 Mb and the unclassified heap objects grow by approximately 200Mb also
After a great number of reload, the browser has promise error due to insufficient memory
Is the problem related to pyodide itself or specific to basthon ?https://framagit.org/basthon/basthon-kernel/-/issues/13NameError for many p5 functions2021-10-20T12:06:02ZMrGoyetNameError for many p5 functionsTrying to follow the documentation of p5 shows that many of the functions raise errors in basthon (notebook and console). For example in the following script (errors in comments):
```python
import p5
from p5 import *
def setup():
cr...Trying to follow the documentation of p5 shows that many of the functions raise errors in basthon (notebook and console). For example in the following script (errors in comments):
```python
import p5
from p5 import *
def setup():
createCanvas(200, 200)
size(640, 360) # NameError: name 'size' is not defined
def draw():
background(200)
ellipse(100, 100, 20,20)
title("Title") # NameError
p5.title("Title") # AttributeError: title
print(frame_count) # NameError
run()
```
Same thing when copy pasting official examples from the p5 doc, such as https://p5.readthedocs.io/en/latest/examples/color/brightness.html
The problem of course is that as it is, telling students to read the p5 doc will lead to errors (the very first page of the p5 reference includes no_loop and p5.exit() which do not work in basthon).
If only a subset of p5 features are supported, could this be mentioned in the basthon doc in the p5 section?https://framagit.org/basthon/basthon-kernel/-/issues/4Add ipythonblocks module to kernel2021-09-02T14:56:41ZLaurent COOPERAdd ipythonblocks module to kernel# Feature Request
## What
iPythonBlocks is a python module designe for iPythonNotebooks to bring simplified graphism through a grid
This way, pupils works with the equivalent of **big** pixels. It's far more easy for them to understand ...# Feature Request
## What
iPythonBlocks is a python module designe for iPythonNotebooks to bring simplified graphism through a grid
This way, pupils works with the equivalent of **big** pixels. It's far more easy for them to understand small grids and after that they can switch to bigger pictures far more easely.
## where
it's easy to install iPythonBlocks on a machine for jupyter with
```shell
pip install ipythonblocks
```
The sources are to be found on [github](https://github.com/jiffyclub/ipythonblocks)https://framagit.org/basthon/basthon-kernel/-/issues/9Typo in doc and code comment: bryhton => brython2021-05-15T14:26:27ZLilian BessonTypo in doc and code comment: bryhton => brythonhttps://framagit.org/search?utf8=%E2%9C%93&search=bryhton&group_id=&project_id=55763&scope=&search_code=true&snippets=false&repository_ref=master&nav_source=navbar
Je vais proposer un fusio-demande corrigeant ces deux typos, elle pourra...https://framagit.org/search?utf8=%E2%9C%93&search=bryhton&group_id=&project_id=55763&scope=&search_code=true&snippets=false&repository_ref=master&nav_source=navbar
Je vais proposer un fusio-demande corrigeant ces deux typos, elle pourra fermer ce ticket.https://framagit.org/basthon/basthon-kernel/-/issues/6Un-needed call to pyodide.js2021-02-26T07:03:41ZLaurent COOPERUn-needed call to pyodide.jsWhen loading basthon kernel, basthon.js (or basthon.min.js) make an ajax call to pyodide.js
This result in a http 404 error
Nevertheless, everything works fine, so this is probably a unneeded call
It is done in line 159 and following, t...When loading basthon kernel, basthon.js (or basthon.min.js) make an ajax call to pyodide.js
This result in a http 404 error
Nevertheless, everything works fine, so this is probably a unneeded call
It is done in line 159 and following, trying ro search for a local pyodide install
It's redundant with the line 20/21 that gives a variable to locate pyodide URL that can be uses to make it local or cdn based.
May be it's a functionnality,I'm just disturbed to see a 404 error each time.https://framagit.org/basthon/basthon-kernel/-/issues/8Juste pour signaler ma passion pour Jupyter, mon grand intérêt pour Basthon, ...2021-02-25T07:36:41ZLilian BessonJuste pour signaler ma passion pour Jupyter, mon grand intérêt pour Basthon, et ma disponibilité pour aider à régler des soucis ou améliorer le truc !Ce n'est pas vraiment un "issue", mais... juste un message pour signaler ma passion pour Jupyter, mon grand intérêt pour Basthon, et ma disponibilité pour aider à régler des soucis ou améliorer le truc !
Je suis habitué à Git et GitLab,...Ce n'est pas vraiment un "issue", mais... juste un message pour signaler ma passion pour Jupyter, mon grand intérêt pour Basthon, et ma disponibilité pour aider à régler des soucis ou améliorer le truc !
Je suis habitué à Git et GitLab, et utilisateur "expert" de Python et Jupyter depuis longtemps.
Dans des issues, ou pour des fusio-demandes, ou des tests, n'hésitez pas à m'inclure dans la boucle (@Naereen fonctionne, je crois). Je me ferai un plaisir de participer !
En tout cas, toutes mes félicitations pour le superbe travail que vous avez fait !
Je n'étais pas encore assez fan de Basthon jusqu'à tout à l'heure, des collègues sur la liste NSI m'ont signalé qu'en fait c'était entièrement client-side (ce que l'on ne voit pas quand on s'en sert !) et avec PyIodide, projet que je suis depuis longtemps mais qui me semblait trop difficile à utiliser pour un usage "perso".
Donc, félicitations pour tout ça !! (je n'avais jamais lu https://basthon.fr/about.html en entier, et je regrette !)
Encore bravo, et merci au nom de tous les collègues et élèves qui se servent de Basthon, et merci d'avance pour la suite !
Bien cordialement, Lilian Besson @Naereenhttps://framagit.org/basthon/basthon-kernel/-/issues/3La compilation du noyau ne marche pas2021-02-09T16:12:30ZLaurent COOPERLa compilation du noyau ne marche pas## Description de la situation
Après téléchargement et décompression de l'archive de basthon-kernel, si on lance un make build, il ne fonctionne pas. L'erreur est la suivante :
```bash
python3 setup.py sdist bdist_wheel
copying files...
...## Description de la situation
Après téléchargement et décompression de l'archive de basthon-kernel, si on lance un make build, il ne fonctionne pas. L'erreur est la suivante :
```bash
python3 setup.py sdist bdist_wheel
copying files...
Traceback (most recent call last):
File "setup.py", line 34, in <module>
os.path.join(data_dir, os.path.basename(fname)))
File "/usr/lib/python3.7/shutil.py", line 121, in copyfile
with open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: '/home/laurent/Téléchargements/basthon-kernel-master/setup/basthon-kernel/data/basthon.js'
make[1]: *** [Makefile:3: build] Error 1
make[1] : on quitte le répertoire « /home/laurent/Téléchargements/basthon-kernel-master/setup »
make: *** [Makefile:12: build] Error 2
```
Il n'arrive pas à trouver le fichier basthon.js qui se trouve dans les sources mais à un autre endroit. Est ce le fonctionnement attendu ?https://framagit.org/basthon/basthon-kernel/-/issues/1Support matplotlib2021-01-29T21:09:34ZWei OuyangSupport matplotlibWould be nice to support displaying plots and images with matplotlib.
```
import matplotlib.pyplot as plt
plt.plot([1,2,3,4])
```Would be nice to support displaying plots and images with matplotlib.
```
import matplotlib.pyplot as plt
plt.plot([1,2,3,4])
```