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

Various fixes to Python API and scripts #378

Merged
merged 5 commits into from
Apr 30, 2015

Conversation

paulromano
Copy link
Contributor

A summary of the changes in this pull request:

  • The merging of OpenMC Python API #331 broke a number of the scripts in utils/ that used the statepoint module. I've updated plot_mesh_tally.py and statepoint_histogram.py to work with the new statepoint module.
  • I've deleted statepoint_meshplot.py. This script is essentially an older and more limited version of plot_mesh_tally that doesn't provide any more funtionality.
  • I've deleted statepoint_cmp.py. If one is using HDF5, it's easy enough to h5diff two statepoint files.
  • Fixed a few errors in the statepoint and tallies modules that I encountered when updated the scripts.
  • Moved particle_restart.py to be part of the Python API.

@wbinventor can you review?

…emove

statepoint_cmp.py and statepoint_meshplot.py scripts since h5diff can be used in
place of the former and plot_mesh_tally can be used in place of the latter.
…_restart.py

to utils/openmc folder to make it part of Python API.
@paulromano
Copy link
Contributor Author

I should also mention that I updated statepoint.py to work with Python 3.

@wbinventor
Copy link
Contributor

Sure, I will take a look at this in the morning.

@@ -7,6 +8,9 @@
import openmc
from openmc.constants import *

if sys.version > '3':
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps we should make Python 3 the standard for Travis? Although I use Python 3 from time-to-time, I still haven't made it the default on my systems, hence issues like this arise. Anyway, just a thought.

Copy link
Contributor

Choose a reason for hiding this comment

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

For the record, I use Python 3 exclusively these days. So you have at least one user :). Adding Python 3 to Travis would probably help.

Copy link
Contributor

Choose a reason for hiding this comment

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

There are always the cool kids and a few that are slower than the rest of the pack in every class.

Copy link
Contributor

Choose a reason for hiding this comment

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

haha <insert rant about arch linux here>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm inclined to leave Travis using 2.7 for the time being. Most (all except Arch?) distributions use 2 as default still. @scopatz do you have any thoughts about good ways to test both 2 and 3?

Copy link
Contributor

Choose a reason for hiding this comment

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

If you add both 2.7 and 3.4 to the Python list in the travis.yml file, it will test both languages in parallel. This is what pyne and cyclus do. See https://github.com/pyne/pyne/blob/develop/.travis.yml#L2 Should be a one or two line change,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Didn't realize it was that simple - thanks!

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, not hard and totally worth it :)

@wbinventor
Copy link
Contributor

This PR looks good to me save for my few very minor comments.

@wbinventor
Copy link
Contributor

Everything looks good. Thanks for the fixes @paulromano

wbinventor pushed a commit that referenced this pull request Apr 30, 2015
Various fixes to Python API and scripts
@wbinventor wbinventor merged commit 75174d8 into openmc-dev:develop Apr 30, 2015
@paulromano paulromano deleted the python-fixes branch April 30, 2015 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants