GeezerVison is showing github.com — adding version check and fixing exception · walshjon/pyne@977e6ec
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: pyne/material.pyx +11-1Lines changed: 11 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -21,7 +21,7 @@ import numpy as np |
21 | 21 | from warnings import warn |
22 | 22 | from pyne.utils import QAWarning |
23 | 23 | import os |
24 | | - |
| 24 | +import sys |
25 | 25 | import tables as tb |
26 | 26 |
|
27 | 27 | # local imports |
@@ -638,6 +638,16 @@ cdef class _Material: |
638 | 638 | nucvec : dict |
639 | 639 | For a Material mat |
640 | 640 | """ |
| 641 | +# if sys.version_info[0] > 2: |
| 642 | +# fn = cpp_nucname.id(std_string(<char *> from_nuc)) |
| 643 | +# elif sys.version_info[0] == 2: |
| 644 | +# from_nuc_bytes = from_nuc.encode() |
| 645 | +# fn = cpp_nucname.id(std_string(<char *> from_nuc_bytes)) |
| 646 | + |
| 647 | + |
| 648 | + if sys.version_info[0] > 2: |
| 649 | + basestring = str |
| 650 | + |
641 | 651 | cdef conv._MapIntDouble nucvec_proxy = conv.MapIntDouble() |
642 | 652 | nucvec_proxy.map_ptr = new cpp_map[int, double]( |
643 | 653 | self.mat_pointer.dose_per_g(dose_type, source)) |
|
Collapse file
Copy file name to clipboardExpand all lines: src/material.cpp +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
6 | 6 | #include <vector> |
7 | 7 | #include <iomanip> // std::setprecision |
8 | 8 | #include <math.h> // modf |
| 9 | +#include <stdexcept> |
9 | 10 |
|
10 | 11 | #ifndef PYNE_IS_AMALGAMATED |
11 | 12 | #include "material.h" |
|