From 93773c6632e9fbbc49adeca01ca090903cf669c6 Mon Sep 17 00:00:00 2001 From: Reno <25192197+singularitti@users.noreply.github.com> Date: Mon, 17 Jan 2022 16:29:13 -0500 Subject: [PATCH 1/2] Fix `_choose` --- src/EquationOfStateWorkflow/actions.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EquationOfStateWorkflow/actions.jl b/src/EquationOfStateWorkflow/actions.jl index fdf2c24..88873c2 100644 --- a/src/EquationOfStateWorkflow/actions.jl +++ b/src/EquationOfStateWorkflow/actions.jl @@ -66,9 +66,9 @@ customizer(params::Parameters, pressure::Pressure, timefmt = "Y-m-d_H:M:S") = function _choose(possible_volumes, pressure, eos) v0 = getparam(eos).v0 filtered = if pressure >= zero(pressure) # If pressure is greater than zero, - filter(<(v0), possible_volumes) # the volume could only be smaller than `v0`. + filter(<=(v0), possible_volumes) # the volume could only be smaller than `v0`. else - filter(>(v0), possible_volumes) + filter(v -> 1 < v / v0 <= 3, possible_volumes) end return only(filtered) end From 1299e809ade9a5f075577db5eee2c6c775f9a5b4 Mon Sep 17 00:00:00 2001 From: Reno <25192197+singularitti@users.noreply.github.com> Date: Mon, 17 Jan 2022 16:29:36 -0500 Subject: [PATCH 2/2] Deprecate `_interactive_choose` --- src/EquationOfStateWorkflow/actions.jl | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/EquationOfStateWorkflow/actions.jl b/src/EquationOfStateWorkflow/actions.jl index 88873c2..b68983a 100644 --- a/src/EquationOfStateWorkflow/actions.jl +++ b/src/EquationOfStateWorkflow/actions.jl @@ -72,10 +72,3 @@ function _choose(possible_volumes, pressure, eos) end return only(filtered) end - -function _interactive_choose(volumes) - options = string.(volumes) - menu = RadioMenu(options) - choice = request("Choose the desired volume:", menu) - choice == -1 ? throw(InterruptException()) : volumes[choice] -end