Skip to content

Conversation

@34j
Copy link
Contributor

@34j 34j commented Nov 25, 2025

Description of change

Pull-Request Checklist

  • Code is up-to-date with the main branch
  • This pull request follows the contributing guidelines.
  • This pull request links relevant issues as Fixes #0000
  • There are new or updated unit tests validating the change
  • Documentation has been updated to reflect this change
  • The new commits follow conventions outlined in the conventional commit spec, such as "fix(api): prevent racing of requests".
  • If pre-commit.ci is failing, try pre-commit run -a for further information.
  • If CI / test is failing, try uv run pytest for further information.

@codecov
Copy link

codecov bot commented Nov 25, 2025

Codecov Report

❌ Patch coverage is 30.00000% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/biem_helmholtz_sphere/cli.py 30.00% 7 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copilot AI review requested due to automatic review settings December 8, 2025 08:53
Copy link

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 fixes the JASCOME command in the CLI by adding visualization capabilities and a new accuracy benchmarking function. The changes introduce coordinate system visualization for different branching types and reorganize output into a dedicated directory.

Key Changes:

  • Added ultrasphere[plot] dependency with pydot and pygraphviz for graph visualization
  • Created visualization code for spherical coordinate branching types (generates SVG files)
  • Organized JASCOME output into a dedicated jascome/ directory
  • Added new accuracy function for numerical accuracy benchmarking across different configurations

Reviewed changes

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

Show a summary per file
File Description
pyproject.toml Added ultrasphere[plot]>=2.0.4 dependency for plotting capabilities
uv.lock Updated lock file with new dependencies: pydot 4.0.1 and pygraphviz 1.14
src/biem_helmholtz_sphere/cli.py Added matplotlib/networkx imports, directory organization, coordinate visualization, and new accuracy benchmarking function
jascome/*.csv Updated numerical output data reflecting computational changes from the fixes
*.svg files Generated coordinate system visualizations for different branching types (caa, bpbpa, bpa, bba, ba)

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

branching_types: str = "a",
) -> None:
"""Numerical examples for JASCOME."""
branchin_types = branching_types.split(",")
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

Typo in variable name: branchin_types should be branching_types (missing 'g'). This inconsistency with the parameter name could cause confusion.

Copilot uses AI. Check for mistakes.
uscat = calc.uscat(xp.asarray((0.0,) * c.c_ndim, device=device, dtype=dtype))
with Path("accuracy/accuracy.csv").open("a") as f:
f.write(
f"{btype},{n_end},{complex(uscat)},{k},"
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

The order of arguments in the CSV write is incorrect. The format string specifies branching_types,n_end,k,uscat,... but the write statement outputs {btype},{n_end},{complex(uscat)},{k},... - the k value appears after uscat instead of before it. This should be: f"{btype},{n_end},{k},{complex(uscat)},..." to match the header.

Suggested change
f"{btype},{n_end},{complex(uscat)},{k},"
f"{btype},{n_end},{k},{complex(uscat)},"

Copilot uses AI. Check for mistakes.
Comment on lines +67 to +69
fig, ax = plt.subplots()
draw(c, ax=ax)
fig.savefig(f"{btype}.svg")
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

The figure is saved using the branching type as filename without sanitization. Consider using Path(f"jascome/{btype}.svg") or validating btype to ensure it's safe for filesystem use, especially if it could contain special characters like path separators.

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