Commit f40a1834 authored by Philipp Arras's avatar Philipp Arras
Browse files

Notice when samplingdtypesetter are used multiple times

parent 31cd1173
Pipeline #75314 failed with stages
in 3 minutes and 12 seconds
......@@ -124,6 +124,10 @@ class SamplingDtypeSetter(EndomorphicOperator):
need to conincide the with keys of the `MultiDomain`.
def __init__(self, op, dtype):
if isinstance(op, SamplingDtypeSetter):
if op._dtype != dtype:
raise ValueError('Dtype for sampling already set to another dtype.')
op = op._op
if not isinstance(op, EndomorphicOperator):
raise TypeError
if not hasattr(op, 'draw_sample_with_dtype'):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment