I’m trying to structure my Julia Project but failing to import modules from one dir to another dir. Below is my Project Structure
I’m trying to import Module Maths defined in maths.jl to TestAlgebra.jl, But I’m having no clue. Getting below Error Message.
WARNING: could not import Algebra.Maths into Algebra
Note: I don’t want add include in TestAlgebra.jl as I’ve already added in Algorithms.jl
The contents can be found in this link.
Here is the code peiced together with the
return x>0 ? x : -x
Notice that ive changed
..Maths because its in a parent module
See also the documentation here.
Thanks Graham, for the solution.
Is there a better way or standard Julian way to write Imports.
In Algorithms.jl File, the code doesn’t speaks from where module - Algebra got imported:
include("maths/maths.jl") # Maths Directory
Code maintainence will be an issue if codebase becomes larger. How can I address this ?
For most projects I try not to use sub modules. I divide projects into separate files or even folders, but generally they are usually just all included in one single module. But that’s just me.