Skip to content

Add edge-count consistency checks in test_graph_creation - #396

Closed
Shivampal157 wants to merge 1 commit into
mllam:mainfrom
Shivampal157:feature/edge-count-consistency-checks
Closed

Add edge-count consistency checks in test_graph_creation#396
Shivampal157 wants to merge 1 commit into
mllam:mainfrom
Shivampal157:feature/edge-count-consistency-checks

Conversation

@Shivampal157

@Shivampal157 Shivampal157 commented Mar 13, 2026

Copy link
Copy Markdown

Describe your changes

Add edge-count consistency checks in test_graph_creation: the test now asserts that for each graph (g2m, m2g, m2m, and for hierarchical graphs mesh_up / mesh_down), the number of edges in each *_edge_index.pt file matches the number of rows in the corresponding *_features.pt file. This addresses the outstanding TODO in the test file.

No new dependencies. Motivation: ensure generated graph files are internally consistent before they are used downstream.

Issue Link

Closes #380

Type of change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📖 Documentation (Addition or improvements to documentation)

Checklist before requesting a review

  • My branch is up-to-date with the target branch - if not update your fork with the changes from the target branch (use pull with --rebase option if possible).
  • I have performed a self-review of my code
  • For any new/modified functions/classes I have added docstrings that clearly describe its purpose, expected inputs and returned values
  • I have placed in-line comments to clarify the intent of any hard-to-understand passages of my code
  • I have updated the README to cover introduced code changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have given the PR a name that clearly describes the change, written in imperative form (context).
  • I have requested a reviewer and an assignee (assignee is responsible for merging). This applies only if you have write access to the repo, otherwise feel free to tag a maintainer to add a reviewer and assignee.

Checklist for reviewers

Each PR comes with its own improvements and flaws. The reviewer should check the following:

  • the code is readable
  • the code is well tested
  • the code is documented (including return types and parameters)
  • the code is easy to maintain

Author checklist after completed review

  • I have added a line to the CHANGELOG describing this change, in a section
    reflecting type of change (add section where missing):
    • added: when you have added new functionality
    • changed: when default behaviour of the code has been changed
    • fixes: when your contribution fixes a bug
    • maintenance: when your contribution is relates to repo maintenance, e.g. CI/CD or documentation

Checklist for assignee

  • PR is up to date with the base branch
  • the tests pass
  • (if the PR is not just maintenance/bugfix) the PR is assigned to the next milestone. If it is not, propose it for a future milestone.
  • author has added an entry to the changelog (and designated the change as added, changed, fixed or maintenance)
  • Once the PR is ready to be merged, squash commits and merge the PR.

Check that each *_edge_index.pt has same number of edges as rows in corresponding *_features.pt for g2m, m2g, m2m and mesh up/down. Closes mllam#380

Made-with: Cursor
@Shivampal157

Copy link
Copy Markdown
Author

@sadamov , I’ve implemented the edge-count consistency checks for issue #380 and opened a PR. Could you take a look when you have time?

@sadamov
sadamov requested a review from joeloskarsson March 13, 2026 19:57
@sadamov sadamov added the enhancement New feature or request label Mar 13, 2026
@Sharkyii

Copy link
Copy Markdown
Contributor

@Shivampal157 the code LGTM, just revert back to the original PR template

@Shivampal157

Shivampal157 commented Mar 14, 2026

Copy link
Copy Markdown
Author

@joeloskarsson @Sharkyii Done, reverted to the original PR template. Thanks.

@joeloskarsson

Copy link
Copy Markdown
Collaborator

It looks like we have duplicate fixes for this in #301 and #396 now. Please discuss in #380 how to best solve this.

@sadamov sadamov added the duplicate This issue or pull request already exists label Mar 15, 2026
@joeloskarsson

Copy link
Copy Markdown
Collaborator

Closed in favor of #301

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add edge-count consistency checks in `test_graph_creation

4 participants