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

Add named Cells #76

Open
MicahGale opened this issue May 25, 2022 · 6 comments
Open

Add named Cells #76

MicahGale opened this issue May 25, 2022 · 6 comments
Assignees
Labels
feature request An issue that improves the user interface. good first issue Good for newcomers
Milestone

Comments

@MicahGale
Copy link
Collaborator

This idea came from @tjlaboss.

The idea is that rather than just referring to a cell by its number, which is mutable, could we refer to it and request it by a string?
Something like cell.name possibly?

This is already somewhat clunkily possible through comments, however it is clunky.

My main concern with this is: how do you preserve those names through saving to and reading from a file? My thought would be to add them as a preceding comment. However, how do you know it's a name and not just a general comment? We might need to introduce a special comment syntax. This is starting to sound like Mo.py and that concerns me.

@MicahGale
Copy link
Collaborator Author

In GitLab by @tjlaboss on May 25, 2022, 13:23

Syntactically, there's no way to tell if a comment is a name. I think that is a one-way street. Nevertheless, the .name attribute will be pretty useful for working in Python and will be helpful for compatibility with things like the OpenMC Python API.

@MicahGale
Copy link
Collaborator Author

So you think it should only be user set and valid while in memory? Should it be added to the comments?

What's the OpenMC way of doing this?

@MicahGale
Copy link
Collaborator Author

In GitLab by @tjlaboss on May 25, 2022, 14:30

OpenMC objects have a .name attribute which does not need to be set, does not need to be unique, but is carried with the object and written to XML (except universes).

IMO if an object doesn't have a natural name, like the SCn or FCn cards, then the name should be written as a comment. No preference as to whether it's prepended as a comment card or added as an inline $ comment.

@MicahGale
Copy link
Collaborator Author

In GitLab by @tjlaboss on May 25, 2022, 15:00

Another thought: if a name is written as a comment, MCNPy could potentially check if it just wrote that string, to avoid doubling and tripling up on identical comments through multiple passes.

@MicahGale
Copy link
Collaborator Author

Yeah so $ comments aren't support right now. You're right some thought should be given to avoid repeated entries on the comment. I'm thinking if a name is set add it to the comments unless a similar comment already exists. Once the file gets read back in the name isn't parsed.

@MicahGale
Copy link
Collaborator Author

Are you going to do this or should I boot it to the next release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request An issue that improves the user interface. good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants