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

Botched Integer Interpolation Expansion #489

Closed
tjlaboss opened this issue Aug 16, 2024 · 1 comment · Fixed by #520
Closed

Botched Integer Interpolation Expansion #489

tjlaboss opened this issue Aug 16, 2024 · 1 comment · Fixed by #520
Assignees
Labels
bugs A deviation from expected behavior that does not reach the level of being reportable as an "Error". critical An issue that seriously limits user adoption or hampers current use.

Comments

@tjlaboss
Copy link
Collaborator

Describe the bug

MontePy expands shortcuts for data entry:

image

The linear interpolation shortcut gets botched upon expansion, being converted to floating point and dropping necessary padding.

To Reproduce

Just load an MCNP input file with the shortcut and write it back out.

import montepy
montepy.read_input("testi.i").write_to_file("testo.i")

MCNP input file snippet

If applicable, please include a small section of the input file you were working on. If it includes any specific values please change or remove them. For example:

MCNP Test Model
C Cells
C Seven spheres within a sphere
1 1 -10 -1001  imp:n,p=2
2 1 -10 -1002  imp:n,p=2
3 1 -10 -1003  imp:n,p=2
4 1 -10 -1004  imp:n,p=2
5 1 -10 -1005  imp:n,p=2
6 1 -10 -1006  imp:n,p=2
7 1 -10 -1007  imp:n,p=2
C This cell breaks MontePy 0.3.3
8     0 -1010  1001  5i  1007  imp:n,p=1
C Graveyard
99    0 +1010     imp:n,p=0

C surfaces
1001 SO      0.1
1002 SX -1.1 0.1
1003 SX +1.1 0.1
1004 SY -1.1 0.1
1005 SY +1.1 0.1
1006 SZ -1.1 0.1
1007 SZ +1.1 0.1
1010 SO 3

C data
C materials
C UO2 5 atpt enriched
m1        92235.80c           5
          92238.80c          95
C execution
ksrc 0 0 0
kcode 100000 1.000 50 1050
mode n p

Error Message (if any)

MCNP Test Model
C Cells
C Seven spheres within a sphere
1 1 -10 -1001  imp:n,p=2
2 1 -10 -1002  imp:n,p=2
3 1 -10 -1003  imp:n,p=2
4 1 -10 -1004  imp:n,p=2
5 1 -10 -1005  imp:n,p=2
6 1 -10 -1006  imp:n,p=2
7 1 -10 -1007  imp:n,p=2
C This cell breaks MontePy 0.3.3
8     0 -1010  1001  1002.01003.01004.01005.01006.01007  imp:n,p=1
C Graveyard
99    0 +1010     imp:n,p=0

C surfaces
1001 SO      0.1
1002 SX -1.1 0.1
1003 SX +1.1 0.1
1004 SY -1.1 0.1
1005 SY +1.1 0.1
1006 SZ -1.1 0.1
1007 SZ +1.1 0.1
1010 SO 3

C data
C materials
C UO2 5 atpt enriched
m1        92235.80c           5
          92238.80c          95
C execution
ksrc 0 0 0
kcode 100000 1.000 50 1050
mode n p

Version

  • Version 0.3.3

Additional context

MontePy currently expands interpolation shortcuts and does not recompress them (#397).

@tjlaboss tjlaboss added the bugs A deviation from expected behavior that does not reach the level of being reportable as an "Error". label Aug 16, 2024
@MicahGale
Copy link
Collaborator

Oh yikes. I suspect that #397 is a common-mode failure. Part of this is we need to use context to change a shortcut to int from float.

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". critical An issue that seriously limits user adoption or hampers current use.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants