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
Prompt: I think we should do an issue about the objective parenthesis...?
Note
The following content was generated by AI.
merge puts each objective in brackets. A merge in steps therefore nests the brackets: ((a) + (b)) + (c), where one list gives (a) + (b) + (c). The canonical text is the same, so only the written file differs.
Reproduction, proposed change, scope
Reproduction. Found while testing merges in steps for #763, on feat/adds-to at 09cb6f2. main builds the objective the same way, in _summed_objective. The fixtures are in tests/test_terms.py, and dem and obj each add one objective:
Proposed change. Join the objectives with a plain +, as #763 does for the terms of a sum. + and - are the loosest operators in the arithmetic grammar (_build_grammar in _expression_parser.py), so the join never changes how a term groups, and a term such as -x parses as a + -x.
What the change touches. Taken with a throwaway edit on 09cb6f2:
_summed_objective: one line.
Two tests fail and need the new expected text: test_the_objectives_are_summed_each_term_parenthesised and test_several_files_page.py::test_every_python_step_prints_what_the_page_shows.
Prose that says "each term in parentheses": docs/howto/compose.md (two places), docs/examples/library/composed.md, and the module docstring and _summed_objective's docstring in composition.py.
Every merged objective prints without brackets, including a one-list merge. That is a change a reader of the changelog can see, so it gets its own PR and changelog line, not a line in #763.
Not checked. Whether a generated page prints a merged objective. The suite passed with the edit, except for the two tests above.
Note
The following content was generated by AI.
mergeputs each objective in brackets. A merge in steps therefore nests the brackets:((a) + (b)) + (c), where one list gives(a) + (b) + (c). The canonical text is the same, so only the written file differs.Reproduction, proposed change, scope
Reproduction. Found while testing merges in steps for #763, on
feat/adds-toat09cb6f2.mainbuilds the objective the same way, in_summed_objective. The fixtures are intests/test_terms.py, anddemandobjeach add one objective:The two specs give the same
canonical_yaml.Proposed change. Join the objectives with a plain
+, as #763 does for the terms of a sum.+and-are the loosest operators in the arithmetic grammar (_build_grammarin_expression_parser.py), so the join never changes how a term groups, and a term such as-xparses asa + -x.What the change touches. Taken with a throwaway edit on
09cb6f2:_summed_objective: one line.test_the_objectives_are_summed_each_term_parenthesisedandtest_several_files_page.py::test_every_python_step_prints_what_the_page_shows.docs/howto/compose.md(two places),docs/examples/library/composed.md, and the module docstring and_summed_objective's docstring incomposition.py.Every merged objective prints without brackets, including a one-list merge. That is a change a reader of the changelog can see, so it gets its own PR and changelog line, not a line in #763.
Not checked. Whether a generated page prints a merged objective. The suite passed with the edit, except for the two tests above.
Version.
mainatv0.2.0-23-gabe99679.🤖 Generated with Claude Code
https://claude.ai/code/session_01JiNwuVCdEkSLKNxiCNaNAv