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

Allow naming cells? #111

Open
aldanor opened this issue Jan 16, 2019 · 2 comments · May be fixed by #165
Open

Allow naming cells? #111

aldanor opened this issue Jan 16, 2019 · 2 comments · May be fixed by #165

Comments

@aldanor
Copy link

aldanor commented Jan 16, 2019

Currently, cells are named as 'Cell %d' % cell_num. This makes it hard to trace errors in case you have hundreds of cells.

Could the cells be possibly named? Either via cell metadata (given it's already supported anyway), or via inline comments, like # nbval: name = 'cell_name', or just # nbval: cell_name.

To enforce uniqueness, cell number can still be kept, so the output could look e.g. like this:

nbval_test.ipynb::Cell 0 [do_stuff] PASSED
nbval_test.ipynb::Cell 1 PASSED
nbval_test.ipynb::Cell 2 PASSED
nbval_test.ipynb::Cell 3 [other_stuff] FAILED
nbval_test.ipynb::Cell 4 PASSED
nbval_test.ipynb::Cell 5 [custom_name] PASSED
nbval_test.ipynb::Cell 6 PASSED
@takluyver
Copy link
Member

I'd be OK with doing that based on cell metadata. Using comments for this feels like a bit too much magic parsing.

@casperdcl
Copy link

at least should also use (cell_num + 1) by default to correspond to the numbering in the notebook

casperdcl added a commit to casperdcl/nbval that referenced this issue Mar 9, 2021
@casperdcl casperdcl linked a pull request Mar 9, 2021 that will close this issue
3 tasks
casperdcl added a commit to casperdcl/nbval that referenced this issue Feb 27, 2022
casperdcl added a commit to casperdcl/nbval that referenced this issue Aug 8, 2023
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 a pull request may close this issue.

3 participants