Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug double adding materials. #538

Merged
merged 4 commits into from
Sep 10, 2024

Conversation

MicahGale
Copy link
Collaborator

@MicahGale MicahGale commented Sep 10, 2024

Description

This fixes a bug where append_renumber can double add a material to data_inputs.

append_renumber does:

  1. tries to append
  2. if failure occurs
  3. change the number
  4. append again.

NumberedDataObjectCollection append was doing:

  1. data_inputs.insert
  2. super().append

This fail and retry method led to data_inputs.insert being called twice. So making sure super().append occurs first fixes this.

Fixes #516

Checklist

  • I have performed a self-review of my own code
  • I have added tests that prove my fix is effective or that my feature works (if applicable)

@MicahGale MicahGale linked an issue Sep 10, 2024 that may be closed by this pull request
@MicahGale MicahGale self-assigned this Sep 10, 2024
@MicahGale MicahGale added the bugs A deviation from expected behavior that does not reach the level of being reportable as an "Error". label Sep 10, 2024
@MicahGale MicahGale marked this pull request as ready for review September 10, 2024 12:29
@MicahGale MicahGale merged commit 8e15ea6 into develop Sep 10, 2024
15 checks passed
@MicahGale MicahGale deleted the 516-materialsappend_renumber-adds-double-materials branch September 10, 2024 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugs A deviation from expected behavior that does not reach the level of being reportable as an "Error".
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Materials.append_renumber adds double materials
2 participants