1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2025-01-03 10:06:01 +01:00

Fix bug in trexio_flush [Python API]

This commit is contained in:
q-posev 2023-05-25 18:20:00 +02:00
parent ab2eee5704
commit d1ada666c6
No known key found for this signature in database

View File

@ -853,6 +853,14 @@ class File:
return self.state
def flush(self):
"""Flush the data on disk."""
rc = pytr.trexio_flush(self.pytrexio_s)
if rc != TREXIO_SUCCESS:
raise Error(rc)
def inquire(self):
"""Inquire whether a TREXIO file exists."""
self.exists = _inquire(self.filename)
@ -1506,7 +1514,7 @@ def flush(trexio_file):
Parameter is a ~trexio_file~ object that has been created by a call to ~open~ function.
"""
rc = pytr.trexio_flush(trexio_file)
rc = pytr.trexio_flush(trexio_file.pytrexio_s)
if rc != TREXIO_SUCCESS:
raise Error(rc)
#+end_src
@ -2139,7 +2147,7 @@ trexio_read_$group_num$_64 (trexio_t* const file, $group_num_dtype_double$* cons
if (trexio_has_$group_num$(file) != TREXIO_SUCCESS) return TREXIO_ATTR_MISSING;
trexio_exit_code rc = TREXIO_GROUP_READ_ERROR;
switch (file->back_end) {
case TREXIO_TEXT:
@ -3370,7 +3378,7 @@ trexio_read_$group_dset$(trexio_t* const file,
/* Find the maximal value along all dimensions to define the compression technique in the back end */
int64_t max_dim = unique_dims[0];
#if (unique_rank != 1)
#if (unique_rank != 1)
for (uint32_t i = 1; i < unique_rank; i++) {
if (unique_dims[i] > max_dim) max_dim = unique_dims[i];
}
@ -3503,7 +3511,7 @@ trexio_write_$group_dset$(trexio_t* const file,
/* Find the maximal value along all dimensions to define the compression technique in the back end */
int64_t max_dim = unique_dims[0];
#if (unique_rank != 1)
#if (unique_rank != 1)
for (uint32_t i = 1; i < unique_rank; i++) {
if (unique_dims[i] > max_dim) max_dim = unique_dims[i];
}