FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit 45d43eb7 authored by L. Bower's avatar L. Bower
Browse files

moving met-resampling to a seperate git repo

parent 4264225a
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
......@@ -5,11 +5,11 @@ proc_path="$(dirname "$(readlink -f "$0")")"
source "${proc_path}"/run_utils.sh
setup_conda_env
setup_virtual_env
python "${proc_path}"/../coordinator/ProcessorAdvisory.py "$@"
exit_code=$?
teardown_conda_env
teardown_virtual_env
exit $exit_code
......@@ -5,13 +5,13 @@ proc_path="$(dirname "$(readlink -f "$0")")"
source "${proc_path}"/run_utils.sh
setup_conda_env
setup_virtual_env
echo "Running ProcessorDeposition.py with path: "
pwd;
python "${proc_path}"/../coordinator/ProcessorDeposition.py "$@"
exit_code=$?
teardown_conda_env
teardown_virtual_env
exit $exit_code
......@@ -5,11 +5,11 @@ proc_path="$(dirname "$(readlink -f "$0")")"
source "${proc_path}"/run_utils.sh
setup_conda_env
setup_virtual_env
python "${proc_path}"/../coordinator/ProcessorEnvironment.py "$@"
exit_code=$?
teardown_conda_env
teardown_virtual_env
exit $exit_code
......@@ -5,11 +5,11 @@ proc_path="$(dirname "$(readlink -f "$0")")"
source "${proc_path}"/run_utils.sh
setup_conda_env
setup_virtual_env
python "${proc_path}"/../coordinator/ProcessorEpidemiology.py "$@"
exit_code=$?
teardown_conda_env
teardown_virtual_env
exit $exit_code
#!/bin/bash
# get path of this script (to point to files within the same git repo)
proc_path="$(dirname "$(readlink -f "$0")")"
source "${proc_path}"/run_utils.sh
setup_conda_env
python "${proc_path}"/../coordinator/extra/ProcessorMetResample.py "$@"
exit_code=$?
teardown_conda_env
exit $exit_code
##!/bin/bash
#
## get path of this script (to point to files within the same git repo)
#proc_path="$(dirname "$(readlink -f "$0")")"
#
#source "${proc_path}"/run_utils.sh
#
#setup_virtual_env
#
#python "${proc_path}"/../coordinator/extra/ProcessorMetResample.py "$@"
#exit_code=$?
#
#teardown_virtual_env
#
#exit $exit_code
#!/bin/bash
original_args=("$@")
SHORT=p:h
OPTS=$(getopt -a --options $SHORT -- "$@")
echo $OPTS
eval set -- "$OPTS"
while :
do
case "$1" in
-p )
component="$2"
shift 2
;;
-h | --help)
"Runs the appropriate Processor component using the -p flag, all other args are passed through"
exit 2
;;
--)
shift;
break
;;
*)
echo "Unexpected option: $1"
;;
esac
done
printf "component is %s" "$component"
if [ "$component" = "Environment" ]; then
processor_class="ProcessorEnvironment.py"
elif [ "$component" = "Deposition" ];then
processor_class="ProcessorDeposition.py"
elif [ "$component" = "Survey" ];then
processor_class="ProcessorSurveys.py"
elif [ "$component" = "Advisory" ];then
processor_class="ProcessorAdvisory.py"
elif [ "$component" = "Scraper" ];then
processor_class="ProcessorScraper.py"
elif [ "$component" = "Epidemiology" ];then
processor_class="ProcessorEpidemiology.py"
else
printf "component '%s' not recognised" "$component"
fi
# directory containing all environment
envs=/storage/app/EWS_prod/envs
# directory containing all custom python packages
bin=/storage/app/EWS_prod/code/
# provide custom python packages so they can be imported
flagdir=${bin}/flagdir/
epimodel=${bin}/epimodel/
advisory=${bin}/advisory_builder/
met_processing=${bin}/met_extractor_v2/
met_processor=${bin}/environmental_suitability/
plotting=${bin}/plotting/
post_processing=${bin}/post_processing/
source_gen=${bin}/source_gen/
export PYTHONPATH=$PYTHONPATH:$flagdir:$epimodel:$advisory:$met_processing:$met_processor:$plotting:$source_gen:$post_processing
# provide path to email credentials for logging
export EMAIL_CRED=${envs}/credentials/Cred_gmail.json
# activate conda environment of python modules so they can be imported
#TODO: Move conda_env from bin to envs
conda_env=${envs}/conda/py3EWS
source /storage/app/miniconda3/bin/activate ${conda_env}
# get path of this script (to point to files within the same git repo)
proc_path="$( dirname "$(readlink -f "$0" )" )"
# run the processor with all arguments
processor=${proc_path}/../coordinator/${processor_class}
printf "processor is %s\n\n" "$processor"
python "${processor}" "${original_args[@]}"
exit_code=$?;
# deactivate conda environment
source /storage/app/miniconda3/bin/deactivate ${conda_env}
exit $exit_code;
#REDUNDANT NOW WE CALL PROCESSOR-SPECIFIC SCRIPTS TO RUN PROCESSORS
##!/bin/bash
#
#original_args=("$@")
#
#SHORT=p:h
#OPTS=$(getopt -a --options $SHORT -- "$@")
#echo $OPTS
#eval set -- "$OPTS"
#
#while :
#do
# case "$1" in
# -p )
# component="$2"
# shift 2
# ;;
# -h | --help)
# "Runs the appropriate Processor component using the -p flag, all other args are passed through"
# exit 2
# ;;
# --)
# shift;
# break
# ;;
# *)
# echo "Unexpected option: $1"
# ;;
# esac
#done
#
#printf "component is %s" "$component"
#
#if [ "$component" = "Environment" ]; then
# processor_class="ProcessorEnvironment.py"
#elif [ "$component" = "Deposition" ];then
# processor_class="ProcessorDeposition.py"
#elif [ "$component" = "Survey" ];then
# processor_class="ProcessorSurveys.py"
#elif [ "$component" = "Advisory" ];then
# processor_class="ProcessorAdvisory.py"
#elif [ "$component" = "Scraper" ];then
# processor_class="ProcessorScraper.py"
#elif [ "$component" = "Epidemiology" ];then
# processor_class="ProcessorEpidemiology.py"
#else
# printf "component '%s' not recognised" "$component"
#fi
#
#
## directory containing all environment
#envs=/storage/app/EWS_prod/envs
#
## directory containing all custom python packages
#bin=/storage/app/EWS_prod/code/
#
## provide custom python packages so they can be imported
#flagdir=${bin}/flagdir/
#epimodel=${bin}/epimodel/
#advisory=${bin}/advisory_builder/
#met_processing=${bin}/met_extractor_v2/
#met_processor=${bin}/environmental_suitability/
#plotting=${bin}/plotting/
#post_processing=${bin}/post_processing/
#source_gen=${bin}/source_gen/
#
#export PYTHONPATH=$PYTHONPATH:$flagdir:$epimodel:$advisory:$met_processing:$met_processor:$plotting:$source_gen:$post_processing
#
## provide path to email credentials for logging
#
#export EMAIL_CRED=${envs}/credentials/Cred_gmail.json
#
## activate conda environment of python modules so they can be imported
##TODO: Move conda_env from bin to envs
#conda_env=${envs}/conda/py3EWS
#source /storage/app/miniconda3/bin/activate ${conda_env}
#
## get path of this script (to point to files within the same git repo)
#proc_path="$( dirname "$(readlink -f "$0" )" )"
#
## run the processor with all arguments
#processor=${proc_path}/../coordinator/${processor_class}
#printf "processor is %s\n\n" "$processor"
#python "${processor}" "${original_args[@]}"
#exit_code=$?;
#
## deactivate conda environment
#source /storage/app/miniconda3/bin/deactivate ${conda_env}
#
#exit $exit_code;
......@@ -5,11 +5,11 @@ proc_path="$(dirname "$(readlink -f "$0")")"
source "${proc_path}"/run_utils.sh
setup_conda_env
setup_virtual_env
python "${proc_path}"/../coordinator/ProcessorScraper.py "$@"
exit_code=$?
teardown_conda_env
teardown_virtual_env
exit $exit_code
......@@ -5,11 +5,11 @@ proc_path="$(dirname "$(readlink -f "$0")")"
source "${proc_path}"/run_utils.sh
setup_conda_env
setup_virtual_env
python "${proc_path}"/../coordinator/ProcessorSurveys.py "$@"
exit_code=$?
teardown_conda_env
teardown_virtual_env
exit $exit_code
#!/bin/bash
function setup_conda_env() {
function setup_virtual_env() {
# directory containing all environment
envs=/storage/app/EWS_prod/envs
......@@ -30,9 +30,8 @@ function setup_conda_env() {
source ${venv}/ews_prod/bin/activate;
}
function teardown_conda_env() {
function teardown_virtual_env() {
# deactivate conda environment
deactivate;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment