I'm having some trouble figuring out the proper way to organize a project 
in Julia. I understand how a *package* is organized (from the many 
available examples), but now I am writing code that uses various packages 
(my own and others) and I don't feel like I have a good idea on how a 
*project* should be organized.

Let's say I have a project called Major Calculations that uses the packages 
Foo.jl, Bar.jl, and Important.jl.

1. Should I use Pkg.generate() to create Major Calculations? In other 
words, should it be a package (in the julia sense)? It isn't going to be a 
library of types and methods, but rather a project where I give it large 
amounts of data and it outputs modified data and plots.

2. Should I break down Major Calculations into separate modules? For 
example, there are groups of functions that are related. Should each of 
these get their own module?

3. What should the directory layout of Major Calculations be? Should I have 
a main.jl? What if I want to process the data in steps (e.g., first.jl, 
second.jl, ...).

4. When I use the project, I want to pass it two files: a configuration 
file, and the data file. The configuration file will define a bunch of 
constants that are used throughout Major Calculations (i.e., it is 
required). Should these be declared as global consts? If that's the case, 
should I have a file (e.g., constants.jl) that I include at the start of 
main.jl that reads the file and just sets all constants? And should this be 
completely in the global scope?

5. If the two modules Foo and Bar both export functions with the same name 
(but different parameters), how do I avoid conflicts? Should the project 
use "import" instead of "using"?

In essence, I am just having a hard time differentiating how code is 
organized when it is a package for general usage, compared to how it 
organized when it is a project used to process data. 

Thanks for your time. 

Reply via email to