-
Notifications
You must be signed in to change notification settings - Fork 646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make guessers more consistent and transparent #2348
Comments
Related discussions: |
See also #2349 |
See also:
-_- |
Also my solution which maybe could make it into mda from periodictable import elements
from fuzzywuzzy import process
_ELEMS = {elem.symbol for elem in elements
if not elem.symbol == 'n'}
_RESULT_CACHE = {}
def to_element(thing):
try:
return _RESULT_CACHE[thing]
except KeyError:
stripped_thing = thing.strip('1234567890')
if stripped_thing in _ELEMS:
ret = stripped_thing
else:
ret, score = process.extractOne(thing, _ELEMS)
# if score < something: throw a tantrum
_RESULT_CACHE[thing] = ret
return ret |
To add on this issue, I think the name of |
@orbeckst , I want to work on this issue. Any guidance? |
This is a complicated issue. Start by reading everything that is linked in this issue and try to get an idea of what the problem is. If you want to work on it, don’t try to solve everything, start with a partial solution. |
Expected behavior
Actual behavior
atom_types
,mdanalysis/package/MDAnalysis/topology/guessers.py
Line 41 in d1b0e65
mdanalysis/package/MDAnalysis/topology/guessers.py
Line 58 in d1b0e65
atomname
mdanalysis/package/MDAnalysis/topology/guessers.py
Line 98 in d1b0e65
ValueError
, see guess_bonds which guessing types #2143Existing discussions
Code to reproduce the behavior
Example for bad mass guessing from atom_types
gives
I actually don't understand why on parsing the topology, the types HD, OA, and A cannot be used for guessing the mass but later HD and OA work and only A fails:
Again, warnings as above, but then
No masses for types {'A'}
only.Currently version of MDAnalysis
0.20.1
The text was updated successfully, but these errors were encountered: