Skip to content

Commit

Permalink
add docker_climatearray2rds.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
IshikaKhandelwal committed Feb 27, 2025
1 parent 2d6a069 commit b1931ca
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
19 changes: 19 additions & 0 deletions docker_climatearray2rds.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
source run_container.sh

# Check for required arguments
if [ $# -lt 2 ]; then
echo "Usage: $0 <input_directory> <output_directory> <extra-args>"
exit 1
fi

# Convert relative paths to absolute paths
INPUT_DIR=$(realpath "$1")
OUT_DIR=$(realpath "$2")

shift 2

# Run the container with mounted directories
run_with_mounts "$INPUT_DIR" "$OUT_DIR" \
climatearray2rds -i /home/biodiversity-horizons/data-raw \
-o /home/biodiversity-horizons/outputs "$@"
16 changes: 0 additions & 16 deletions scripts/main.R
Original file line number Diff line number Diff line change
Expand Up @@ -196,22 +196,6 @@ run_climatearray2rds <- function(args) {
print("File converted successfully!")
}

safe_parse_opts <- function(opt_parser, args) {
# Function to safely parse the options. Shows the help if there's an error.
opt <- tryCatch(
{
opt <- parse_args(opt_parser, args = args)
opt
},
error = function(e) {
cat("Error parsing arguments:", e$message, "\n")
opt <- parse_args(opt_parser, args = c("--help"))
FALSE
}
)
return(opt)
}

run_exposure <- function(args) {
source("scripts/exposure_workflow.R")
option_list <- list(
Expand Down

0 comments on commit b1931ca

Please sign in to comment.