Skip to content

Commit

Permalink
Fixes for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
franzpoeschel committed Jul 23, 2024
1 parent 57be2d4 commit 3a38bf8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
5 changes: 4 additions & 1 deletion include/openPMD/binding/python/Pickle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include "openPMD/IO/Access.hpp"
#include "openPMD/Series.hpp"
#include "openPMD/auxiliary/StringManip.hpp"
#include "openPMD/backend/Attributable.hpp"

#include "Common.hpp"
Expand Down Expand Up @@ -75,7 +76,9 @@ add_pickle(pybind11::class_<T_Args...> &cl, T_SeriesAccessor &&seriesAccessor)
try
{
return !series.has_value() || !series->operator bool() ||
series->myPath().filePath() != filename;
auxiliary::replace_all(
series->myPath().filePath(), "\\", "/") !=
auxiliary::replace_all(filename, "\\", "/");
}
/*
* Better safe than sorry, if anything goes wrong because the
Expand Down
11 changes: 8 additions & 3 deletions test/SerialIOTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ void write_and_read_many_iterations(

{
Series write(filename, Access::CREATE);
REQUIRE(write.myPath().filePath() == filename);
REQUIRE(
auxiliary::replace_all(write.myPath().filePath(), "\\", "/") ==
auxiliary::replace_all(filename, "\\", "/"));
for (unsigned int i = 0; i < nIterations; ++i)
{
// std::cout << "Putting iteration " << i << std::endl;
Expand Down Expand Up @@ -1852,8 +1854,11 @@ inline void fileBased_write_test(const std::string &backend)
Access::CREATE,
jsonCfg);
REQUIRE(
o.myPath().filePath() ==
("../samples/subdir/serial_fileBased_write%03T." + backend));
auxiliary::replace_all(o.myPath().filePath(), "\\", "/") ==
auxiliary::replace_all(
"../samples/subdir/serial_fileBased_write%03T." + backend,
"\\",
"/"));

ParticleSpecies &e_1 = o.iterations[1].particles["e"];

Expand Down

0 comments on commit 3a38bf8

Please sign in to comment.