montepy.input_parser.input_syntax_reader.read_data#

montepy.input_parser.input_syntax_reader.read_data(fh, mcnp_version, block_type=None, recursion=False)#

Reads the bulk of an MCNP file for all of the MCNP data.

This is a generator function that will yield multiple MCNP_Input instances.

Warning

This function will move the file handle forward in state.

Warning

This function will not close the file handle.

Parameters:
  • fh (MCNP_InputFile) – The file handle of the input file.

  • mcnp_version (tuple) – The version of MCNP that the input is intended for.

  • block_type (BlockType) – The type of block this file is in. This is only used with partial files read using the ReadInput.

  • recursion (bool) – Whether or not this is being called recursively. If True this has been called from read_data. This prevents the reading queue causing infinite recursion.

Returns:

MCNP_Input instances: Inputs that represent the data in the MCNP input.

Return type:

MCNP_Input