gadsbyfly / PyBioMed

machine learning, molecular descriptor
http://pybiomed.readthedocs.io/en/latest/index.html
BSD 3-Clause "New" or "Revised" License
109 stars 61 forks source link

:zap: improve efficient of function CalculateGraphDistance() #13

Closed kotori-y closed 3 years ago

kotori-y commented 4 years ago

In original function, a loop was used for counting the frequency of each element in the Distance. While use this function to C=CCCCCCCCCC(=O)[O-].[Na+], the times of loop can hit 100 millions.

Here I use the class Counter from collections instead of loop, which can significantly improve the efficient.