darn-dmap 0.2.0__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {darn_dmap-0.2.0 → darn_dmap-0.2.1}/Cargo.lock +1 -1
- {darn_dmap-0.2.0 → darn_dmap-0.2.1}/Cargo.toml +1 -1
- {darn_dmap-0.2.0 → darn_dmap-0.2.1}/PKG-INFO +1 -1
- {darn_dmap-0.2.0 → darn_dmap-0.2.1}/pyproject.toml +1 -1
- {darn_dmap-0.2.0 → darn_dmap-0.2.1}/src/lib.rs +34 -8
- {darn_dmap-0.2.0 → darn_dmap-0.2.1}/.github/workflows/CI.yml +0 -0
- {darn_dmap-0.2.0 → darn_dmap-0.2.1}/README.md +0 -0
- {darn_dmap-0.2.0 → darn_dmap-0.2.1}/benches/io_benchmarking.rs +0 -0
- {darn_dmap-0.2.0 → darn_dmap-0.2.1}/src/error.rs +0 -0
- {darn_dmap-0.2.0 → darn_dmap-0.2.1}/src/formats/dmap.rs +0 -0
- {darn_dmap-0.2.0 → darn_dmap-0.2.1}/src/formats/fitacf.rs +0 -0
- {darn_dmap-0.2.0 → darn_dmap-0.2.1}/src/formats/grid.rs +0 -0
- {darn_dmap-0.2.0 → darn_dmap-0.2.1}/src/formats/iqdat.rs +0 -0
- {darn_dmap-0.2.0 → darn_dmap-0.2.1}/src/formats/map.rs +0 -0
- {darn_dmap-0.2.0 → darn_dmap-0.2.1}/src/formats/mod.rs +0 -0
- {darn_dmap-0.2.0 → darn_dmap-0.2.1}/src/formats/rawacf.rs +0 -0
- {darn_dmap-0.2.0 → darn_dmap-0.2.1}/src/formats/snd.rs +0 -0
- {darn_dmap-0.2.0 → darn_dmap-0.2.1}/src/record.rs +0 -0
- {darn_dmap-0.2.0 → darn_dmap-0.2.1}/src/types.rs +0 -0
- {darn_dmap-0.2.0 → darn_dmap-0.2.1}/tests/test_files/test.fitacf +0 -0
- {darn_dmap-0.2.0 → darn_dmap-0.2.1}/tests/test_files/test.fitacf.bz2 +0 -0
- {darn_dmap-0.2.0 → darn_dmap-0.2.1}/tests/test_files/test.grid +0 -0
- {darn_dmap-0.2.0 → darn_dmap-0.2.1}/tests/test_files/test.grid.bz2 +0 -0
- {darn_dmap-0.2.0 → darn_dmap-0.2.1}/tests/test_files/test.iqdat +0 -0
- {darn_dmap-0.2.0 → darn_dmap-0.2.1}/tests/test_files/test.iqdat.bz2 +0 -0
- {darn_dmap-0.2.0 → darn_dmap-0.2.1}/tests/test_files/test.map +0 -0
- {darn_dmap-0.2.0 → darn_dmap-0.2.1}/tests/test_files/test.map.bz2 +0 -0
- {darn_dmap-0.2.0 → darn_dmap-0.2.1}/tests/test_files/test.rawacf +0 -0
- {darn_dmap-0.2.0 → darn_dmap-0.2.1}/tests/test_files/test.rawacf.bz2 +0 -0
- {darn_dmap-0.2.0 → darn_dmap-0.2.1}/tests/test_files/test.snd +0 -0
- {darn_dmap-0.2.0 → darn_dmap-0.2.1}/tests/test_files/test.snd.bz2 +0 -0
- {darn_dmap-0.2.0 → darn_dmap-0.2.1}/tests/tests.rs +0 -0
|
@@ -163,7 +163,7 @@ read_rust!(dmap);
|
|
|
163
163
|
/// Generates two functions: `read_[type]` and `read_[type]_lax`, for strict and lax
|
|
164
164
|
/// reading, respectively.
|
|
165
165
|
macro_rules! read_py {
|
|
166
|
-
($name:ident, $py_name:literal, $lax_name:literal, $bytes_name:literal) => {
|
|
166
|
+
($name:ident, $py_name:literal, $lax_name:literal, $bytes_name:literal, $lax_bytes_name:literal) => {
|
|
167
167
|
paste! {
|
|
168
168
|
#[doc = "Reads a `" $name:upper "` file, returning a list of dictionaries containing the fields." ]
|
|
169
169
|
#[pyfunction]
|
|
@@ -204,27 +204,44 @@ macro_rules! read_py {
|
|
|
204
204
|
.collect()
|
|
205
205
|
)
|
|
206
206
|
}
|
|
207
|
+
|
|
208
|
+
#[doc = "Reads a `" $name:upper "` file, returning a tuple of" ]
|
|
209
|
+
#[doc = "(list of dictionaries containing the fields, byte where first corrupted record starts). "]
|
|
210
|
+
#[pyfunction]
|
|
211
|
+
#[pyo3(name = $lax_bytes_name)]
|
|
212
|
+
#[pyo3(text_signature = "(buf: bytes, /)")]
|
|
213
|
+
fn [< read_ $name _bytes_lax_py >](
|
|
214
|
+
bytes: &[u8],
|
|
215
|
+
) -> PyResult<(Vec<IndexMap<String, DmapField>>, Option<usize>)> {
|
|
216
|
+
let result = [< $name:camel Record >]::read_records_lax(bytes).map_err(PyErr::from)?;
|
|
217
|
+
Ok((
|
|
218
|
+
result.0.into_iter().map(|rec| rec.inner()).collect(),
|
|
219
|
+
result.1,
|
|
220
|
+
))
|
|
221
|
+
}
|
|
207
222
|
}
|
|
208
223
|
}
|
|
209
224
|
}
|
|
210
225
|
|
|
211
|
-
read_py!(iqdat, "read_iqdat", "read_iqdat_lax", "read_iqdat_bytes");
|
|
226
|
+
read_py!(iqdat, "read_iqdat", "read_iqdat_lax", "read_iqdat_bytes", "read_iqdat_bytes_lax");
|
|
212
227
|
read_py!(
|
|
213
228
|
rawacf,
|
|
214
229
|
"read_rawacf",
|
|
215
230
|
"read_rawacf_lax",
|
|
216
|
-
"read_rawacf_bytes"
|
|
231
|
+
"read_rawacf_bytes",
|
|
232
|
+
"read_rawacf_bytes_lax"
|
|
217
233
|
);
|
|
218
234
|
read_py!(
|
|
219
235
|
fitacf,
|
|
220
236
|
"read_fitacf",
|
|
221
237
|
"read_fitacf_lax",
|
|
222
|
-
"read_fitacf_bytes"
|
|
238
|
+
"read_fitacf_bytes",
|
|
239
|
+
"read_fitacf_bytes_lax"
|
|
223
240
|
);
|
|
224
|
-
read_py!(grid, "read_grid", "read_grid_lax", "read_grid_bytes");
|
|
225
|
-
read_py!(map, "read_map", "read_map_lax", "read_map_bytes");
|
|
226
|
-
read_py!(snd, "read_snd", "read_snd_lax", "read_snd_bytes");
|
|
227
|
-
read_py!(dmap, "read_dmap", "read_dmap_lax", "read_dmap_bytes");
|
|
241
|
+
read_py!(grid, "read_grid", "read_grid_lax", "read_grid_bytes", "read_grid_bytes_lax");
|
|
242
|
+
read_py!(map, "read_map", "read_map_lax", "read_map_bytes", "read_map_bytes_lax");
|
|
243
|
+
read_py!(snd, "read_snd", "read_snd_lax", "read_snd_bytes", "read_snd_bytes_lax");
|
|
244
|
+
read_py!(dmap, "read_dmap", "read_dmap_lax", "read_dmap_bytes", "read_dmap_bytes_lax");
|
|
228
245
|
|
|
229
246
|
/// Checks that a list of dictionaries contains DMAP records, then appends to outfile.
|
|
230
247
|
///
|
|
@@ -315,6 +332,15 @@ fn dmap(m: &Bound<'_, PyModule>) -> PyResult<()> {
|
|
|
315
332
|
m.add_function(wrap_pyfunction!(read_grid_bytes_py, m)?)?;
|
|
316
333
|
m.add_function(wrap_pyfunction!(read_map_bytes_py, m)?)?;
|
|
317
334
|
|
|
335
|
+
// Lax read functions from byte buffer
|
|
336
|
+
m.add_function(wrap_pyfunction!(read_dmap_bytes_lax_py, m)?)?;
|
|
337
|
+
m.add_function(wrap_pyfunction!(read_iqdat_bytes_lax_py, m)?)?;
|
|
338
|
+
m.add_function(wrap_pyfunction!(read_rawacf_bytes_lax_py, m)?)?;
|
|
339
|
+
m.add_function(wrap_pyfunction!(read_fitacf_bytes_lax_py, m)?)?;
|
|
340
|
+
m.add_function(wrap_pyfunction!(read_snd_bytes_lax_py, m)?)?;
|
|
341
|
+
m.add_function(wrap_pyfunction!(read_grid_bytes_lax_py, m)?)?;
|
|
342
|
+
m.add_function(wrap_pyfunction!(read_map_bytes_lax_py, m)?)?;
|
|
343
|
+
|
|
318
344
|
// Write functions
|
|
319
345
|
m.add_function(wrap_pyfunction!(write_dmap_py, m)?)?;
|
|
320
346
|
m.add_function(wrap_pyfunction!(write_iqdat_py, m)?)?;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|