mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
Resolve a few TODOs related to Python 3.6
This commit is contained in:
parent
95aa079c76
commit
0d83672544
4 changed files with 4 additions and 14 deletions
|
|
@ -146,10 +146,6 @@ class DataLibrary(EqualityMixin):
|
|||
raise ValueError("Either path or OPENMC_CROSS_SECTIONS "
|
||||
"environmental variable must be set")
|
||||
|
||||
# Convert to string to support pathlib
|
||||
# TODO: Remove when support is Python 3.6+ only
|
||||
path = str(path)
|
||||
|
||||
tree = ET.parse(path)
|
||||
root = tree.getroot()
|
||||
if root.find('directory') is not None:
|
||||
|
|
|
|||
|
|
@ -158,11 +158,8 @@ class TransportOperator(ABC):
|
|||
def __enter__(self):
|
||||
# Save current directory and move to specific output directory
|
||||
self._orig_dir = os.getcwd()
|
||||
if not self.output_dir.exists():
|
||||
self.output_dir.mkdir() # exist_ok parameter is 3.5+
|
||||
|
||||
# In Python 3.6+, chdir accepts a Path directly
|
||||
os.chdir(str(self.output_dir))
|
||||
self.output_dir.mkdir(exist_ok=True)
|
||||
os.chdir(self.output_dir)
|
||||
|
||||
return self.initial_condition()
|
||||
|
||||
|
|
|
|||
|
|
@ -68,8 +68,6 @@ class MGXSTestHarness(PyAPITestHarness):
|
|||
return outstr
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version_info < (3, 6),
|
||||
reason="Pandas 1.0 API changed and requires Python 3.6+")
|
||||
def test_mgxs_library_distribcell():
|
||||
model = pwr_assembly()
|
||||
harness = MGXSTestHarness('statepoint.10.h5', model)
|
||||
|
|
|
|||
|
|
@ -43,12 +43,11 @@ def materials(tmpdir_factory):
|
|||
with lib.run_in_memory():
|
||||
yield [lib.Material(), lib.Material()]
|
||||
finally:
|
||||
# Convert to strings as os.remove in py 3.5 doesn't support Paths
|
||||
for file_path in ("settings.xml", "geometry.xml", "materials.xml",
|
||||
"summary.h5"):
|
||||
os.remove(str(tmpdir / file_path))
|
||||
os.remove(tmpdir / file_path)
|
||||
orig.chdir()
|
||||
os.rmdir(str(tmpdir))
|
||||
os.rmdir(tmpdir)
|
||||
|
||||
|
||||
def proxy_tally_data(tally, fill=None):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue