1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! The lazy writing front-end.
use crateResult;
use crateArray;
/// A sink that accepts array chunks and finalises a file on drop-free `finish`.
/// Type-erased handle over any [`ChunkSink`].
///
/// ```no_run
/// # use pyferrite::{write_lazy, WriteOptions, dtype::DType};
/// let mut w = write_lazy("out.npy", DType::F32, &[1_000_000], &WriteOptions::new())?;
/// # let chunk = pyferrite::value::Array::F32(ndarray::ArrayD::zeros(ndarray::IxDyn(&[1000])));
/// for _ in 0..1000 { w.push(&chunk)?; }
/// w.finish()?;
/// # Ok::<(), pyferrite::Error>(())
/// ```