Skip to content

Commit 78d49f9

Browse files
committed
Add API reference
1 parent 3658cde commit 78d49f9

File tree

3 files changed

+123
-0
lines changed

3 files changed

+123
-0
lines changed

docs/source/api_reference.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,32 @@ Defined in ``xtensor-io/xgdal.hpp``
107107

108108
.. doxygenstruct:: xt::dump_gdal_options
109109
:project: xtensor-io
110+
111+
xfile_array
112+
-----------
113+
114+
Defined in ``xtensor-io/xfile_array.hpp``
115+
116+
.. doxygenclass:: xt::xfile_array_container
117+
:project: xtensor-io
118+
:members:
119+
120+
.. doxygentypedef:: xt::xfile_array
121+
:project: xtensor-io
122+
123+
xchunk_store_manager
124+
--------------------
125+
126+
Defined in ``xtensor-io/xchunk_store_manager.hpp``
127+
128+
.. doxygenclass:: xt::xchunk_store_manager
129+
:project: xtensor-io
110130
:members:
131+
132+
chunked_file_array
133+
------------------
134+
135+
Defined in ``xtensor-io/xchunk_store_manager.hpp``
136+
137+
.. doxygenfunction:: xt::chunked_file_array
138+
:project: xtensor-io

include/xtensor-io/xchunk_store_manager.hpp

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,18 @@ namespace xt
7171
using const_stepper = xindexed_stepper<xchunk_store_manager<EC, IP>, true>;
7272
};
7373

74+
/**
75+
* @class xchunk_store_manager
76+
* @brief Multidimensional chunk container and manager.
77+
*
78+
* The xchunk_store_manager class implements a multidimensional chunk container.
79+
* Chunks are managed in a pool, allowing for a limited number of chunks
80+
* that can simultaneously be hold in memory.
81+
*
82+
* @tparam EC The type of a chunk (e.g. xfile_array)
83+
* @tparam IP The type of the index-to-path transformer (default: xindex_path)
84+
* @sa xfile_array, xchunked_array, chunked_array, chunked_file_array
85+
*/
7486
template <class EC, class IP = xindex_path>
7587
class xchunk_store_manager: public xaccessible<xchunk_store_manager<EC, IP>>,
7688
public xiterable<xchunk_store_manager<EC, IP>>
@@ -187,6 +199,24 @@ namespace xt
187199
IP m_index_path;
188200
};
189201

202+
/**
203+
* Creates a stored chunked array.
204+
* This function returns an uninitialized ``xchunked_array<xchunk_store_manager<xfile_array<T, IOH>>>``.
205+
*
206+
* @tparam T The type of the elements (e.g. double)
207+
* @tparam IOH The type of the IO handler (e.g. xio_disk_handler)
208+
* @tparam L The layout_type of the array
209+
* @tparam IP The type of the index-to-path transformer (default: xindex_path)
210+
* @tparam EXT The type of the array extension (default: empty_extension)
211+
*
212+
* @param shape The shape of the array
213+
* @param chunk_shape The shape of a chunk
214+
* @param path The path to the chunk store
215+
* @param pool_size The size of the chunk pool (default: 1)
216+
* @param chunk_memory_layout The layout of each chunk (default: XTENSOR_DEFAULT_LAYOUT)
217+
*
218+
* @return returns a ``xchunked_array<xchunk_store_manager<xfile_array<T, IOH>>>`` with the given shape, chunk shape and memory layout.
219+
*/
190220
template <class T, class IOH, layout_type L = XTENSOR_DEFAULT_LAYOUT, class IP = xindex_path, class EXT = empty_extension, class S>
191221
xchunked_array<xchunk_store_manager<xfile_array<T, IOH, L>, IP>, EXT>
192222
chunked_file_array(S&& shape,
@@ -195,6 +225,25 @@ namespace xt
195225
std::size_t pool_size = 1,
196226
layout_type chunk_memory_layout = XTENSOR_DEFAULT_LAYOUT);
197227

