Skip to content

Commit

Permalink
Fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
theHenks committed Oct 6, 2024
1 parent 155228a commit 74bcf77
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 0 additions & 4 deletions src/LegendSpecFits.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,10 @@ using ForwardDiff
using IntervalSets
using InverseFunctions
using IrrationalConstants
using LineSearches
using LinearRegression
using LineSearches
using LsqFit
using Measurements
using Measurements: value as mvalue
using Measurements: uncertainty as muncert
using Optim
using Optimization
using OptimizationBBO
using OptimizationNLopt
Expand Down
6 changes: 3 additions & 3 deletions src/memory_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@ function advanced_time_and_memory_control( ; start_time::Float64=time(), start_m
if mem_limit < 0
mem_limit = optim_max_mem
end
function callback(x::Optim.OptimizationState)
function callback(x::Optimization.OptimizationState)

Check warning on line 44 in src/memory_utils.jl

View check run for this annotation

Codecov / codecov/patch

src/memory_utils.jl#L44

Added line #L44 was not covered by tests
# @debug " * Iteration: $(x.iteration)"
so_far = time() - start_time
# @debug " * Time so far: $so_far"
if x.iteration == 0
if x.iter == 0

Check warning on line 48 in src/memory_utils.jl

View check run for this annotation

Codecov / codecov/patch

src/memory_utils.jl#L48

Added line #L48 was not covered by tests
time_to_setup .= time() - start_time
return false
elseif Sys.maxrss()/2^30 - start_mem > mem_limit
@warn " * Memory limit reached"
return true
else
expected_next_time = so_far + (time() - start_time - time_to_setup[1])/(x.iteration)
expected_next_time = so_far + (time() - start_time - time_to_setup[1])/(x.iter)

Check warning on line 55 in src/memory_utils.jl

View check run for this annotation

Codecov / codecov/patch

src/memory_utils.jl#L55

Added line #L55 was not covered by tests
# @debug " * Next iteration ≈ $expected_next_time"
# @debug " * Time limit: $time_limit"
# @debug " * Start limit: $start_time"
Expand Down

0 comments on commit 74bcf77

Please sign in to comment.