Bug 421193 - import float(4) data from hdf5-file gives wrong results.
Summary: import float(4) data from hdf5-file gives wrong results.
Status: RESOLVED FIXED
Alias: None
Product: LabPlot2
Classification: Applications
Component: backend (show other bugs)
Version: latest
Platform: Microsoft Windows Microsoft Windows
: NOR grave
Target Milestone: ---
Assignee: Stefan Gerlach
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-08 15:54 UTC by chinoune.mehdi
Modified: 2020-05-10 09:03 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.8
Sentry Crash Report:


Attachments
float_data (228.13 KB, application/x-hdf)
2020-05-09 12:42 UTC, chinoune.mehdi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description chinoune.mehdi 2020-05-08 15:54:38 UTC
SUMMARY
labplot2 import float(4) data as double(8) data, which leads to wrong data.
importing a float(4) array with 100 elements gives a double(8) array with 50 elements.

STEPS TO REPRODUCE
1. Import an hdf5 file with float(4) data stored in.
2. select data
3. import it inside spreadsheet
Example: 31.7244

OBSERVED RESULT
Previewed data seem good. while imported are completely wrong
9.23366E+09

EXPECTED RESULT
31.7244

SOFTWARE/OS VERSIONS
Windows: 10/18363

ADDITIONAL INFORMATION
It occurs in both 2.7.0 and nightly(2.8.0)
Comment 1 chinoune.mehdi 2020-05-09 05:25:12 UTC
Same issue on Ubunutu 20.04, version 2.7.0
Comment 2 Stefan Gerlach 2020-05-09 12:13:08 UTC
can you attach a sample hdf5 file with float(4) data? I'm not able to reproduce the problem with my data files.
Comment 3 chinoune.mehdi 2020-05-09 12:42:23 UTC
Created attachment 128282 [details]
float_data
Comment 4 Stefan Gerlach 2020-05-09 15:22:27 UTC
Git commit 95013f0b710e99feda95ef8c01d922ffd6c42846 by Stefan Gerlach.
Committed on 09/05/2020 at 15:21.
Pushed by sgerlach into branch 'master'.

[hdf5 import] Fix import of FLOAT(4) data
FIXED-IN: 2.8

M  +1    -3    src/backend/datasources/filters/HDF5Filter.cpp

https://invent.kde.org/kde/labplot/commit/95013f0b710e99feda95ef8c01d922ffd6c42846
Comment 5 Alexander Semke 2020-05-10 07:35:45 UTC
(In reply to chinoune.mehdi from comment #0)
> ADDITIONAL INFORMATION
> It occurs in both 2.7.0 and nightly(2.8.0)
Can you please try out the last nightly build and confirm it solves the problem for you?
Comment 6 chinoune.mehdi 2020-05-10 09:03:20 UTC
(In reply to Alexander Semke from comment #5)
> (In reply to chinoune.mehdi from comment #0)
> > ADDITIONAL INFORMATION
> > It occurs in both 2.7.0 and nightly(2.8.0)
> Can you please try out the last nightly build and confirm it solves the
> problem for you?

Tried this morning. Problem solved.