Skip to content

Commit

Permalink
Sort the output of temperature dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
smharper committed Oct 8, 2016
1 parent c7c5e67 commit b4df08a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion openmc/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ def _create_no_reduce_subelement(self):

def _create_temperature_subelements(self):
if self.temperature:
for key, value in self.temperature.items():
for key, value in sorted(self.temperature.items()):
element = ET.SubElement(self._settings_file,
"temperature_{}".format(key))
element.text = str(value)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_multipole/inputs_true.dat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
28e3b5cba12061ff7c410585117d40425d830a53fa2e7324d8f96deee28a57fb4cc4de393aa600f44816e72a0f66f22f5f4c65d52977d99f6a0d53275d263067
2be927608035759f52a2ac88b2c84e28c06e0f7905187bfd4695fecd80f417e727d8879c52fe03253938f7aa0301061f72dce9b5ae46b8675049b5bc4d9525a0
5 changes: 1 addition & 4 deletions tests/test_multipole/test_multipole.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
from collections import OrderedDict
import os
import sys
sys.path.insert(0, os.pardir)
Expand Down Expand Up @@ -69,9 +68,7 @@ def _build_inputs(self):
sets_file.particles = 1000
sets_file.source = Source(space=Box([-1, -1, -1], [1, 1, 1]))
sets_file.output = {'summary': True}
sets_file.temperature = OrderedDict()
sets_file.temperature['tolerance'] = 1000
sets_file.temperature['multipole'] = True
sets_file.temperature = {'tolerance': 1000, 'multipole': True}
sets_file.export_to_xml()

####################
Expand Down

0 comments on commit b4df08a

Please sign in to comment.