Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
 * fail exits, so return statements not needed
 * check_search_correspondence is not implemented
  • Loading branch information
gfiumara committed Apr 5, 2023
1 parent db33ab8 commit dd80cce
Showing 1 changed file with 1 addition and 66 deletions.
67 changes: 1 addition & 66 deletions elft_1_x/validation/validate
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ print_footer()
font_reset;font_dim
echo -n "Completed: $(get_date)"
if [ "${start_sec}" != "" ]; then
local duration=$(( ("$(date +%s)" - start_sec) ))
local duration=$(( "$(date +%s)" - start_sec ))
echo " (Runtime: ${duration}s)"
else
echo
Expand Down Expand Up @@ -868,7 +868,6 @@ check_library()
msg+="naming conventions."
fail "${msg}" "" "The library directory is:" \
"$(rp "${local_lib_dir}")"
return 1
fi
return 1
Expand Down Expand Up @@ -940,7 +939,6 @@ get_core_library_name()
local msg="Library directory not found. Create it and place "
msg+="the core library inside."
fail "${msg}" "" "The library directory is:" "${local_lib_dir}"
return 1
fi
local core_lib=""
Expand All @@ -949,7 +947,6 @@ get_core_library_name()
-regex "${local_lib_dir}/${lib_regex}" -printf "%P\n" | wc -l)
if [ "${count}" -gt 1 ]; then
fail "More than one core library found in ${local_lib_dir}"
return 1
fi
local core_lib
Expand All @@ -960,7 +957,6 @@ get_core_library_name()
msg+="Please review the ELFT library naming conventions."
fail "${msg}" "" "The library directory is:" \
"$(rp "${local_lib_dir}")"
return 1
fi
echo "${core_lib}"
Expand Down Expand Up @@ -1349,7 +1345,6 @@ check_api_level()
output=$(<"${tempfile}")
rm "${tempfile}"
fail "${output}"
return 1
fi
rm "${tempfile}"
Expand All @@ -1363,13 +1358,11 @@ clean_previous_attempts()
rm -rf "${bin_dir}"
if [ -d "${bin_dir}" ]; then
fail "Failed to remove" "${bin_dir}"
return 1
fi
rm -rf "${output_dir}"
if [ -d "${output_dir}" ]; then
fail "Failed to remove" "${output_dir}"
return 1
fi
rm -rf "${lib_dir}/libelft.so"
Expand All @@ -1391,7 +1384,6 @@ clean_previous_attempts()
wc -l)" -ne 0 ];
then
fail "Failed to remove some output. Please delete it manually."
return 1
fi
okay
Expand Down Expand Up @@ -1528,7 +1520,6 @@ run_extract()
then
local msg="An error occurred while running. Please review:"
fail "${msg}" "$(rp "${log}")"
return 1
fi
# Check for runtime error messages
Expand Down Expand Up @@ -1556,7 +1547,6 @@ run_create_database()
then
local msg="An error occurred while running. Please review:"
fail "${msg}" "$(rp "${log}")"
return 1
fi
# Check for runtime error messages
Expand Down Expand Up @@ -1598,7 +1588,6 @@ run_search()
then
local msg="An error occurred while running. Please review:"
fail "${msg}" "$(rp "${log}")"
return 1
fi
# Check for runtime error messages
Expand Down Expand Up @@ -1738,59 +1727,6 @@ check_search_correspondence()
# echo -n "Checking search logs (correspondence)... "
merge_logs "correspondence"
return 0
local bad_coord=0
local bad_theta=0
local log="${driver_output_dir}/correspondence.log"
while read -r line; do
# read -r identifier ref_id ref_x ref_y ref_theta probe_id \
# probe_x probe_y probe_theta <<< "$(cut -f \
# 1,6,7,8,9,11,12,13,14 -d ',' <<< "${line}" | tr ',' ' ')"
read -r identifier ref_theta probe_x probe_y probe_theta <<< \
"$(cut -f 1,9,12,13,14 -d ',' <<< "${line}" | tr ',' ' ')"
read -r probe_width probe_height <<< "$(cut -f 12 -d '_' \
<<< "${identifier}" | tr -d '\"' | tr 'x' ' ')"
# Location within image
if [ "${probe_x}" -ge "${probe_width}" ] || \
[ "${probe_y}" -ge "${probe_height}" ]; then
bad_coord=1
fi
# TODO: Reference image
# Theta [0,359]
if [ "${probe_theta}" -lt 0 ] || \
[ "${probe_theta}" -gt 359 ] || \
[ "${ref_theta}" -lt 0 ] || \
[ "${ref_theta}" -gt 359 ]; then
bad_theta=$(( bad_theta + 1 ))
fi
# TODO: Probe/Reference ID valid based on number of images.
# Right now, only ever one probe. Reference difficult to
# do on a per-line basis.
# TODO: Rank valid based on candidates returned for this search.
# Difficult to do on a per-line basis.
# TODO: All corresponding minutia are identical to those
# extracted in ExtractionInterface. Difficult to do on a
# per-line basis.
done < <(tail -n +2 "${log}")
if [ "${bad_coord}" -gt 0 ]; then
local msg="There are some (${bad_coord}) coordinates returned "
msg+="that are outside the image. Please review: "
fail "${msg}" "${log}"
fi
if [ "${bad_theta}" -gt 0 ]; then
local msg="There are some (${bad_theta}) theta values outside "
msg+="the allowed range of [0, 359]. Please review: "
fail "${msg}" "${log}"
fi
okay
}
# Check search candidates log for potential errors
Expand Down Expand Up @@ -2057,4 +1993,3 @@ if [ "${validation_version_checked}" -ne 1 ]; then
fi
print_final_success
print_footer "${start_sec}"

0 comments on commit dd80cce

Please sign in to comment.