Skip to content

Commit

Permalink
Update pycrdt v0.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart committed Dec 26, 2023
1 parent 05e7ece commit 4daf410
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions jupyter_ydoc/ynotebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# Distributed under the terms of the Modified BSD License.

import copy
import json
from functools import partial
from typing import Any, Callable, Dict, Optional
from uuid import uuid4
Expand Down Expand Up @@ -98,8 +97,8 @@ def get_cell(self, index: int) -> Dict[str, Any]:
:return: A cell.
:rtype: Dict[str, Any]
"""
meta = json.loads(str(self._ymeta))
cell = json.loads(str(self._ycells[index]))
meta = self._ymeta.to_py()
cell = self._ycells[index].to_py()
cast_all(cell, float, int) # cells coming from Yjs have e.g. execution_count as float
if "id" in cell and meta["nbformat"] == 4 and meta["nbformat_minor"] <= 4:
# strip cell IDs if we have notebook format 4.0-4.4
Expand Down Expand Up @@ -181,7 +180,7 @@ def get(self) -> Dict:
:return: Document's content.
:rtype: Dict
"""
meta = json.loads(str(self._ymeta))
meta = self._ymeta.to_py()
cast_all(meta, float, int) # notebook coming from Yjs has e.g. nbformat as float
cells = []
for i in range(len(self._ycells)):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ requires-python = ">=3.7"
keywords = ["jupyter", "ypy"]
dependencies = [
"importlib_metadata >=3.6; python_version<'3.10'",
"pycrdt >=0.7.0,<0.8.0",
"pycrdt >=0.8.0,<0.9.0",
]

[[project.authors]]
Expand Down

0 comments on commit 4daf410

Please sign in to comment.