Skip to content

Commit

Permalink
Add example in docs showing how fractional occupation is parsed
Browse files Browse the repository at this point in the history
  • Loading branch information
bjodah committed Apr 23, 2024
1 parent 9fe07c9 commit 74e83f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 2 additions & 0 deletions chempy/util/parsing.py
Expand Up @@ -379,6 +379,8 @@ def formula_to_composition(
True
>>> formula_to_composition('Na2CO3..7H2O') == {11: 2, 6: 1, 8: 10, 1: 14}
True
>>> formula_to_composition('UO2.3') == {92: 1, 8: 2.3}
True
"""
if prefixes is None:
Expand Down
1 change: 0 additions & 1 deletion chempy/util/tests/test_parsing.py
Expand Up @@ -752,7 +752,6 @@ def test_formula_to_html_caged(species, html):
assert formula_to_html(species) == html



def test_composition_dot_as_crystal_water_chempy08x():
ref = {30: 1, 7: 2, 8: 12, 1: 12}
assert formula_to_composition('Zn(NO3)2{}6H2O'.format('\u00B7')) == ref
Expand Down

0 comments on commit 74e83f3

Please sign in to comment.