Apply the log mode to the displayed dataset, export the mapped one [3]#2238
Apply the log mode to the displayed dataset, export the mapped one [3]#2238StSav012 wants to merge 2 commits intopyqtgraph:masterfrom
Conversation
|
@NilsNemitz you most recently worked in this area, you have time to take a closer look at this PR? |
|
Hi @StSav012 , But there's a chance I can take a closer look over the weekend. Until then, could you remind me why you think rebuilding the definitions of the internal data structures and interfaces is the most helpful approach here? If I remember correctly, we have the data in various steps of processing available in the internal structures It seems to me, that if the exporter wants to have the original data, then it could just get |
|
Hi @NilsNemitz, These days I don't have much time either. @j9ac9k, I'll answer in other threads later. Well, the problem I recently faced was the following. If I set log mode and save the data via the Export action of the context menu, then the values I see in the file are not what I see in the plot. Namely, they are As for |
|
I think we'll need to change something,though, if we want the exporter to access that data. And I tend to agree that we do want that :) The reason for the separation between the mapped and the displayed datasets is that the "mapping" (where we currently only have log10) needs to be calculated only once, but the displayed dataset also depends on the current viewport, and potentially needs to be rebuilt on every zoom or scroll. And it seems wasteful to repeat the expensive log calculations every time. I think it might be simpler to either add the missing interfaces to the raw data, or to have the exporter take some liberties with the private/public boundaries. I might prefer adding a method to grab the raw/original data, and then to change the exporter to access that. There are then two open questions that I could see as requiring a little thought:
|
|
Thank you for the explanation. I wish the names were more self-explanatory.
I don't see another way.
To my mind, the only option should be is to export the raw data. The mapped data are of no use to virtually anyone.
As far as I have checked, no other |
My 3rd try to export the actual data plotted in log mode. That's what #2188 should have been. This time I changed the tests to match my perspective.
I believe that the log mode is something of displaying, not of the actual data. So, I moved the
applyLogMappingfunction call down toself._datasetDisplay.Next, I return the data saved into
self._datasetMappedinPlotDataItem.getDatafunction. It's a kind of expected behavior when it comes to returning the data, not the position of screen points.The tests should respect the actual data, too.