Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion csg2csg/MCNPInput.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def __get_importances(self, start_line):
return self.__process_importances()

# check for importance keyword
if "imp" in self.file_lines[idx]:
if self.file_lines[idx].startswith('imp'):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about checking the start and end of the line

Suggested change
if self.file_lines[idx].startswith('imp'):
if self.file_lines[idx].startswith('imp') or self.file_lines[idx].endswith('imp') :

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

having just had a similar issue i found we already had a pr to fix
endswith wont work,
changing the search to "imp:" makes the most sense

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if self.file_lines[idx].startswith('imp'):
if self.file_lines[idx].startswith('imp:'):

particle = self.file_lines[idx].split()[0].split(":")[1]

# TODO mcnp allows the following forms imp:n imp:n,p etc
Expand Down