Skip to content

Commit

Permalink
more import fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Pepijn de Vos committed Nov 6, 2023
1 parent b368879 commit f1494b8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/ensemble/basic_ensemble_solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,19 @@ function __solve(prob::AbstractEnsembleProblem,
ensemblealg::BasicEnsembleAlgorithm;
trajectories, batch_size = trajectories, progress_aggregate=true,
pmap_batch_size = batch_size ÷ 100 > 0 ? batch_size ÷ 100 : 1, kwargs...)
logger = progress_aggregate ? AggregateLogger(current_logger()) : current_logger()
logger = progress_aggregate ? AggregateLogger(Logging.current_logger()) : Logging.current_logger()

Check warning on line 122 in src/ensemble/basic_ensemble_solve.jl

View check run for this annotation

Codecov / codecov/patch

src/ensemble/basic_ensemble_solve.jl#L122

Added line #L122 was not covered by tests

with_logger(logger) do
Logging.with_logger(logger) do
num_batches = trajectories ÷ batch_size
num_batches < 1 &&

Check warning on line 126 in src/ensemble/basic_ensemble_solve.jl

View check run for this annotation

Codecov / codecov/patch

src/ensemble/basic_ensemble_solve.jl#L124-L126

Added lines #L124 - L126 were not covered by tests
error("trajectories ÷ batch_size cannot be less than 1, got $num_batches")
num_batches * batch_size != trajectories && (num_batches += 1)

Check warning on line 128 in src/ensemble/basic_ensemble_solve.jl

View check run for this annotation

Codecov / codecov/patch

src/ensemble/basic_ensemble_solve.jl#L128

Added line #L128 was not covered by tests

ChainRulesCore.@ignore_derivatives if get(kwargs, :progress, false)
if get(kwargs, :progress, false)
name = get(kwargs, :progress_name, "Ensemble")
for i in 1:trajectories
Logging.@logmsg(LogLevel(-1), "$name #$i", _id=Symbol("SciMLBase_$i"), progress=0)
msg = "$name #$i"
Logging.@logmsg(LogLevel(-1), msg, _id=Symbol("SciMLBase_$i"), progress=0)
end

Check warning on line 135 in src/ensemble/basic_ensemble_solve.jl

View check run for this annotation

Codecov / codecov/patch

src/ensemble/basic_ensemble_solve.jl#L130-L135

Added lines #L130 - L135 were not covered by tests
end

Expand Down

0 comments on commit f1494b8

Please sign in to comment.