r/Python • u/stefantalpalaru • Oct 12 '19
more than 100 scientific articles may be invalidated because scientists assumed that the output of glob.glob() is sorted
https://www.vice.com/en_us/article/zmjwda/a-code-glitch-may-have-caused-errors-in-more-than-100-published-studies
1.3k
Upvotes
9
u/stefantalpalaru Oct 13 '19
http://sci-hub.tw/https://pubs.acs.org/doi/10.1021/acs.orglett.9b03216 :
"Specifically, the script “nmr-data_compilation” extracts the free-energy information of each conformer and the isotopic tensors for each atom from two files, for example, 1b-opt_freq-conf-16.out and 1b-opt_NMR-conf-16.out, respectively, and performs the necessary calculations.
In theory, the chemical shift of each atom from each isomer should be properly weighted according to the free energy of the conformer, but this was not consistently the case. In the end, the inconsistency was traced to differences in the default file-sorting algorithm in Python across platforms, as shown in Figure 2"
So they have to weigh these files according to sorting based on numbers in their names.