Skip to content
Snippets Groups Projects
Unverified Commit ff73bdb6 authored by Michiel Cottaar's avatar Michiel Cottaar
Browse files

Actually convert integer variables into integers

parent 30e5ff1f
No related branches found
No related tags found
1 merge request!10Add Magnetisation transfer sequence
......@@ -228,6 +228,7 @@ It is used internally by [`build_sequence`](@ref).
"""
fixed(some_value) = some_value
fixed(jump_variable::AbstractJuMPScalar) = value(jump_variable)
fixed(jump_variable::GenericVariableRef) = is_integer(jump_variable) ? Int(value(jump_variable)) : value(jump_variable)
fixed(jump_variable::AbstractArray) = fixed.(jump_variable)
fixed(dict_variable::AbstractDict) = typeof(dict_variable)(k => fixed(v) for (k, v) in pairs(dict_variable))
fixed(tuple_variable::Tuple) = fixed.(tuple_variable)
......
......@@ -99,17 +99,6 @@ variables.nsamples
effective_time(adc::ADC) = variables.time_to_center(adc)
end
function fixed(adc::ADC)
# round nsamples during fixing
r = Int(round(value(variables.resolution(adc)), RoundNearest))
n = Int(round(value(variables.nsamples(adc)), RoundNearest))
if iszero(n)
return ADC(0, NaN, NaN, NaN)
end
oversample = n // r
return ADC(r, value(adc.dwell_time), value(adc.time_to_center), oversample)
end
make_generic(adc::ADC) = adc
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment