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

make compatible with python3 #53

Closed
wants to merge 180 commits into from
Closed

Conversation

kkiesling
Copy link
Member

(creating PR to to be able to run on CI, changes likely still needed)

This work is attempting to make all things compatible with python3. Changes made here need to be checked that they are still compatible with python2.

There are known python3 errors in the following files but I am unsure how to fix them:
test_alara.py - rounding error in one of the files generated
test_mcnp.py - rounding error

This PR addresses #49 .

…another mesh type when it isn't completely necessary.
@kkiesling kkiesling requested a review from gonuke January 28, 2019 22:41
@kkiesling
Copy link
Member Author

CI needs to also be updated to test with python 3 and pymoab.

@gonuke
Copy link
Member

gonuke commented Jan 29, 2019

I’m a little concerned that commit ae30824 was a merge commit instead of a rebase, for when it comes time to combine this with the main PR?

@gonuke
Copy link
Member

gonuke commented Jan 29, 2019

I also think we need a tutorial on utf-8 and encodings

@kkiesling
Copy link
Member Author

I agree on the utf-8 tutorial.. I am not on board even with some of my own changes here. I just am not sure the better way to do some of this.

except:
from itertools import zip_longest

from itertools import zip_longest
Copy link
Member Author

Choose a reason for hiding this comment

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

note to self: this line should be removed

@@ -397,7 +397,11 @@ def write_partisn_input_1D():
ngroup = 5

# expected output file
file_expected = THIS_DIR + '/files_test_partisn/partisn_1D_expected.inp'
import platform
if platform.python_version().split('.')[0] == '2':
Copy link
Member Author

Choose a reason for hiding this comment

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

all these expected files that have a python 2 and python 3 version may not actually be necessary in the end. I need to check if the changes I made for python3 do the same thing in python 2 before I delete the original files (which are the python 2 version). Thanks to dictionaries no longer being ordered, things were being printed in different orders.

try:
from itertools import izip as zip
except:
pass
Copy link
Member

Choose a reason for hiding this comment

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

is izip still required ?

@bam241
Copy link
Member

bam241 commented Jan 30, 2019

I have issued a PR against @kkiesling branch that should fix all the python2 problem raised by this... while keeping the tests working on python3

@kkiesling
Copy link
Member Author

This PR being deferred until after PyMOAB is in PyNE. Will follow up with smaller PRs into pyne/pyne.

@kkiesling kkiesling closed this Feb 1, 2019
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.

6 participants