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

Reveal hidden information in dissociated objects #632

Open
tjlaboss opened this issue Jan 11, 2025 · 1 comment
Open

Reveal hidden information in dissociated objects #632

tjlaboss opened this issue Jan 11, 2025 · 1 comment
Labels
feature request An issue that improves the user interface.

Comments

@tjlaboss
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
With #595, it is possible to create objects by parsing MCNP strings.

Example:

>>> surf = montepy.Surface("1 2 pz -3")
>>> surf
SURFACE: 1, PZ, periodic surface: None, transform: None, constants: [-3.0]
>>> cell = montepy.Cell("1  9 -8.0  -1 -2")
CELL: 1 
Void material 
density: 8.0 g/cc

This feels deceptively like MontePy has lost the information. Thankfully, it hasn't. The Surface just doesn't know about tr2 and the Cell doesn't know about m9 or any of the surfaces, so it doesn't display them. Proof:

>>> surf.old_transform_number
3
>>> cell.old_mat_number
9

Describe the solution you'd like

In either __str__ or __repr__, reveal the old information when it doesn't match the available information. In this case, that would be the transform, the material, and the cell region or constituent surfaces. Example of what I'd like to see:

>>> surf
SURFACE: 1, PZ, periodic surface: None, transform: None [old_transform: 3], constants: [-3.0]

Describe alternatives you've considered

  • Always reveal "old_*" information, if present. This seems superfluous when nothing has changed.
  • Show the "old_" information as if it is the current information with whatever information is available. This is actually my personal preference. Example:
>>> surf
SURFACE: 1, PZ, periodic surface: None, transform: TRANSFORM: 3 [undefined], constants: [-3.0]
>>> cell
CELL: 1
MATERIAL: 9 [undefined]
@MicahGale
Copy link
Collaborator

I'm thinking maybe:

>>> surf
SURFACE: 1, PZ, periodic surface: None, transform: TRANSFORM: 3 [unlinked], constants: [-3.0]
>>> cell
CELL: 1
MATERIAL: 9 [unlinked]

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.
Projects
None yet
Development

No branches or pull requests

2 participants