Skip to content
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

Implement cell id based on source #223

Merged
merged 3 commits into from
Jan 6, 2022
Merged

Implement cell id based on source #223

merged 3 commits into from
Jan 6, 2022

Conversation

lexnederbragt
Copy link
Contributor

Closes #213.

  • created cell ID based on hash of 'source' field
  • avoids conflicts by adding a running number to IDs for cells with identical 'source' fields in the same notebook

Tested my own projects and my demo project, and seems to be working fine.

@lexnederbragt
Copy link
Contributor Author

Duplicate of #216 and can thus probably be ignored.

@lexnederbragt
Copy link
Contributor Author

lexnederbragt commented Jan 3, 2022

Note that this implementation avoids conflicts when cells have identical 'source' field content [edited:] by adding a running number to the ID rather than making each such cell have a unique ID.

@lexnederbragt
Copy link
Contributor Author

The solution as implemented in #216 leads to a change in cell IDs if the order of cells changes, or for all subsequent cells if another cell is added in between.

This new version of the PR modifies the implementation for the IDs to ensure identical source fields always yields the same ID regardless of order, while at the same time keeping the solution to the problem of non-unique IDs, i.e. adding a running number '_1', '_2', '_3' ... to IDs with identical source fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create notebook cell id based on cell content
2 participants