Doubt in using the Reexport.jl command

I have a model and I would like to use it in two environments, one for the code base and the other for exporting and expanding the methods.
But I don’t know how to use the command. Can anybody help me?
Thanks :smiley:

You just write

using Reexport

@reexport using MyModelCode

and then you have access to everything MyModelCode exports.

1 Like
using Reexport
@reexport using ModelD
ArgumentError: Package ModelD not found in current path:
- Run `import Pkg; Pkg.add ("ModelD") `to install the ModelD package.

ERROR: The following package names could not be resolved:
  * ModelD (not found in project, manifest or registry)

I can’t use the command, although ModelD is not a package, even so I tried to add it and it didn’t work.

You need to make sure your package “knows about” ModelD, so you should first run ] dev path/to/ModelD/, or better yet, host the code for ModelD on github and ] add the URL.

I followed your instructions and unfortunately it didn’t work. I don’t know if I’m doing something wrong, I created a new project called Testando.jl and there I did

using Reexport
@reexport using ModelD

(@ JuliaPro_v1.5.2-1) pkg> add
     Cloning git-repo `https: // / Raqueldcs / Raquel / blob / main / ModelD.jl`
ERROR: failed to clone from, error: GitError (Code: ERROR, Class: Net, request failed with status code: 404)

You need to add the Repo url, which needs to be in the “standard” package file structure.

It’s a lot to keep in mind when organizing your code. I recommend reading the docs fully here and following the instructions very carefully.

1 Like