Skip to content
Snippets Groups Projects
Commit c80a65f4 authored by eric pellegrini's avatar eric pellegrini
Browse files

Added input value checking condition

parent 5267ebf5
No related branches found
No related tags found
No related merge requests found
......@@ -36,7 +36,7 @@ import operator
import numpy
from MDANSE.Framework.UserDefinitionStore import UD_STORE
from MDANSE.Framework.Configurators.IConfigurator import IConfigurator
from MDANSE.Framework.Configurators.IConfigurator import IConfigurator, ConfiguratorError
from MDANSE.Framework.AtomSelectionParser import AtomSelectionParser
# The granularities at which the selection will be performed
......@@ -80,6 +80,9 @@ class AtomSelectionConfigurator(IConfigurator):
if isinstance(value,basestring):
value = [value]
if not isinstance(value,(list,tuple)):
raise ConfiguratorError("Invalid input value.")
self["value"] = value
......
......@@ -76,6 +76,9 @@ class AtomTransmutationConfigurator(IConfigurator):
# if the input value is None, do not perform any transmutation
if value is None:
return
if not isinstance(value,(list,tuple)):
raise ConfiguratorError("Invalid input value.")
self["atom_selection"] = configuration[self._dependencies['atom_selection']]
if self["atom_selection"]["level"] != "atom":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment