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

Improve how to move cells between problems and Universes #105

Open
MicahGale opened this issue Sep 20, 2022 · 4 comments
Open

Improve how to move cells between problems and Universes #105

MicahGale opened this issue Sep 20, 2022 · 4 comments
Labels
code improvement A feature request that will improve the software and its maintainability, but be invisible to users. feature request An issue that improves the user interface.

Comments

@MicahGale
Copy link
Collaborator

This is related to this discussion: https://hpcgitlab.hpc.inl.gov/experiment_analysis/mcnpy/-/merge_requests/45#note_399815.

Currently to add cells from one cell to another problem you have to:

  1. Append the new cells to problem.cells
  2. Then run problem.add_cell_children_to_problem to copy over the surfaces, etc.

This method is pretty error prone and can lead to redundant surfaces and conflicts as identical surfaces read in from different files will be different objects. There is some capability to detect this and it's not great. Also this heavily relies on hashing, which is bad (#22).

The ideal use case is that when a user runs problem.cells.append() the cells are added properly and they don't have to think anymore. Similarly universe.append should do a similar thing. problem.universes.append() should also add all children cells to the problem.

@MicahGale
Copy link
Collaborator Author

Thoughts @tjlaboss?

@MicahGale
Copy link
Collaborator Author

In GitLab by @tjlaboss on Sep 20, 2022, 14:41

This sounds like a good idea. How should it handle number conflicts?

  • Error
  • Renumber, with warning
  • Renumber silently
  • Let the user choose with an argument to .append()

@MicahGale
Copy link
Collaborator Author

Right now there is some handling of this already. If there is a number conflict with append an error is raised. append_renumber will just renumber the object. https://experiment_analysis.pages.hpc.inl.gov/mcnpy/api/mcnpy.numbered_object_collection.html

I think we could just cast this behavior down to the lower levels of objects.

@MicahGale MicahGale removed this from the Release-0.3 milestone Nov 14, 2024
@MicahGale
Copy link
Collaborator Author

This will be easier after 1.0.0 with a lot of append hooks in NumberedObjectCollections

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code improvement A feature request that will improve the software and its maintainability, but be invisible to users. feature request An issue that improves the user interface.
Projects
None yet
Development

No branches or pull requests

1 participant