
A set of Python scripts popularly used to analyze chemistry data has had a long-standing bug in that it had assumptions about the order in which filenames in a directory would be returned <https://arstechnica.com/information-technology/2019/10/chemists-discover-cross-platform-python-scripts-not-so-cross-platform/>. The code worked correctly on Windows and an older version of macOS, but discrepancies crept in on Linux and on newer macOS.
The fix was to sort the returned names into a consistent order before processing. I just note this Twitter comment from one of the original authors:
When I wrote the scripts 6 years ago, the OS was able to handle the sorting.
That would never have been true on Linux. There have never been any guarantees about ordering of directory entries on POSIX-compliant systems. Note the docs <https://docs.python.org/3/library/glob.html#glob.glob> clearly say:
Whether or not the results are sorted depends on the file system.
One of the researchers who found (and fixed) the bug says
... he hopes the paper will get scientists to pay more attention to the computational side of experiments in the future.
The upside: the script was made available with the study. Lots of studies cannot be replicated due to data and/or scripts/programs not being made available as well. Hence the "open science" movement (https://en.wikipedia.org/wiki/Open_science). Cheers, Peter -- Peter Reutemann Dept. of Computer Science University of Waikato, NZ +64 (7) 858-5174 http://www.cms.waikato.ac.nz/~fracpete/ http://www.data-mining.co.nz/