SimParams: pretty exceptions upon a misconfiguration
@@ -115,6 +115,7 @@ class NLIParams(Parameters):
class SimParams(Parameters):
def __init__(self, **kwargs):
+ try:
if 'nli_parameters' in kwargs:
self._nli_params = NLIParams(**kwargs['nli_parameters'])
else:
@@ -123,6 +124,8 @@ class SimParams(Parameters):
self._raman_params = RamanParams(**kwargs['raman_parameters'])
else:
self._raman_params = None
+ except KeyError as e:
+ raise ParametersError(f'Simulation parameters must include {e}. Configuration: {kwargs}')
@property
def nli_params(self):
