Skip to content

Commit

Permalink
fix memory unit case
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielYang59 committed May 18, 2024
1 parent 14b7357 commit f8dfc92
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions pymatgen/core/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@
"intensity": {"cd": 1},
"memory": {
"byte": 1,
"Kb": 1024,
"Mb": 1024**2,
"Gb": 1024**3,
"Tb": 1024**4,
"KB": 1024,
"MB": 1024**2,
"GB": 1024**3,
"TB": 1024**4,
},
}

Expand Down
4 changes: 2 additions & 2 deletions tests/core/test_units.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ def test_length(self):
assert str(y.unit) == "ang^3"

def test_memory(self):
mega = Memory(1, "Mb")
mega = Memory(1, "MB")
assert mega.to("byte") == 1024**2
assert mega == Memory(1, "mb")

same_mega = Memory.from_str("1Mb")
same_mega = Memory.from_str("1MB")
assert same_mega.unit_type == "memory"

other_mega = Memory.from_str("+1.0 mb")
Expand Down

0 comments on commit f8dfc92

Please sign in to comment.