DEEPDIP-project / CoupledNODE.jl

Apache License 2.0
2 stars 0 forks source link

Import statements #19

Closed luisaforozco closed 3 months ago

luisaforozco commented 3 months ago

Context: current situation

In the examples we are importing the dependencies via using and include. Also, the julia files in examples/coupling_functions rely on importing the dependencies from the notebooks.

Desired situation

We should make the dependencies link clearer by using:

# insted of
using LinearAlgebra
# use:
import LinearAlgebra: dot
import MyModule.myfunction as func

And in the examples, importing near to the first usage so that it becomes clearer why did we import a dependency.

luisaforozco commented 3 months ago

I've been exploring the different uses of using and import.

APJansen commented 3 months ago

I agree, I prefer import for clarity. This will clash with multiple dispatch as we discussed last week, but I would say we can solve that by only changing those cases where it's an issue to using.

The SciML style guide seems to have this preference as well, although it's not super clear. They also prefer using LinearAlgebra: dot over using LinearAlgebra, that's apparently also an option to make clear what you're using from where.