Skip to content

Commit

Permalink
X Ray Image Query: Fix Issues on Windows (#19106) (#19218)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinPrivitera committed Jan 10, 2024
1 parent ba734ff commit 88fdcad
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
11 changes: 7 additions & 4 deletions src/avt/Queries/Queries/avtXRayImageQuery.C
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,7 @@ avtXRayImageQuery::SetOutputType(const std::string &type)
void
avtXRayImageQuery::SetOutputDir(const std::string &dir)
{
outputDir = dir;
outputDir = (dir == "" ? "." : dir);
}

// ****************************************************************************
Expand Down Expand Up @@ -1327,6 +1327,9 @@ avtXRayImageQuery::GetSecondaryVars(std::vector<std::string> &outVars)
// query xml result.
// BOV and rawfloats output logic has been simplified.
//
// Justin Privitera, Wed Nov 29 15:10:59 PST 2023
// Handle windows-style file paths.
//
// ****************************************************************************

void
Expand Down Expand Up @@ -1484,11 +1487,11 @@ avtXRayImageQuery::Execute(avtDataTree_p tree)
//
std::stringstream fileName;
if (outputDir != ".")
fileName << outputDir.c_str() << "/" << baseName.str();
fileName << outputDir.c_str() << VISIT_SLASH_STRING;
if (multipleOutputFiles(outputType, numBins))
fileName << ".00." << file_extensions[outputType];
fileName << baseName.str() << ".00." << file_extensions[outputType];
else
fileName << "." << file_extensions[outputType];
fileName << baseName.str() << "." << file_extensions[outputType];

ifstream ifile(fileName.str());
if (!ifile.fail() && iFileFamily < NUMFAMILYFILES)
Expand Down
6 changes: 5 additions & 1 deletion src/test/tests/queries/xrayimage.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,14 @@
# images.
# Use the python dictionary returned by the query to tell if the query was
# successful or not.
#
# Justin Privitera, Wed Nov 29 15:10:59 PST 2023
# Use numpy.int64 to cast to wide types for diff.
# ----------------------------------------------------------------------------

import os
import conduit
import numpy

if not os.path.isdir(out_path("current","queries")):
os.mkdir(out_path("current","queries"))
Expand Down Expand Up @@ -504,7 +508,7 @@ def teardown_bp_test(lite = False):
# So the diff fails unless we take the int32 type and
# cast it to int64.
def cast_to_wide_int_type_conduit(node, leafname):
val = int(node[leafname])
val = numpy.int64(node[leafname])
node.remove_child(leafname)
node[leafname] = val

Expand Down

0 comments on commit 88fdcad

Please sign in to comment.