You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 62-cell-id/cell-id.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -250,7 +250,7 @@ Use Option D for most human readable, but adds a corpus requirement to the id ge
250
250
1. How is splitting cells handled?
251
251
- One cell (second part of the split) gets a new cell ID.
252
252
2. What if I copy and paste (surely you do not want duplicate ids...)
253
-
-On paste, give the pasted cell a new ID. The copied (source) cell keeps its original ID.
253
+
-A cell in the clipboard should have an id, but paste always needs to check for collisions and generate a new id if and only if there is one. The application can choose to preserve the id if it doesn't violate this constraint.
254
254
3. What if you cut-paste (surely you want to keep the id)?
255
255
- On paste give the pasted cell a different ID if there's already one with the same ID as being pasted. For cut this means the id can be preserved because there's no conflict on resolution of the move action. This does mean the application would need to keep track of the ids in order to avoid duplications if it's assigning ids to the document's cells.
256
256
4. What if you cut-paste, and paste a second time?
@@ -264,7 +264,7 @@ Use Option D for most human readable, but adds a corpus requirement to the id ge
264
264
8. If a cell is cut out of a notebook and pasted into another, should the cell ID be retained?
265
265
- This will depend on the application for now, as this JEP only focuses on Cell ID within an individual notebook. Different applications might handle pasting cells across notebooks differently.
266
266
9. What are the details when splitting cells?
267
-
- The JEP doesn't explicitly constraint how this action should occur, but we suggest one cell (preferably the one with the top half of the code) keeps the id, the other gets a new id. Each application can choose how to behave here so long as the cell ids are unique and follow the schema.
267
+
- The JEP doesn't explicitly constraint how this action should occur, but we suggest one cell (preferably the one with the top half of the code) keeps the id, the other gets a new id. Each application can choose how to behave here so long as the cell ids are unique and follow the schema. This can be a per-application choice to learn and adapt to what users expect, without requiring a new JEP.
268
268
269
269
## Pros and Cons
270
270
@@ -277,8 +277,10 @@ Pros associated with this implementation include:
277
277
278
278
Cons associated with this implementation include:
279
279
280
-
- lack of UUID and a "notebook-only" uniqueness guarantee makes merging two notebooks difficult without managing the ids so they remain unique in the resulting notebook
281
-
- applications have to add default ID generation if not using nbformat (or not python) for this (took 1 hour to add the proposal PR to nbformat with tests included)
280
+
- Lack of UUID and a "notebook-only" uniqueness guarantee makes merging two notebooks difficult without managing the ids so they remain unique in the resulting notebook
281
+
- Applications have to add default ID generation if not using nbformat (or not python) for this (took 1 hour to add the proposal PR to nbformat with tests included)
282
+
- Notebooks with the same source code can be generated with different cell ids, meaning they are not byte equal. This will make testing / disk comparisons harder in some circumstances
283
+
- Pasting / manipulating cells needs to be aware of the other cells in a notebook. This increases the complexity for applications to implement Jupyter notebook interfaces
0 commit comments