From 72b34819c992841d0b1dcc30060e0c6c2a04ee50 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Tue, 23 Jul 2019 18:12:53 -0500 Subject: [PATCH] API Remove results.expectGcu setting - not needed 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. --- docs/defaultSettings.rst | 13 ------------- serpentTools/parsers/results.py | 4 ---- serpentTools/settings.py | 17 ++++++++--------- 3 files changed, 8 insertions(+), 26 deletions(-) diff --git a/docs/defaultSettings.rst b/docs/defaultSettings.rst index c7102ec8..7f470d77 100644 --- a/docs/defaultSettings.rst +++ b/docs/defaultSettings.rst @@ -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: -------------------- diff --git a/serpentTools/parsers/results.py b/serpentTools/parsers/results.py index ecdc64a9..2e2d2e40 100644 --- a/serpentTools/parsers/results.py +++ b/serpentTools/parsers/results.py @@ -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 diff --git a/serpentTools/settings.py b/serpentTools/settings.py index 0c7e6f72..734d0f73 100644 --- a/serpentTools/settings.py +++ b/serpentTools/settings.py @@ -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 @@ -26,6 +27,8 @@ """ +_DEPRECATED = {'results.expectGcu'} + SETTING_OPTIONS_FMTR = "Options: [{}]" defaultSettings = { 'branching.intVariables': { @@ -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, @@ -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)