Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
is_2d = False
else:
raise RuntimeError("These intervals are not yet supported")
# Copy the parameter values
parameter_min = parameter.min_value
parameter_max = parameter.max_value
initial_value = parameter.value
if is_2d:
# For 2D intervals, we grab a step function
func = StepFunctionUpper()
# Sum up the functions
for i in range(n_intervals - 1):
func += StepFunctionUpper()
# Go through and iterate over intervals to set the parameter values
for i, interval in enumerate(intervals):
i = i + 1
func.free_parameters["value_%d" % i].value = initial_value
func.free_parameters["value_%d" % i].min_value = parameter_min
func.free_parameters["value_%d" % i].max_value = parameter_max
# Copy the parameter values
parameter_min = parameter.min_value
parameter_max = parameter.max_value
initial_value = parameter.value
if is_2d:
# For 2D intervals, we grab a step function
func = StepFunctionUpper()
# Sum up the functions
for i in range(n_intervals - 1):
func += StepFunctionUpper()
# Go through and iterate over intervals to set the parameter values
for i, interval in enumerate(intervals):
i = i + 1
func.free_parameters["value_%d" % i].value = initial_value
func.free_parameters["value_%d" % i].min_value = parameter_min
func.free_parameters["value_%d" % i].max_value = parameter_max
func.parameters["upper_bound_%d" % i].value = interval[1]
func.parameters["lower_bound_%d" % i].value = interval[0]
else: