Skip to content

Commit

Permalink
Reduce sigdigits in parameter range display #948
Browse files Browse the repository at this point in the history
This commit addresses issue #948 by updating the display of parameter ranges to include reduced significant digits.
  • Loading branch information
adarshpalaskar1 committed Jan 31, 2024
1 parent e924a77 commit 8630c19
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/hyperparam/one_dimensional_ranges.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ end
# case that `r.scale` is not a symbol, and returning "?" if applying the transformation
# throws an exception:
function _repr(r::NumericRange{T}, field) where T
value = round(getproperty(r, field), sigdigits=4)
value = getproperty(r, field)
if !(typeof(value) <: Integer)
value = round(value, sigdigits=4)
end
r.scale isa Symbol && return repr(value)
return try
scaled = (r.scale)(value)
Expand Down

0 comments on commit 8630c19

Please sign in to comment.