Pull the check on layer names out so that DataLayerInterface types get it as well.

This commit is contained in:
Mike Auty
2018-08-22 09:33:47 +01:00
parent ec3c6f34b8
commit b74eb68c04
+2 -2
View File
@@ -423,9 +423,9 @@ class Memory(validity.ValidityRoutines, collections.abc.Mapping):
This will throw an exception if the required dependencies are not met
"""
self._check_type(layer, DataLayerInterface)
if layer.name in self._layers:
raise exceptions.LayerException("Layer already exists: {}".format(layer.name))
if isinstance(layer, TranslationLayerInterface):
if layer.name in self._layers:
raise exceptions.LayerException("Layer already exists: {}".format(layer.name))
missing_list = [sublayer for sublayer in layer.dependencies if sublayer not in self._layers]
if missing_list:
raise exceptions.LayerException(