I am writing to inquire about an issue I encountered while using the HistogramModifier in the python-ovito library, version 3.9.2. Specifically, I am trying to generate a histogram for the physical quantity “lost_neigh_time” (data attached). I set the bin_count to 500.
Afterwards, I used the ovito.io.export command to export the histogram data generated by the HistogramModifier. Additionally, I used the tables.xy() command to obtain the two-dimensional matrix of the histogram.
However, I noticed that the histogram matrices obtained from these two methods differ.
Attached is screenshot of the exported file data from the export command.
And a partial screenshot of the two-dimensional matrix obtained from the tables.xy() command.
Could you please advise if there are any specific options that need to be set when using the ovito.io.export command? Here is my code.
For what it’s worth I cannot reproduce your issue with the ovito 3.9.2 Python package and the dump file you provide. The results I get are identical both in the hist.txt file and the printed array. Here is a plot of both.
It also seems weird to me that you have a difference of a single digit in the last value you present in your snapshot. The value is also lower than the previous values while they are sorted in increasing order which makes no sense. The format difference is just cosmetic for the outputs.
Thank you for your response. By “difference,” I refer to the last data rows in the two screenshots above. Following your suggestion, I also plotted two histograms on the same graph and still found some distinctions.
According to your suggestion, I installed Miniconda and tested it. I found that the issue indeed disappeared. However, I noticed that when running the python-ovito program installed with pip, the aforementioned problem occurs.
Thank you for your help. This is the hist.txt file and the python packages and its version that I got by using the pip list command. hist.txt (5.3 KB) pip_list.txt (3.1 KB)
Thanks. For your reference, I am attaching my version of hist.txt (4.9 KB), which contains the correct values.
It’s really unusual: On every 5th line of your file, a single digit seems to be missing in the first column. Everything else is identical in the two files. Frankly, I don’t have a good idea yet how something like this can even happen.
I’m guessing it might have something to do with the operating system, the above example of what went wrong was run using win10, I ran the program again using Linux and had no problems.
Thank you very much for your effort investigating the problem. We have now discovered the origin of this issue. It is a bug in a third-party component (Boost library v1.78) used by the PyPI and desktop versions of OVITO for Windows. The conda package for Windows, and all versions on other OS platforms, are not affected. We will keep you posted once an updated build of the PyPI package becomes available.
Here is the new build of the dev3.10.0 pre-release package for Windows, which is based on a more recent version of the Boost library and which should not exhibit the data export issue: