DAMMmodel.jl Can't Work

Hi all,

I am trying this Julia package:
https://github.com/CUPofTEAproject/DAMMmodel.jl

After typing `using DAMMmodel’, I get this error:
UndefVarError: DAMMfdata not defined
UndefVarError: DAMMviz not defined

Works OK here:

(@v1.8) pkg> activate @Temp
  Activating project at `~/.julia/environments/Temp`

(@Temp) pkg> add DAMMmodel
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...

# ... a few moments later ...

julia> using DAMMmodel

julia> DAMMfdata(3)
3×3 DataFrame
 Row │ Tₛ       θ        Rₛ       
     │ Float64  Float64  Float64  
─────┼────────────────────────────
   1 │    36.6      0.6  10.2602
   2 │    39.6      0.7   1.5
   3 │     3.6      0.2   2.21687
   
julia>

I didn’t attempt the fancy stuff though…

Hi Freya_the_Goddess,
did you get it to work?
What version do you have, it should be v0.1.18

(@v1.7) pkg> status
  Status `C:\Users\feu__\.julia\environments\v1.7\Project.toml`
  [7af7f183] DAMMmodel v0.1.18

The missing part to make it works:

activate @Temp

I didn’t know it is necessary to create a Temp directory.

It works for DAMMfdata, I need to activate a Temp directory first…
This is my version:

 [7af7f183] DAMMmodel v0.1.18

How to input / create our own DAMMfdata?
Can we use CSV ? I think we can just follow the format of DAMMfdata…
or is it more efficient to change the parameters in the DAMMviz()?

Makie rendering took a very long time. But it is the best they say.

I want to create a visualization / package like this but for Population Differential Equation, simpler than DAMMmodel.jl how to get started to create a package like yours @AlexisRenchon ?

Capture d’écran_2022-07-12_21-48-32

This one took 15 minutes to finally finish:

maybe my RAM of 16 GB is not enough.

activate @Temp just creates a project called “temp” in your “project/environments” folder. It’s useful if you want to try packages out but don’t want to have to deal with possible interactions with all your other packages you’ve installed. So I was able to test DAMMmodel.jl easily for you, and when I change back to my current project I don’t have to think about it again.

1 Like

I created the function DAMMfdata() just to test things easily (it is a function to make fake data quickly). You don’t even need to follow the exact format of DAMMfdata, as long as you have vectors of Float64 data, you can make it work. For example you can load a dataframe using CSV and DataFrames.

As cormullion said, you should not have to use activate @temp, does it work without it now? If not, there may be a conflict with other packages from your environment, I am not sure.

Makie will take a long time the first time, but it will be fast after that. 15 minutes is really long though! it is much faster for me, maybe 1 minute the first time, then 1 second (haven’t tested).

For creating your own package, you should read and follow some tutorials about creating Julia packages, and then feel free to get inspiration from DAMMmodel.jl, all the code is accessible on GitHub. I am happy to help

I always create a new environment for each new project.

mkdir new_project
cd new_project
julia --project="."
]add xxx

You don’t have to, but it makes it possible to use different versions of the same package per project. I often want to use old versions for old projects and new versions for new projects.

1 Like

I try to use another OS and it can’t load DAMMfdata.
But the first OS can use it. Why I have to use activate @Temp to make DAMMmodel works? Is it something wrong with my JULIA’ packages installation? Which packages are at fault for this? How to check it?

Aside from that, I want to create this simple Logistic equation:
https://en.wikipedia.org/wiki/Logistic_function

for modeling population growth, it is only simple 2D graphs, but perhaps can be made into 3D…

What OS do you use? I use Linux Mint.

I recommend reading this to learn how to work with Environments in Julia.

For example, it looks like this:

Your new project directory will now have 2 files, Manifest.toml and Project.toml, like this

You should now see the package by doing ]status, call the package using DAMMmodel, and use its functions, like this

1 Like

If you start julia in the folder of your project like this:

julia --project

then there is no need to activate it separately.

2 Likes

Thanks for this info. A nice shortcut

I am able to do it after activate .

Then I have to close the Julia REPL and then open again so it can works.

My first OS: CAELinux
The second OS: GFreya OS(I created it from Linux From Scratch version 11.0)

Thanks for the step by step tutorial.

@AlexisRenchon
I add DAMMmodel in my newly package, I want to know when I do ‘add DAMMmodel’ is it adding all the dependencies on DAMMmodel that I can use for my package?

/DAMMmodel.jl-master/src/functions/viz/DAMMviz.jl is the file that I can use to edit the function right?

Capture d’écran_2022-07-14_07-26-15

I am not sure that you get all dependencies (like for example Makie) if you just have DAMMmodel is your package module. I don’t think so? You can test it.

The model is in src/functions/maths/DAMM.jl
and src/functions/viz/DAMMviz.jl is a GLMakie interactive plot