Skip to content

Commit

Permalink
Merge pull request #46 from daschw/addon-module
Browse files Browse the repository at this point in the history
fix: correctly check if addon module is loaded
  • Loading branch information
sstroemer authored Dec 19, 2024
2 parents 1eeafab + 3dfce58 commit 862c345
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/general.jl
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ function _getfile(model::JuMP.Model, filename::String; path::Symbol=:auto, sink=
# Before checking the file, let's see if it refers to an already loaded module instead.
# This requires you to pass the EXACT name of the module as addon name!
module_name = Symbol(basename(filename)[1:(end - 3)])
if (module_name in names(Main; all=true))
if isdefined(Main, module_name)
@debug "Addon already loaded in global Main" addon = module_name
if @config(model, general.performance.force_addon_reload, Bool)
@warn "Cannot force reload an addon that is already loaded in Main, outside IESopt; ignoring reload, and re-using the existing module" module_name
Expand Down

0 comments on commit 862c345

Please sign in to comment.