I want to write a module in the local directory, load it into Jupyter and test it.
I put the module into file MyModule.jl
:
module MyModule
export my_function
my_function() = ()
end
Then I load it in JupyterLab:
include("MyModule.jl")
using .MyModule
my_function()
This works fine with a fresh Julia kernel, but if I execute the cell the second time, I will get two warnings:
WARNING: replacing module MyModule.
WARNING: using MyModule.my_function in module Main conflicts with an existing identifier.
In principle, I can get rid of the second warning by switching from using
to import
, so to write MyModule.my_function()
, but the first warning is always there.
I have tried adding using Revise
, but it does nothing.