Skip to content
Snippets Groups Projects
Commit 533b0815 authored by François  LAURENT's avatar François LAURENT
Browse files

basic Python-Julia communication

parent f3a29d60
Branches
Tags
No related merge requests found
Pipeline #77959 passed
name: CompatHelper
on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:
jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
run: julia -e 'using CompatHelper; CompatHelper.main()'
name: TagBot
on:
issue_comment:
types:
- created
workflow_dispatch:
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
runs-on: ubuntu-latest
steps:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
ssh: ${{ secrets.DOCUMENTER_KEY }}
......@@ -16,11 +16,10 @@
c, t = get_summary(process_folder())
using Printf
@printf "Test coverage %.2f%%\n" 100c / t'
Julia 1.0:
image: julia:1.0
Julia 1.6:
image: julia:1.6
extends:
- .script
- .coverage
Julia 1.7:
image: julia:1.7
extends:
......
[chore_sample_output]
git-tree-sha1 = "21f352668bf80009c68c3487fb464df477dc2b7a"
lazy = true
[[chore_sample_output.download]]
url = "https://gitlab.pasteur.fr/nyx/artefacts/-/raw/master/PlanarLarvae/chore_sample_output.tar.gz?inline=false"
sha256 = "56845fa23cf53a58df33f6a4daf48e0a031f3c7e920f9badd62ae07f350b62d8"
[sample_trxmat_file]
git-tree-sha1 = "e131dc0168d075ba884f26435f626cdfd6b13365"
lazy = true
[[sample_trxmat_file.download]]
url = "http://dl.pasteur.fr/fop/wGF4Ypgs/trx.mat.tgz"
sha256 = "4cf2656c7917c623d668382c93d21ce3ef7da67255ee0efd596f7e0b40a84947"
......@@ -3,8 +3,12 @@ uuid = "e551f703-3b82-4335-b341-d497b48d519b"
authors = ["François Laurent", "Institut Pasteur"]
version = "0.1.0"
[deps]
LazyArtifacts = "4af54fe1-eca0-43a8-85a7-787d91b784e3"
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
[compat]
julia = "1"
julia = "1.6"
[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
......
[tool.poetry]
name = "TaggingBackends"
version = "0.1.0"
description = ""
authors = ["François Laurent <francois.laurent@pasteur.fr>"]
[tool.poetry.dependencies]
python = "^3.8"
julia = "^0.5.7"
[tool.poetry.dev-dependencies]
pytest = "^5.2"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
__version__ = '0.1.0'
using LazyArtifacts
function make_test_data(target="chore_sample_outline")
# we want `targets` to be mutable
isstr = target isa String
if isstr
targets = [target]
else
# copy
targets = Vector{String}(target)
end
for t in 1:length(targets)
target = targets[t]
dir = nothing
# call the `artifact` string macro
if startswith(target, "chore_sample_")
artefact = artifact"chore_sample_output"
dir = "chore_sample_output"
filetype = target[length("chore_sample_")+1:end]
if filetype ("outline", "spine")
throw(DomainError("unknown Chore output: " * filetype))
end
filename = "20150701_105504@FCF_attP2_1500062@UAS_Chrimson_Venus_X_0070@t15@r_LED50_30s2x15s30s#n#n#n@100." * filetype
elseif target == "sample_trxmat_file"
artefact = artifact"sample_trxmat_file"
filename = "trx.mat"
else
throw(DomainError("unknown artefact: " * target))
end
# return path to individual file instead
if isnothing(dir)
path = joinpath(artefact, filename)
else
path = joinpath(artefact, dir, filename)
end
targets[t] = path
end
if isstr
targets = targets[1]
end
return targets
end
from pathlib import Path
project_dir = Path(__file__).parent.parent
import os
os.environ['JULIA_PROJECT'] = str(project_dir)
from julia import Julia
Julia(compiled_modules=False)
from julia import Main
Main.include("test/makedata.jl")
def make_test_data(target="sample_trxmat_file"):
return Main.make_test_data(f"{target}")
import pytest
@pytest.fixture
def sample_trxmat_file():
return make_test_data("sample_trxmat_file")
from taggingbackends import __version__
def test_version():
assert __version__ == '0.1.0'
import os.path
from .makedata import sample_trxmat_file
class TestDataFiles:
"""
Test reading data from files.
"""
def test_get_trxmat_file(self, sample_trxmat_file):
print(sample_trxmat_file)
assert os.path.isfile(sample_trxmat_file)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment