Revise.jl doesn't appear to do anything

It adds the package at the path to your environment. Since you were following the Revise documentation on how to work with deved packages, it seemed that this was what you were trying to do.

It seems what you are trying to do is rather non-standard. Not sure how well the usual tooling works for this.

My current structure follows this example

my_package_repo
└── MyFirstPackage
    ├── Project.toml
    └── src
        ├── MyFirstPackage.jl
        ├── types.jl
        ├── mainalgorithm.jl
        ├── FileFormatA
        │   ├── FileFormatA.jl
        │   ├── reader.jl
        │   └── writer.jl
        ├── FileFormatB
        │   ├── FileFormatB.jl
        │   ├── reader.jl
        │   └── writer.jl
        └── display.jl

from this post.

I don’t know… If I’m going to have a separate package for every file, I’m either going to have some very long files, or a lot of packages.

Like, the thing that I am explicitly trying to do right now is to change my structure into something more standard.

Hm, what is the name of your package? VCLR? What about CRL? Is it a separate package or is it contained in VCLR?

CLR is an existing algorithm, and VCLR is a modified version of that algorithm. I have an implementation of both that differ only in what happens inside the branch-and-bound nodes, and the implementations share the branch-and-bound part of the algorithm.

Are you coming from python? You might be over-using separate modules. You can have code that reads in two different file formats in the same module.

On the other hand, if they are entirely separate implementations, then yes I would suggest having them be separate folders entirely.

No, I come from Rust. The CLR and VCLR folders are entirely separate. The code that they both use is in the Shared folder.

Let me just post my structure again, since it got far up:

/home/alice/src/VoronoiCLR
├── data
│   └── ...
├── Manifest.toml
├── Project.toml
├── README.md
├── src
│   ├── CLR
│   │   ├── CLR.jl
│   │   ├── ...
│   ├── delaunay.jl
│   ├── Generators
│   │   ├── Generators.jl
│   │   └── ...
│   ├── Loaders
│   │   ├── Loaders.jl
│   │   └── ...
│   ├── Shared
│   │   ├── Shared.jl
│   │   └── ...
│   ├── VCLR
│   │   ├── VCLR.jl
│   │   └── ...
│   └── VoronoiCLR.jl

I mean, in principle I could split it into a bunch of separate packages, but it seems somewhat unnatural — those pieces are just implementation details.

1 Like

If they are implementation details, they don’t necessarily need to live in separate packages, certainly not with their own Project.toml files.

If the user is going to have CLR and VCLR in the same environment anyways, then it’s an unnecessary complication to have them as separate packages entirely, rather than sub-modules in the same larger repo.

1 Like

This looks good. You can just fire up julia, do dev /home/alice/src/VoronoiCLR and then using Revise, VoronoiCLR will load your package and track local changes.

(I would not have done it any other way.)

So the dev command is just to an alternative to using cd to navigate into the right directory and calling julia --project?

Assuming I have a single package.

Kind of. As mentioned above you probably shouldn’t have each of these sub-modules as their own project. Just have one top-level Project.toml for VoronoiCLR.

I have only a single Project.toml, namely the one you see in the tree I posted. The folders are accessible becaues the /home/alice/src/VoronoiCLR/src/VoronoiCLR.jl file contains this:

include("Shared/Shared.jl")
include("delaunay.jl")
include("CLR/CLR.jl")
include("VCLR/VCLR.jl")

include("Loaders/Loaders.jl")
include("Generators/Generators.jl")

Those files have additional include statements for other files in the same folder.

1 Like

Okay. This is slightly beyond my skills at this point.

I am not 100% sure the limits of Revise with respect to including sub-modules in that way. Hopefully someone with more expertise can chime in. In general, you don’t need to use modules that much, and using more than one module per package can complicate things. But it’s not impossible and I will defer to someone who knows more than me.

Am I supposed to be including the other files in my project in some other manner than with an include(...) statement?

Revise.jl appears to work just fine in the sub-modules.

1 Like

I think you are doing everything right. I personally don’t do it the julia --project= way. I just do the dev, then it is in my standard environment and I can do the short and sweet using Revise, VoronoiCLR after starting julia.

If Revise is working, then I think you should be all set.

Your folder structure is unusual, and could maybe be “flatter” with more things split out into separate folders and relying on one another via dev, but if things are working at this point that’s good.

1 Like

That will cause compatability issues. See the initial discussion in this thread.

I find it pretty surprising that making use of sub-modules at all is considered unusual, but ok. Splitting my submodules into separate packages doesn’t seem like it makes my life easier, so I’ll keep this setup.

Thanks everyone! I think all my confusions have been addressed now.

1 Like