Skip to content

Commit

Permalink
move echoing the CLI tool names into a function
Browse files Browse the repository at this point in the history
  • Loading branch information
hollandjg committed Nov 21, 2024
1 parent 52c6519 commit cd3d07f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
25 changes: 9 additions & 16 deletions PythonSetupForIFTPipeline.jl/setup.jl
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
# Instantiate all the dependencies
using Pkg
Pkg.instantiate()

if abspath(PROGRAM_FILE) == @__FILE__
# Initialize the Conda environment
using Conda

# Instantiate all the dependencies
using Pkg
Pkg.instantiate()
# Add the dependencies to the Conda environment
Conda.runconda(Conda.Cmd(["env", "update", "-n", "base", "--file", joinpath(@__DIR__, "environment.yaml")]))

# Initialize the Conda environment
ENV["PYTHON"]=""
Pkg.build("PyCall")

# Add the dependencies to the Conda environment
using Conda
Conda.runconda(Conda.Cmd(["env", "update", "-n", "base", "--file", joinpath(@__DIR__, "environment.yaml")]))

# Rebuild PyCall with the new conda environment
Pkg.build("PyCall")

end
# Build PyCall with the new conda environment
Pkg.build("PyCall")
15 changes: 12 additions & 3 deletions test/test-IFTPipeline.jl-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,18 @@
# - https://stackoverflow.com/a/28085062/24937841 and
# - https://unix.stackexchange.com/a/31712
: "${IFT:=julia --project=`pwd`/../IFTPipeline.jl `pwd`/../IFTPipeline.jl/src/cli.jl}"
echo "IFT=${IFT}"
: "${FSDPROC:=pipx run --spec /workspaces/ice-floe-tracker-workspace/ebseg fsdproc --debug}"
echo "FSDPROC=${FSDPROC}"
: "${COLORIZE:=pipx run --spec `pwd`/../label-colorizer/ colorize }"
echo "COLORIZE=${COLORIZE}"

# Set up debug messages
export JULIA_DEBUG="Main,IFTPipeline,IceFloeTracker"

echo_CLI_tools () {
echo "IFT=${IFT}"
echo "FSDPROC=${FSDPROC}"
echo "COLORIZE=${COLORIZE}"
}

initialize_test_directory () {
DATA_SOURCE=$1
DATA_TARGET=$2
Expand All @@ -43,6 +46,8 @@ initialize_test_directory () {
}

preprocess_lopez () {
echo_CLI_tools

DATA_SOURCE=$1
DATA_TARGET=$2
initialize_test_directory $1 $2
Expand Down Expand Up @@ -86,6 +91,8 @@ preprocess_lopez () {
}

preprocess_buckley () {
echo_CLI_tools

DATA_SOURCE=$1
DATA_TARGET=$2
initialize_test_directory $1 $2
Expand Down Expand Up @@ -117,6 +124,8 @@ preprocess_buckley () {


track () {
echo_CLI_tools

DATA_SOURCES=$@

TEMPDIR=$(mktemp -d -p .)
Expand Down

0 comments on commit cd3d07f

Please sign in to comment.