docs: fix lowercase option names after options refactor (#889)#895
docs: fix lowercase option names after options refactor (#889)#895SaguaroDev wants to merge 2 commits into
Conversation
The options refactor added _validate_option(), which checks the option
name against the uppercase attribute keys (ARRAY_BACKEND, AUTO_SPARSE,
ARRAY_PRIORITY, ULT_VAL). Two code cells in the Triangle user guide still
passed the old lowercase names, so they raised:
ValueError: Invalid option(s): array_backend. Must be one of
['ARRAY_BACKEND', 'AUTO_SPARSE', 'ARRAY_PRIORITY', 'ULT_VAL'].
Updated set_option('array_backend', ...) -> 'ARRAY_BACKEND' and
set_option('auto_sparse', ...) -> 'AUTO_SPARSE' to match the new API.
Closes casact#889.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## experimental #895 +/- ##
================================================
- Coverage 87.11% 87.04% -0.08%
================================================
Files 87 86 -1
Lines 5154 4986 -168
Branches 696 646 -50
================================================
- Hits 4490 4340 -150
+ Misses 465 456 -9
+ Partials 199 190 -9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
The red check here is the The #897 fixes that cell. It targets |
|
thanks for pushing doc changes through experimental first. dumb question. why does this seemingly similar valueerror on main does not trigger a doctest fail? given our desire to keep PRs incremental, i'd like to avoid piling up too many changes on experimental, which is currently sitting at a file diff count of 50 already. I will try to get experimental merged ASAP. but may take a bit before we merge this one. |
|
The lowercase MyST-NB executes every notebook ( The build continues past the warning and the job stays green. The error is real, demoted to a warning, dumped to
Mechanism: a notebook cell raising an exception is a warning, build stays green. A kernel/process crash kills the build, job goes red. |
Closes #889.
The options refactor on
experimentaladdedOptions._validate_option(), which checks the option name against the uppercase attribute keys (ARRAY_BACKEND,AUTO_SPARSE,ARRAY_PRIORITY,ULT_VAL). Two code cells indocs/user_guide/triangle.ipynb(the "Other Parameters" / Backends section linked in the issue) still passed the old lowercase names, so they now raise:Fix:
cl.options.set_option('array_backend', 'cupy')->'ARRAY_BACKEND'cl.options.set_option('auto_sparse', False)->'AUTO_SPARSE'I grepped the whole
docs/tree forcl.options.*_option(calls — these two were the only stale ones;methods.ipynbalready uses the correct uppercase'ULT_VAL'. Notebook JSON validates after the edit.Targeting
experimentalsince that's where the refactor and the rendered docs in the issue live.Note
Low Risk
Documentation-only notebook string fixes; no runtime or library code changes.
Overview
Updates two example cells in
docs/user_guide/triangle.ipynbsocl.options.set_optionuses the uppercase option keys required after the options refactor:'array_backend'→'ARRAY_BACKEND'and'auto_sparse'→'AUTO_SPARSE'. Without this, those notebook cells raiseValueErrorfromOptions._validate_option.Reviewed by Cursor Bugbot for commit 3efc988. Bugbot is set up for automated code reviews on this repo. Configure here.