• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

idaholab / MontePy / 18539205608

15 Oct 2025 06:44PM UTC coverage: 84.326% (-13.2%) from 97.503%
18539205608

push

github

MicahGale
Updated annotations for all top level modules.

24 of 25 new or added lines in 5 files covered. (96.0%)

1103 existing lines in 38 files now uncovered.

7064 of 8377 relevant lines covered (84.33%)

0.84 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

57.14
/montepy/input_parser/input_reader.py
1
# Copyright 2024, Battelle Energy Alliance, LLC All Rights Reserved.
2
import montepy
1✔
3
from montepy.constants import DEFAULT_VERSION
1✔
4

5

6
def read_input(destination, mcnp_version=DEFAULT_VERSION, replace=True):
1✔
7
    """Reads the specified MCNP Input file.
8

9
    The MCNP version must be a three component tuple e.g., (6, 2, 0) and (5, 1, 60).
10

11
    Notes
12
    -----
13
    if a stream is provided. It will not be closed by this function.
14

15
    Parameters
16
    ----------
17
    destination : io.TextIOBase, str, os.PathLike
18
        the path to the input file to read, or a readable stream.
19
    mcnp_version : tuple
20
        The version of MCNP that the input is intended for.
21
    replace : bool
22
        replace all non-ASCII characters with a space (0x20)
23

24
    Returns
25
    -------
26
    MCNP_Problem
27
        The MCNP_Problem instance representing this file.
28

29
    Raises
30
    ------
31
    UnsupportedFeature
32
        If an input format is used that MontePy does not support.
33
    MalformedInputError
34
        If an input has a broken syntax.
35
    NumberConflictError
36
        If two objects use the same number in the input file.
37
    BrokenObjectLinkError
38
        If a reference is made to an object that is not in the input
39
        file.
40
    UnknownElement
41
        If an isotope is specified for an unknown element.
42
    """
43
    problem = montepy.mcnp_problem.MCNP_Problem(destination)
1✔
UNCOV
44
    problem.mcnp_version = mcnp_version
×
UNCOV
45
    problem.parse_input(replace=replace)
×
UNCOV
46
    return problem
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc