Skip to content

Commit

Permalink
API Remove results.expectGcu setting - not needed
Browse files Browse the repository at this point in the history
The setting is no longer needed, after some local testing that
demonstrates that, in the presence of files without group constant
data, the ResultsReader still stores data without error. A warning
message is printed indicating the setting is no longer
needed.
  • Loading branch information
drewejohnson committed Jul 23, 2019
1 parent 44b91b6 commit 72b3481
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 26 deletions.
13 changes: 0 additions & 13 deletions docs/defaultSettings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,6 @@ If true, store the micro-group cross sections.
Type: bool

.. _results-expectGcu:

---------------------
``results.expectGcu``
---------------------

Set this to False if no homogenized group contants are present in the output, as if ``set gcu -1`` is preset in the input file
::

Default: True
Type: bool

.. _sampler-allExist:

--------------------
Expand Down
4 changes: 0 additions & 4 deletions serpentTools/parsers/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,6 @@ def _inspectData(self):
.format(self.filePath, self._numUniv,
self._counter['rslt'], self._counter['meta']))
if not self.resdata and not self.metadata:
if not self.settings['expectGcu']:
raise SerpentToolsException(
"Metadata and results data were not found in {}"
.format(self.filePath))
for keys, dictUniv in iteritems(self.universes):
if dictUniv.hasData():
return
Expand Down
17 changes: 8 additions & 9 deletions serpentTools/settings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Settings to yield control to the user."""
import os
from warnings import warn

from six import iteritems
from yaml import safe_load
Expand All @@ -26,6 +27,8 @@
"""

_DEPRECATED = {'results.expectGcu'}

SETTING_OPTIONS_FMTR = "Options: [{}]"
defaultSettings = {
'branching.intVariables': {
Expand Down Expand Up @@ -70,13 +73,6 @@
'detectors',
'type': list
},
'results.expectGcu': {
'default': True,
'description': 'Set this to False if no homogenized group contants '
'are present in the output, as if ``set gcu -1`` is '
'preset in the input file',
'type': bool,
},
'verbosity': {
'default': 'warning',
'options': messages.LOG_OPTS,
Expand Down Expand Up @@ -305,12 +301,15 @@ def setValue(self, name, value):
If the value is not of the correct type
"""
if self.__inside:
self.__originals[name] = self[name]
if name in _DEPRECATED:
warn("Setting {} has been removed.".format(name))
return
if name not in self:
raise KeyError('Setting {} does not exist'.format(name))
self._defaultLoader[name].validate(value)
# if we've made it here, then the value is valid
if self.__inside:
self.__originals[name] = self[name]
if self._defaultLoader[name].updater is not None:
value = self._defaultLoader[name].updater(value)
dict.__setitem__(self, name, value)
Expand Down

0 comments on commit 72b3481

Please sign in to comment.