From 8f08b1eff0ec42c071f6f3427820fc77b0c3e9a4 Mon Sep 17 00:00:00 2001 From: Jonathan Doucette Date: Thu, 3 Mar 2022 11:36:56 -0800 Subject: [PATCH] update external api for DECAES v0.4.3 --- api/decaes.m | 2 +- api/decaes.py | 25 +++++++++++++++++++++++-- api/decaes.sh | 6 ++++-- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/api/decaes.m b/api/decaes.m index 071fa40..c931326 100644 --- a/api/decaes.m +++ b/api/decaes.m @@ -92,7 +92,7 @@ % % Note the separation of the Matlab-specific flags from the DECAES settings file. % -% This version of decaes.m was written for DECAES v0.4.2. +% This version of decaes.m was written for DECAES v0.4.3. % DECAES was written by Jonathan Doucette (jdoucette@physics.ubc.ca). % Original MATLAB implementation is by Thomas Prasloski (tprasloski@gmail.com). diff --git a/api/decaes.py b/api/decaes.py index 089dc28..49fed36 100644 --- a/api/decaes.py +++ b/api/decaes.py @@ -1,3 +1,24 @@ +""" +Load the DECAES.jl Julia package from python. +DECAES.jl will be installed automatically, if necessary. + +This module requires the julia Python package to be installed. +See the following documentation for instructions: + + https://github.com/JuliaPy/pyjulia#quick-usage + +Quick usage: + + import decaes + decaes.initialize() + from decaes import DECAES + + # Call methods from the DECAES module as usual, e.g. + DECAES.T2mapSEcorr(image; kwargs...) + +This version of decaes.py was written for DECAES v0.4.3. +""" + import julia import os import subprocess @@ -39,13 +60,13 @@ def install( # Install DECAES.jl decaes_install_script = """try @info "Trying to import DECAES..." - import DECAES + @eval import DECAES catch e @error "`import DECAES` failed" exception=(e, catch_backtrace()) @info "Installing DECAES..." import Pkg Pkg.add("DECAES") - import DECAES + @eval import DECAES end """.replace(" ", "") diff --git a/api/decaes.sh b/api/decaes.sh index 58176dc..33df987 100755 --- a/api/decaes.sh +++ b/api/decaes.sh @@ -16,10 +16,12 @@ parser = argparse.ArgumentParser( Example: - Start Julia with 8 threads and run DECAES using parameters specified by the + Start Julia with multiple threads and run DECAES using parameters specified by the settings file 'decaes_settings_file.txt': - python decaes.py --threads=8 @/path/to/decaes_settings_file.txt + python decaes.py @/path/to/decaes_settings_file.txt + + This version of decaes.sh was written for DECAES v0.4.3. """, formatter_class = argparse.RawDescriptionHelpFormatter, )