Skip to content

Fixing index error bug with forcenooverlaps#323

Open
tcmcclan-ornl wants to merge 2 commits intoGEOUNED-org:devfrom
tcmcclan-ornl:Fixing_index_error_bug_with_forcenooverlaps
Open

Fixing index error bug with forcenooverlaps#323
tcmcclan-ornl wants to merge 2 commits intoGEOUNED-org:devfrom
tcmcclan-ornl:Fixing_index_error_bug_with_forcenooverlaps

Conversation

@tcmcclan-ornl
Copy link
Contributor

@tcmcclan-ornl tcmcclan-ornl commented May 14, 2025

Description

This pull request adds a check for any bool found in the m.Definition.elements list that gets deleted during the m.Definition.join_operators() call in the cell_definition.py file.

Fixes issue

#322

Checklist

  • I'm making a PR from a feature branch on my fork into GEOUNED-org/GEOUNED/dev branch
  • I have followed PEP8 style guide for Python or run a formatter such as black or ruff format on my code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

@akolsek akolsek requested a review from psauvan February 17, 2026 12:59
comp.clean()

m.set_definition(new_def)
for i in range(len(m.Definition.elements)):
Copy link
Member

Choose a reason for hiding this comment

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

the index i should be reversed otherwise if there are more than one element to remove, the module pop(i) will not remove the correct element
the line should be :
for i in reversed(range(len(m.Definition.elements))):

Copy link
Member

@psauvan psauvan left a comment

Choose a reason for hiding this comment

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

The line 897 should be corrected

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