Skip to content

Commit ce9f7cc

Browse files
authored
Merge pull request #97 from davidbrochart/rename
Rename xdisk_io_handler to xio_disk_handler
2 parents e46ed9a + 093f14a commit ce9f7cc

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ message(STATUS "Found xtensor: ${xtensor_INCLUDE_DIRS}/xtensor")
5353
set(XTENSOR_IO_HEADERS
5454
${XTENSOR_IO_INCLUDE_DIR}/xtensor-io/xaudio.hpp
5555
${XTENSOR_IO_INCLUDE_DIR}/xtensor-io/xchunk_store_manager.hpp
56-
${XTENSOR_IO_INCLUDE_DIR}/xtensor-io/xdisk_io_handler.hpp
56+
${XTENSOR_IO_INCLUDE_DIR}/xtensor-io/xio_disk_handler.hpp
5757
${XTENSOR_IO_INCLUDE_DIR}/xtensor-io/xfile_array.hpp
5858
${XTENSOR_IO_INCLUDE_DIR}/xtensor-io/xgdal.hpp
5959
${XTENSOR_IO_INCLUDE_DIR}/xtensor-io/xhighfive.hpp

include/xtensor-io/xdisk_io_handler.hpp renamed to include/xtensor-io/xio_disk_handler.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
#ifndef XTENSOR_IO_DISK_IO_HANDLER_HPP
2-
#define XTENSOR_IO_DISK_IO_HANDLER_HPP
1+
#ifndef XTENSOR_IO_DISK_HANDLER_HPP
2+
#define XTENSOR_IO_DISK_HANDLER_HPP
33

44
#include <xtensor/xarray.hpp>
55
#include <xtensor/xexpression.hpp>
66

77
namespace xt
88
{
99
template <class C>
10-
class xdisk_io_handler
10+
class xio_disk_handler
1111
{
1212
public:
1313

@@ -26,7 +26,7 @@ namespace xt
2626

2727
template <class C>
2828
template <class E>
29-
inline void xdisk_io_handler<C>::write(const xexpression<E>& expression, const std::string& path) const
29+
inline void xio_disk_handler<C>::write(const xexpression<E>& expression, const std::string& path) const
3030
{
3131
std::ofstream out_file(path, std::ofstream::binary);
3232
if (out_file.is_open())
@@ -41,7 +41,7 @@ namespace xt
4141

4242
template <class C>
4343
template <class ET>
44-
inline void xdisk_io_handler<C>::read(ET& array, const std::string& path, bool throw_on_fail) const
44+
inline void xio_disk_handler<C>::read(ET& array, const std::string& path, bool throw_on_fail) const
4545
{
4646
std::ifstream in_file(path, std::ifstream::binary);
4747
if (in_file.is_open())
@@ -63,7 +63,7 @@ namespace xt
6363
}
6464

6565
template <class C>
66-
inline void xdisk_io_handler<C>::configure_format(const C& format_config)
66+
inline void xio_disk_handler<C>::configure_format(const C& format_config)
6767
{
6868
m_format_config = format_config;
6969
}

test/test_xchunk_store_manager.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
//#include "xtensor-io/xchunked_array.hpp"
1515
//#include "xtensor-io/xchunk_store_manager.hpp"
1616
//#include "xtensor-io/xfile_array.hpp"
17-
//#include "xtensor-io/xdisk_io_handler.hpp"
17+
//#include "xtensor-io/xio_disk_handler.hpp"
1818

1919
namespace xt
2020
{
@@ -118,7 +118,7 @@ namespace xt
118118
std::vector<size_t> chunk_shape = {2, 2};
119119
std::string chunk_dir = "files";
120120
std::size_t pool_size = 2;
121-
xchunked_array<xchunk_store_manager<xfile_array<double, xdisk_io_handler<xcsv_config>>>> a1(shape, chunk_shape, chunk_dir, pool_size);
121+
xchunked_array<xchunk_store_manager<xfile_array<double, xio_disk_handler<xcsv_config>>>> a1(shape, chunk_shape, chunk_dir, pool_size);
122122
std::vector<size_t> idx = {1, 2};
123123
double v1 = 3.4;
124124
double v2 = 5.6;
@@ -156,7 +156,7 @@ namespace xt
156156
TEST(xfile_array, indexed_access)
157157
{
158158
std::vector<size_t> shape = {2, 2, 2};
159-
xfile_array<double, xdisk_io_handler<xcsv_config>> a;
159+
xfile_array<double, xio_disk_handler<xcsv_config>> a;
160160
a.ignore_empty_path(true);
161161
a.resize(shape);
162162
double val = 3.;
@@ -169,15 +169,15 @@ namespace xt
169169
TEST(xfile_array, assign_expression)
170170
{
171171
double v1 = 3.;
172-
auto a1 = xfile_array<double, xdisk_io_handler<xcsv_config>>(broadcast(v1, {2, 2}), "a1");
172+
auto a1 = xfile_array<double, xio_disk_handler<xcsv_config>>(broadcast(v1, {2, 2}), "a1");
173173
a1.ignore_empty_path(true);
174174
for (const auto& v: a1)
175175
{
176176
EXPECT_EQ(v, v1);
177177
}
178178
179179
double v2 = 2. * v1;
180-
auto a2 = xfile_array<double, xdisk_io_handler<xcsv_config>>(a1 + a1, "a2");
180+
auto a2 = xfile_array<double, xio_disk_handler<xcsv_config>>(a1 + a1, "a2");
181181
a2.ignore_empty_path(true);
182182
for (const auto& v: a2)
183183
{

0 commit comments

Comments
 (0)