Conversation
… Hub. Password secret works in Hub and save of notebook works for both
…to store variables
…solution for JupyterLite
…doc if they match saved ids for jupyter_notebook or its data_files
…d in notebook cell
…file by sending twice to rspace
…okname, server url and server port
…of notebook has not changed
…into a given field
…g notebook to gallery twice
…ted in sync_notebook_to_rspace function
tchoi-rs
requested changes
Oct 24, 2025
| This must be set to the name of the rspace user where the notebook is being saved | ||
| """ | ||
|
|
||
| def get_server_urls(): |
Collaborator
There was a problem hiding this comment.
Are there tests for the utility functions within here? And do they need to be within the context of the sync_notebook_to_rspace function?
| if server_port is not None: | ||
| srv_url = srv['url'] | ||
| part_url = srv_url[:srv_url.rfind(':') + 1] | ||
| all_urls.append(part_url + str(server_port) + '/lab/tree/' + str(path)) |
| all_urls.append(part_url + str(server_port) + '/lab/tree/' + str(path)) | ||
| else: | ||
| all_urls.append(srv['url'] + 'lab/tree/' + str(path)) | ||
| except Exception: |
| notebook_name_alone = notebook_name[notebook_name.rfind('/') + 1:] | ||
| else: | ||
| notebook_name_alone = notebook_name | ||
| return {'name': notebook_name_alone, 'root_name': notebook_name_alone[:notebook_name_alone.rfind('.')], |
Collaborator
There was a problem hiding this comment.
I would utilise dataclasses instead of objects (I see that you're using dill which requires Python 3.8 so Dataclasses should always be available)
| from rspace_client.eln import eln | ||
| import os | ||
| import hashlib | ||
| import dill |
Collaborator
There was a problem hiding this comment.
3rd party dependencies should be specified in pyproject.toml
| return "password set" | ||
|
|
||
|
|
||
| async def sync_notebook_to_rspace(rspace_url="", attached_data_files="", notebook_name=None, server_url=None, |
| with open(state_filename, 'rb') as f: | ||
| try: | ||
| loaded_state = dill.load(f) | ||
| except Exception as e: |
Collaborator
There was a problem hiding this comment.
Should the sync really fail silently?
… same notebook as being synced and is python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.