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

Fail to parse FQ cards #584

Open
dodu94 opened this issue Oct 24, 2024 · 3 comments
Open

Fail to parse FQ cards #584

dodu94 opened this issue Oct 24, 2024 · 3 comments
Assignees
Labels
bugs A deviation from expected behavior that does not reach the level of being reportable as an "Error".

Comments

@dodu94
Copy link

dodu94 commented Oct 24, 2024

Describe the bug

It seems that montepy is not able to parse correctly FQ cards

To Reproduce

problem = montepy.read_input("foo.imcnp")

Error Message (if any)

Traceback (most recent call last):
  File "D:\DATA\laghida\Documents\test\profiler_cmodel.py", line 11, in <module>
    problem = montepy.read_input(input_file)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ProgramData\Anaconda3\envs\monte\Lib\site-packages\montepy\input_parser\input_reader.py", line 31, in read_input
    problem.parse_input(replace=replace)
  File "C:\ProgramData\Anaconda3\envs\monte\Lib\site-packages\montepy\mcnp_problem.py", line 382, in parse_input
    raise e
  File "C:\ProgramData\Anaconda3\envs\monte\Lib\site-packages\montepy\mcnp_problem.py", line 367, in parse_input
    obj = obj_parser(input)
          ^^^^^^^^^^^^^^^^^
  File "C:\ProgramData\Anaconda3\envs\monte\Lib\site-packages\montepy\data_inputs\data_parser.py", line 47, in parse_data
    return data_input.DataInput(input, prefix=prefix)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ProgramData\Anaconda3\envs\monte\Lib\site-packages\montepy\data_inputs\data_input.py", line 340, in __init__
    super().__init__(input, fast_parse)
  File "C:\ProgramData\Anaconda3\envs\monte\Lib\site-packages\montepy\data_inputs\data_input.py", line 58, in __init__
    super().__init__(input, self._parser)
  File "C:\ProgramData\Anaconda3\envs\monte\Lib\site-packages\montepy\mcnp_object.py", line 59, in __init__
    raise ParsingError(
montepy.errors.ParsingError:     test.i, line 13

        14| FQ11    s u
        15| C
The input ended prematurely.
sly: Parse error in input. EOF

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:

TEST
1 0 -1 IMP:N=1
2 0 1 IMP:N=0

1 SO 20

NPS 1
MODE N
C
FC11    Neutron current
F11:N   1
FT11    INC
FU11    0 1
FM11    1.9730E+19
FQ11    s u
C

Version

  • Version 0.5.0
@dodu94 dodu94 added the bugs A deviation from expected behavior that does not reach the level of being reportable as an "Error". label Oct 24, 2024
@MicahGale
Copy link
Collaborator

Thanks @dodu94. This doesn't surprise me with how FQ syntax is. This should be tackled with #11.

Though a stop gap measure is probably a good idea.

@dodu94
Copy link
Author

dodu94 commented Oct 24, 2024

I quickly went through #11 and, if I understand correctly, that is about having a full support of tallies. I support that, but in the meantime I guess montepy should just recognize FQ simply as a data card without knowing what it is exactly and just go on with the parsing right?

@MicahGale
Copy link
Collaborator

MicahGale commented Oct 24, 2024

Yes. It's just that we don't have a rule for a data input that is all text right now. So yes we'll do a stop gap measure to just make it parsable and not error out.

@MicahGale MicahGale self-assigned this Oct 24, 2024
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

No branches or pull requests

2 participants