-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add YNotebook get_cell, set_cell, append_cell #35
Conversation
jupyter_ydoc/ydoc.py
Outdated
def _put_cell(self, index: int, ycell: Y.YMap, txn): | ||
if len(self._ycells) >= index + 1: | ||
self._ycells.delete(txn, index) | ||
self._ycells.insert(txn, index, ycell) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Waidhoferj I'm not sure to understand the error message:
y_py.MultipleIntegrationError: Cannot integrate a nested Ypy object because is already integrated into a YDoc: {'source': YText(print('Hello, World!')), 'execution_count': None, 'metadata': YMap({}), 'outputs': YArray([]), 'id': None, 'cell_type': 'code'}
The YMap I'm trying to insert into a YArray
is not part of a YDoc
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, I think it was on my side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I think there is a bug in ypy. It doesn't happen in the CI, but locally I have the error above at this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Waidhoferj ypy HEAD doesn't seem to fix this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working on it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davidbrochart Having trouble reproducing the issue. I've run a couple tests pushing preliminary Y elements into an array.
def test_multiple_integration():
d = Y.YDoc()
wrapper = d.get_array("wrapper")
inner = Y.YMap({"foo": "bar"})
with d.begin_transaction() as txn:
wrapper.append(txn, inner) # I'd expect an error here
Tried to set up the repository, but I'm having dependency issues related to ypy-websockets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot reproduce the issue either.
Do you want to release ypy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely, just release 0.5.3
6046a74
to
5c484fe
Compare
1ade0ee
to
e0409a1
Compare
9256927
to
f9fe1c6
Compare
f9fe1c6
to
35c3466
Compare
Fixes #34.