JupyterLite #3930
Replies: 4 comments 16 replies
-
Good idea but one should be explicit on which packages (and version) are provided. |
Beta Was this translation helpful? Give feedback.
-
This would definitely be of interest to several groups I spoke with. Do I understand correctly that if this runs in the browser it is executed completely on the client machine? Then we don't need to worry about a notebook gobbling up computational resources on our eLab server, which would be very nice :) |
Beta Was this translation helpful? Give feedback.
-
Maybe one way to do it with very little changes is to : <iframe src="https://jupyterlite.github.io/demo/repl/index.html" width="100%" height="100%"
></iframe> See https://jupyterlite.readthedocs.io/en/latest/quickstart/embed-repl.html -Automatically save the current ipython notebook in the experiment with the api : FILE = "DATA.CSV"
for upload in uploadsApi.read_uploads('experiments', exp.id):
print(upload.id, upload.real_name, upload.comment)
if (upload.real_name == FILE):
FILE_ID = upload.id
open(FILE, 'wb') as csvfile:
csvfile.write(uploadsApi.read_upload('experiments', EXP_ID, FILE_ID, format='binary', _preload_content=False).data) fig.write_image("graph.png")
uploadsApi.post_upload('experiments', EXP_ID, file="graph.png)
os.remove("graph.png") I'll be happy to help adding this great feature. |
Beta Was this translation helpful? Give feedback.
-
Hello, ---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In[9], line 1
----> 1 charge_api(cle_de_api,API_HOST_URL,91)
Cell In[8], line 11, in charge_api(API_KEY, API_HOST_URL, EXP_ID)
8 configuration.verify_ssl = False
10 # create an instance of the API class
---> 11 api_client = elabapi_python.ApiClient(configuration)
12 # fix issue with Authorization header not being properly set by the generated lib
13 api_client.set_default_header(header_name='Authorization', header_value=API_KEY)
File /lib/python3.11/site-packages/elabapi_python/api_client.py:68, in ApiClient.__init__(self, configuration, header_name, header_value, cookie)
65 configuration = Configuration()
66 self.configuration = configuration
---> 68 self.pool = ThreadPool()
69 self.rest_client = rest.RESTClientObject(configuration)
70 self.default_headers = {}
File /lib/python311.zip/multiprocessing/pool.py:930, in ThreadPool.__init__(self, processes, initializer, initargs)
929 def __init__(self, processes=None, initializer=None, initargs=()):
--> 930 Pool.__init__(self, processes, initializer, initargs)
File /lib/python311.zip/multiprocessing/pool.py:196, in Pool.__init__(self, processes, initializer, initargs, maxtasksperchild, context)
192 self._taskqueue = queue.SimpleQueue()
193 # The _change_notifier queue exist to wake up self._handle_workers()
194 # when the cache (self._cache) is empty or when there is a change in
195 # the _state variable of the thread that runs _handle_workers.
--> 196 self._change_notifier = self._ctx.SimpleQueue()
197 self._cache = _PoolCache(notifier=self._change_notifier)
198 self._maxtasksperchild = maxtasksperchild
File /lib/python311.zip/multiprocessing/context.py:112, in BaseContext.SimpleQueue(self)
110 def SimpleQueue(self):
111 '''Returns a queue object'''
--> 112 from .queues import SimpleQueue
113 return SimpleQueue(ctx=self.get_context())
File /lib/python311.zip/multiprocessing/queues.py:23
19 import errno
21 from queue import Empty, Full
---> 23 import _multiprocessing
25 from . import connection
26 from . import context
ModuleNotFoundError: The module '_multiprocessing' is removed from the Python standard library in the Pyodide distribution due to browser limitations.
See https://pyodide.org/en/stable/usage/loading-packages.html for more details.``` |
Beta Was this translation helpful? Give feedback.
-
https://jupyterlite.readthedocs.io/en/latest/
Basically it's jupyter notbooks that runs entirely in the browser. Could be interesting for elab. Uploaded python files or ipynb could be executed directly in the browser.
Beta Was this translation helpful? Give feedback.
All reactions