Skip to content

Drawing improvements#89

Merged
lizliz merged 2 commits intomasterfrom
drawing_improvements
Mar 20, 2026
Merged

Drawing improvements#89
lizliz merged 2 commits intomasterfrom
drawing_improvements

Conversation

@lizliz
Copy link
Collaborator

@lizliz lizliz commented Mar 20, 2026

Some stuff didn't get pushed on the last PR, fixing that.

Copilot AI review requested due to automatic review settings March 20, 2026 17:34
@lizliz lizliz merged commit b2a071c into master Mar 20, 2026
6 checks passed
@lizliz lizliz deleted the drawing_improvements branch March 20, 2026 17:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR completes previously-missed “drawing improvements” work by stabilizing the constrained x-layout used for Reeb/Mapper drawing and adding regression tests around layout determinism and y-coordinate invariants.

Changes:

  • Stabilize reeb_x_layout by avoiding unbounded drift on edgeless graphs, adding bounds, and adding a small centering regularizer.
  • Add new unit tests for layout behavior (finite/normalized x, seed reproducibility) and for set_pos_from_f preserving y-values.
  • Bump package version to 0.1.14 and add/update documentation images.

Reviewed changes

Copilot reviewed 5 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
cereeberus/cereeberus/draw/layout.py Adds normalization helper, handles edgeless graphs, introduces bounded optimization and a centering term.
tests/test_draw_layout.py New regression tests for reeb_x_layout finiteness, normalization range, reproducibility, and edgeless cases.
tests/test_reeb_class.py Adds test ensuring set_pos_from_f preserves y == f(v); adjusts imports.
tests/test_mapper_class.py Adds test ensuring set_pos_from_f preserves y == delta * f(v); adjusts imports.
pyproject.toml Version bump 0.1.130.1.14.
doc_source/images/torus-extraverts.png Adds/updates rendered documentation image asset.
doc_source/images/line.png Adds/updates rendered documentation image asset.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +249 to 250
unittest.main()
if __name__ == '__main__':
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two identical if __name__ == '__main__': unittest.main() blocks at the end of the file, which will run the suite twice when executed directly. Remove the duplicate so there is only a single entry point.

Suggested change
unittest.main()
if __name__ == '__main__':

Copilot uses AI. Check for mistakes.
Comment on lines +148 to 149
unittest.main()
if __name__ == '__main__':
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two identical if __name__ == '__main__': unittest.main() blocks at the end of the file, which will run the suite twice when executed directly. Remove the duplicate so there is only a single entry point.

Suggested change
unittest.main()
if __name__ == '__main__':

Copilot uses AI. Check for mistakes.
Comment on lines 157 to +171
@@ -146,6 +168,7 @@ def energy(x):
for i, j in same_height_pairs:
diff = x[i] - x[j]
e += repulsion / (diff**2 + 1e-6)
e += center_weight * np.dot(x, x)
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The module docstring at the top defines the layout energy without the new centering term, but the implementation now adds center_weight * dot(x, x) (and bounds). Please update the documented energy expression/description so it matches the optimizer objective.

Copilot uses AI. Check for mistakes.
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.

2 participants