Importing local python code directory function in Julia

This is as far as I can get you. Hopefully this is far enough.

julia> cd("MikiFor2to3")

julia> Pkg.activate(".")
  Activating project at `~/Downloads/juliacon2024/raman/MikiFor2to3`

julia> Pkg.add(["CondaPkg", "PythonCall"])
   Resolving package versions...
    Updating `~/Downloads/juliacon2024/raman/MikiFor2to3/Project.toml`
  [992eb4ea] ~ CondaPkg v0.2.22 `~/.julia/dev/CondaPkg` ⇒ v0.2.22
    Updating `~/Downloads/juliacon2024/raman/MikiFor2to3/Manifest.toml`
  [992eb4ea] ~ CondaPkg v0.2.22 `~/.julia/dev/CondaPkg` ⇒ v0.2.22

julia> using CondaPkg

julia> CondaPkg.add(CondaPkg.PkgSpec.(["numpy", "scipy", "h5py", "matplotlib"]))
    CondaPkg Found dependencies: /home/mkitti/Downloads/juliacon2024/raman/MikiFor2to3/CondaPkg.toml
    CondaPkg Found dependencies: /home/mkitti/.julia/packages/PythonCall/S5MOg/CondaPkg.toml
    CondaPkg Dependencies already up to date

julia> using PythonCall

julia> const sys = PythonCall.pyimport("sys")
Python: <module 'sys' (built-in)>

julia> sys.path.append(pwd())
Python: None

julia> const pyfiles = pyimport("pyfiles")

julia> athena_read = pyimport("pyfiles.athena_read")

julia> data = pyfiles.read_data("sane00.prim.01800.athdf", athinput="sane00.athinput")

julia> v2 = copy(PyArray(data.v2));

julia> typeof(v2)
Array{Float64, 3}

julia> size(v2)
(64, 128, 288)

julia> pyimport(".m2c_read_athdata")
...
ERROR: Python: NotImplementedError: `interp2d` has been removed in SciPy 1.14.0.

For legacy code, nearly bug-for-bug compatible replacements are
`RectBivariateSpline` on regular grids, and `bisplrep`/`bisplev` for
scattered 2D data.

In new code, for regular grids use `RegularGridInterpolator` instead.
For scattered data, prefer `LinearNDInterpolator` or
`CloughTocher2DInterpolator`.

For more details see
https://scipy.github.io/devdocs/tutorial/interpolate/interp_transition_guide.html
...
3 Likes