228+
/**
229+
* Creates a stored chunked array.
230+
* This function returns a uninitialized ``xchunked_array<xchunk_store_manager<xfile_array<T, IOH>>>``.
231+
*
232+
* @tparam T The type of the elements (e.g. double)
233+
* @tparam IOH The type of the IO handler (e.g. xio_disk_handler)
234+
* @tparam L The layout_type of the array
235+
* @tparam IP The type of the index-to-path transformer (default: xindex_path)
236+
* @tparam EXT The type of the array extension (default: empty_extension)
237+
*
238+
* @param shape The shape of the array
239+
* @param chunk_shape The shape of a chunk
240+
* @param path The path to the chunk store
241+
* @param init_value The value with which to initialize the chunks when they are not already stored
242+
* @param pool_size The size of the chunk pool (default: 1)
243+
* @param chunk_memory_layout The layout of each chunk (default: XTENSOR_DEFAULT_LAYOUT)
244+
*
245+
* @return returns a ``xchunked_array<xchunk_store_manager<xfile_array<T, IOH>>>`` with the given shape, chunk shape and memory layout.
246+
*/
198247
template <class T, class IOH, layout_type L = XTENSOR_DEFAULT_LAYOUT, class IP = xindex_path, class EXT = empty_extension, class S>
199248
xchunked_array<xchunk_store_manager<xfile_array<T, IOH, L>, IP>, EXT>
200249
chunked_file_array(S&& shape,
@@ -204,6 +253,24 @@ namespace xt
204253
std::size_t pool_size = 1,
205254
layout_type chunk_memory_layout = XTENSOR_DEFAULT_LAYOUT);
206255

256+
/**
257+
* Creates a stored chunked array.
258+
* This function returns a ``xchunked_array<xchunk_store_manager<xfile_array<T, IOH>>>`` initialized from an expression.
259+
*
260+
* @tparam T The type of the elements (e.g. double)
261+
* @tparam IOH The type of the IO handler (e.g. xio_disk_handler)
262+
* @tparam L The layout_type of the array
263+
* @tparam IP The type of the index-to-path transformer (default: xindex_path)
264+
* @tparam EXT The type of the array extension (default: empty_extension)
265+
*
266+
* @param e The expression to initialize the chunked array from
267+
* @param chunk_shape The shape of a chunk
268+
* @param path The path to the chunk store
269+
* @param pool_size The size of the chunk pool (default: 1)
270+
* @param chunk_memory_layout The layout of each chunk (default: XTENSOR_DEFAULT_LAYOUT)
271+
*
272+
* @return returns a ``xchunked_array<xchunk_store_manager<xfile_array<T, IOH>>>`` from the given expression, with the given chunk shape and memory layout.
273+
*/
207274
template <class IOH, layout_type L = XTENSOR_DEFAULT_LAYOUT, class IP = xindex_path, class EXT = empty_extension, class E, class S>
208275
xchunked_array<xchunk_store_manager<xfile_array<typename E::value_type, IOH, L>, IP>, EXT>
209276
chunked_file_array(const xexpression<E>& e,
@@ -212,6 +279,22 @@ namespace xt
212279
std::size_t pool_size = 1,
213280
layout_type chunk_memory_layout = XTENSOR_DEFAULT_LAYOUT);
214281

282+
/**
283+
* Creates a stored chunked array.
284+
* This function returns a ``xchunked_array<xchunk_store_manager<xfile_array<T, IOH>>>`` initialized from an expression.
285+
*
286+
* @tparam IOH The type of the IO handler (e.g. xio_disk_handler)
287+
* @tparam L The layout_type of the array
288+
* @tparam IP The type of the index-to-path transformer (default: xindex_path)
289+
* @tparam EXT The type of the array extension (default: empty_extension)
290+
*
291+
* @param e The expression to initialize the chunked array from
292+
* @param path The path to the chunk store
293+
* @param pool_size The size of the chunk pool (default: 1)
294+
* @param chunk_memory_layout The layout of each chunk (default: XTENSOR_DEFAULT_LAYOUT)
295+
*
296+
* @return returns a ``xchunked_array<xchunk_store_manager<xfile_array<T, IOH>>>`` from the given expression, with the expression's chunk shape and the given memory layout.
297+
*/
215298
template <class IOH, layout_type L = XTENSOR_DEFAULT_LAYOUT, class IP = xindex_path, class EXT = empty_extension, class E>
216299
xchunked_array<xchunk_store_manager<xfile_array<typename E::value_type, IOH, L>, IP>, EXT>
217300
chunked_file_array(const xexpression<E>& e,

include/xtensor-io/xfile_array.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,18 @@ namespace xt
103103
using stepper = xindexed_stepper<xfile_array_container<E, IOH>, false>;
104104
};
105105

106+
/**
107+
* @class xfile_array_container
108+
* @brief Dense multidimensional file-backed cached container with tensor semantic.
109+
*
110+
* The xfile_array_container class implements a dense multidimensional container
111+
* with tensor semantic, stored on a file system. It acts as a file-backed cached
112+
* container, allowing for data persistence.
113+
*
114+
* @tparam E The type of the container holding the elements
115+
* @tparam IOH The type of the IO handler (e.g. xio_disk_handler)
116+
* @sa chunked_file_array, xchunk_store_manager
117+
*/
106118
template <class E, class IOH>
107119
class xfile_array_container : public xaccessible<xfile_array_container<E, IOH>>,
108120
public xiterable<xfile_array_container<E, IOH>>,

0 commit comments

Comments
 (0)