Skip to content

conda package working #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CondaPkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[deps]
wfdb = ""
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ authors = ["Yzh <[email protected]> and contributors"]
version = "0.1.0"

[deps]
JuliaPythonAdaptor = "0e307d70-50ba-423d-98c4-b9d407ed9420"
PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d"

[compat]
Expand Down
1 change: 1 addition & 0 deletions deploy/compile_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ julia -e 'using Pkg; Pkg.add("PackageCompiler")'
julia --project=@. --startup-file=no -e 'using Pkg; Pkg.instantiate()'

julia --project=@. --startup-file=no -e '
ENV["JP_ADAPTOR_PY_EXE"] = "C:\\_KTAuto\\backend\\conda\\3\\python.exe";
using PackageCompiler;
PackageCompiler.create_app(pwd(), "PythonCallCompiled";
cpu_target="generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)",
Expand Down
5 changes: 5 additions & 0 deletions deploy/test_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
julia --project=@. --startup-file=no -e '
ENV["JP_ADAPTOR_PY_EXE"] = "C:\\_KTAuto\\backend\\conda\\3\\python.exe";
using PythonCall_tst
py_test()
'
1 change: 1 addition & 0 deletions deps/build.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

19 changes: 19 additions & 0 deletions src/PythonCall_tst.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
module PythonCall_tst

import JuliaPythonAdaptor
using PythonCall


const WFDB = PythonCall.pynew() # initially NULL
function __init__()
PythonCall.pycopy!(WFDB, pyimport("wfdb"))
end
export WFDB

function read_ann(file::String)
record, ext = splitext(file)
ann = WFDB.rdann(record, ext[2:end])
pos = PythonCall.pyconvert(Vector{Int}, ann.sample)
anntype = PythonCall.pyconvert(Vector{Symbol}, ann.symbol)
fs = PythonCall.pyconvert(Float64, ann.fs)

return ann, pos, anntype, fs
end


# some orfinary func from library docs
function py_test(;file::String = "this/is/demonstration/function")
re = pyimport("re")
Expand Down