Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function visibility when loading package #2

Open
evanmunro opened this issue May 9, 2023 · 1 comment
Open

Function visibility when loading package #2

evanmunro opened this issue May 9, 2023 · 1 comment

Comments

@evanmunro
Copy link

Thanks for the great Julia package on Deferred Acceptance. I've been using it by cloning the Github and loading the module locally using include. When I install the package from the package manager and load the functions using "using DeferredAcceptance" for some reason in my version of Julia (1.7), the functions are not imported. However, I don't see anything wrong with the package structure.

See for example:

Screen Shot 2023-05-09 at 10 43 06 AM

@maxkapur
Copy link
Owner

Hmm, my first thought is to ask for your include statement, but if something went wrong there, then you should have hit an error at using DeferredAcceptance. Are you sure you haven't modified the source at all after cloning?

Generally, if you want to work on a package that exists on your local directory, the best way to do it is with Pkg.develop. Here, I clone the git repo to a folder in my home directory:

~> git clone "https://github.com/maxkapur/DeferredAcceptance.jl"
Cloning into 'DeferredAcceptance.jl'...

Next, enter the Julia REPL, enter package mode (type ]), activate a temporary environment, and develop DeferredAcceptance.jl by passing the path to the cloned repo on your local filesystem:

(@v1.8) pkg> activate --temp
  Activating new project at `/tmp/jl_0nrsEg`

(jl_0nrsEg) pkg> develop "~/DeferredAcceptance.jl/"
   Resolving package versions...
   Installed GPUArraysCore ──────── v0.1.3
   ...

(I used a temporary environment because DeferredAcceptance.jl hasn't been updated in a long time and if I try to add it to my global environment, it causes all my other Julia packages to downgrade themselves.)

Now, exit package mode (press backspace) and go back to the REPL. Everything appears to work.

julia> using DeferredAcceptance
[ Info: Precompiling DeferredAcceptance [7ba42312-65e6-11eb-2a40-f37f14131e13]

julia> deferredacceptance([1 1 2; 2 2 1], [1 1; 2 3; 3 2], [2, 1])
([1, 1, 2], [1, 1, 1])

If you don't want the latest version from Github, you can also just add the package by name using ]add DeferredAcceptance since it is in the Julia registry.

Does this help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants