Skip to content

Commit

Permalink
Loading deeplab model using get_teca_assets_root() instead of specify…
Browse files Browse the repository at this point in the history
…ing it directly
  • Loading branch information
elbashandy committed Oct 10, 2020
1 parent a0cbc39 commit 29a5bd9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
3 changes: 0 additions & 3 deletions test/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -375,15 +375,13 @@ teca_add_test(py_test_bayesian_ar_detect_mpi_threads

teca_add_test(py_test_deeplabv3p_ar_detect_serial
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_deeplabv3p_ar_detect.py
"${TECA_ASSETS_ROOT}/cascade_deeplab_IVT.pt"
"${TECA_DATA_ROOT}/ARTMIP_MERRA_2D_2017-05.*\.nc$"
"${TECA_DATA_ROOT}/test_deeplabv3p_ar_detect" IVT 1
FEATURES ${TECA_HAS_NETCDF}
REQ_TECA_DATA REQ_TECA_ASSETS)

teca_add_test(py_test_deeplabv3p_ar_detect_threads
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_deeplabv3p_ar_detect.py
"${TECA_ASSETS_ROOT}/cascade_deeplab_IVT.pt"
"${TECA_DATA_ROOT}/ARTMIP_MERRA_2D_2017-05.*\.nc$"
"${TECA_DATA_ROOT}/test_deeplabv3p_ar_detect" IVT -1
FEATURES ${TECA_HAS_NETCDF}
Expand All @@ -392,7 +390,6 @@ teca_add_test(py_test_deeplabv3p_ar_detect_threads
teca_add_test(py_test_deeplabv3p_ar_detect_mpi_threads
COMMAND ${MPIEXEC} -n ${HALF_TEST_CORES} ${PYTHON_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/test_deeplabv3p_ar_detect.py
"${TECA_ASSETS_ROOT}/cascade_deeplab_IVT.pt"
"${TECA_DATA_ROOT}/ARTMIP_MERRA_2D_2017-05.*\.nc$"
"${TECA_DATA_ROOT}/test_deeplabv3p_ar_detect" IVT -1
FEATURES ${TECA_HAS_NETCDF} ${TECA_HAS_MPI} ${MPI4Py_FOUND}
Expand Down
21 changes: 12 additions & 9 deletions test/python/test_deeplabv3p_ar_detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,24 @@
set_stack_trace_on_error()
set_stack_trace_on_mpi_error()

if (len(sys.argv) != 6):
if (len(sys.argv) != 5):
sys.stderr.write('\n\nUsage error:\n'
'test_deeplabv3p_ar_detect [deeplab model] '
'[mesh data regex] [baseline] '
'[water vapor var] [num threads]\n\n')
'test_deeplabv3p_ar_detect [mesh data regex] '
'[baseline] [water vapor var] [num threads]\n\n')
sys.exit(-1)

# parse command line
deeplab_model = sys.argv[1]
input_regex = sys.argv[2]
baseline = sys.argv[3]
water_vapor_var = sys.argv[4]
n_threads = int(sys.argv[5])
input_regex = sys.argv[1]
baseline = sys.argv[2]
water_vapor_var = sys.argv[3]
n_threads = int(sys.argv[4])
vrb = 1

deeplab_model = os.path.join(
get_teca_assets_root(),
"cascade_deeplab_IVT.pt"
)

cf_reader = teca_cf_reader.New()
cf_reader.set_files_regex(input_regex)
cf_reader.set_periodic_in_x(1)
Expand Down

0 comments on commit 29a5bd9

Please sign in to comment.