Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename internal variable dtype to file_data_type. #930

Merged
merged 1 commit into from
Jan 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions include/highfive/bits/H5ReadWrite_misc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,29 +131,29 @@ struct string_type_checker<char*> {

template <typename T>
template <class F>
BufferInfo<T>::BufferInfo(const DataType& dtype, F getName, Operation _op)
BufferInfo<T>::BufferInfo(const DataType& file_data_type, F getName, Operation _op)
: op(_op)
, is_fixed_len_string(dtype.isFixedLenStr())
, is_fixed_len_string(file_data_type.isFixedLenStr())
// In case we are using Fixed-len strings we need to subtract one dimension
, n_dimensions(details::inspector<type_no_const>::recursive_ndim -
((is_fixed_len_string && is_char_array) ? 1 : 0))
, data_type(
string_type_checker<char_array_t>::getDataType(create_datatype<elem_type>(), dtype)) {
, data_type(string_type_checker<char_array_t>::getDataType(create_datatype<elem_type>(),
file_data_type)) {
// We warn. In case they are really not convertible an exception will rise on read/write
if (dtype.getClass() != data_type.getClass()) {
if (file_data_type.getClass() != data_type.getClass()) {
HIGHFIVE_LOG_WARN(getName() + "\": data and hdf5 dataset have different types: " +
data_type.string() + " -> " + dtype.string());
} else if ((dtype.getClass() & data_type.getClass()) == DataTypeClass::Float) {
data_type.string() + " -> " + file_data_type.string());
} else if ((file_data_type.getClass() & data_type.getClass()) == DataTypeClass::Float) {
HIGHFIVE_LOG_WARN_IF(
(op == Operation::read) && (dtype.getSize() > data_type.getSize()),
(op == Operation::read) && (file_data_type.getSize() > data_type.getSize()),
getName() + "\": hdf5 dataset has higher floating point precision than data on read: " +
dtype.string() + " -> " + data_type.string());
file_data_type.string() + " -> " + data_type.string());

HIGHFIVE_LOG_WARN_IF(
(op == Operation::write) && (dtype.getSize() < data_type.getSize()),
(op == Operation::write) && (file_data_type.getSize() < data_type.getSize()),
getName() +
"\": data has higher floating point precision than hdf5 dataset on write: " +
data_type.string() + " -> " + dtype.string());
data_type.string() + " -> " + file_data_type.string());
}
}

Expand Down
Loading