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

fix mcnp6 version check for serial #1454

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

zxkjack123
Copy link
Contributor

@zxkjack123 zxkjack123 commented Jun 7, 2022

Description

A small fix for Ptrac version check.

Behavior

The below code fails when the Ptrac is generated with the serial mcnp6:

pyne/pyne/mcnp.py

Lines 1233 to 1234 in 800c75a

mcnp_version = self.mcnp_version_info[8:13]
if mcnp_version in ["6", "6.mpi"]:

This PR fixes this problem.

@zxkjack123 zxkjack123 marked this pull request as ready for review June 8, 2022 01:54
Copy link
Contributor

@gonuke gonuke left a comment

Choose a reason for hiding this comment

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

Thanks for this update. I wonder why we didn't find it before!

I have suggested a slightly different approach that may be more robust.

@@ -1231,7 +1231,7 @@ def read_variable_ids(self):

if self.eightbytes:
mcnp_version = self.mcnp_version_info[8:13]
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it more robust to strip() the whitespace from the end of this?

Suggested change
mcnp_version = self.mcnp_version_info[8:13]
mcnp_version = self.mcnp_version_info[8:13].strip()

Choose a reason for hiding this comment

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

Sure, but I like @zxkjack123 to make the change and what he thinks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants