We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently the API supports getting the cell by index. Index is not a stable identifier in a notebook.
It would be perfect to be able to fetch a cell by ID, without the overhead of converting the entire notebook to Python objects
jupyter_ydoc/jupyter_ydoc/ynotebook.py
Lines 92 to 115 in 9223523
The text was updated successfully, but these errors were encountered:
Since self._ycells is a list this may require holding a hashmap/dict from cell id to cell index. This may be hard, but ultimately may be worth it.
self._ycells
Sorry, something went wrong.
Would something like that be enough?
def get_cell_by_id(self, id): for ycell in self.ycells: _id = ycell.get("id") if _id == id: return ycell
This is what I am doing right now, this request is more about having a way to fetch it in O(1) rather than O(n).
No branches or pull requests
Problem
Currently the API supports getting the cell by index. Index is not a stable identifier in a notebook.
Proposed Solution
It would be perfect to be able to fetch a cell by ID, without the overhead of converting the entire notebook to Python objects
Additional context
jupyter_ydoc/jupyter_ydoc/ynotebook.py
Lines 92 to 115 in 9223523
The text was updated successfully, but these errors were encountered: