Skip to content

Commit

Permalink
add build
Browse files Browse the repository at this point in the history
  • Loading branch information
mloubout committed May 31, 2023
1 parent 9a1f9fe commit 0948c8a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ jobs:
- uses: actions/checkout@v2

- uses: julia-actions/setup-julia@latest


- name: Build SlimPlotting
uses: julia-actions/julia-buildpkg@latest

- name: Install dependencies
run: |
/usr/bin/python3 -m pip install matplotlib colorcet
julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Setup README
run: cp README.md docs/src/README.md

Expand Down
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
JLD = "4138dd39-2aa7-5051-a626-17a0bb65d9c8"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee"
SegyIO = "157a0f19-4d44-4de5-a0d0-07e2f0ac4dfa"
Weave = "44d3d7a6-8a23-5bf8-98c5-b353f8df5ec9"

Expand Down
28 changes: 14 additions & 14 deletions src/SlimPlotting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@ using Statistics, ColorSchemes, Reexport
const cc = PyPlot.PyNULL()
scm = Dict()

function __init__()
# import seiscm
scmp = try
PyPlot.pyimport("seiscm")

function tryimport(pkg::String)
pyi = try
PyPlot.pyimport(pkg)
catch e
# Installing and loading
run(Cmd([PyPlot.PyCall.pyprogramname, "-m", "pip", "install", "-U", "--user", "seiscm"]))
PyPlot.pyimport("seiscm")
PyPlot.PyCall.Conda.pip_interop(true)
PyPlot.PyCall.Conda.pip("install", pkg)
PyPlot.pyimport(pkg)
end
return pyi
end

function __init__()
# import seiscm
scmp = tryimport("seiscm")
global scm[:seismic] = scmp.seismic()
global scm[:bwr] = scmp.seismic()
global scm[:phase] = scmp.phase()
global scm[:frequency] = scmp.frequency()
# Import colorcet
try
copy!(cc, PyPlot.pyimport_conda("colorcet", "colorcet"))
catch e
# Not using julia's conda and not installed. Installing and loading
run(Cmd([PyPlot.PyCall.pyprogramname, "-m", "pip", "install", "-U", "--user", "colorcet"]))
copy!(cc, PyPlot.pyimport("colorcet"))
end
copy!(cc, tryimport("colorcet"))
end

export plot_fslice, plot_velocity, plot_simage, plot_sdata, wiggle_plot
Expand Down

0 comments on commit 0948c8a

Please sign in to comment.