File tree Expand file tree Collapse file tree 4 files changed +9
-10
lines changed Expand file tree Collapse file tree 4 files changed +9
-10
lines changed Original file line number Diff line number Diff line change 45
45
strategy :
46
46
matrix :
47
47
os : [ubuntu-latest, macos-14, windows-latest]
48
- python-version : ["39", " 310", "311", "312"]
48
+ python-version : ["310", "311", "312"]
49
49
runs-on : ${{ matrix.os }}
50
50
steps :
51
51
- name : Check out repo
Original file line number Diff line number Diff line change @@ -92,12 +92,11 @@ class Pseudo(MSONable, abc.ABC):
92
92
"""
93
93
94
94
@classmethod
95
- def as_pseudo (cls , obj ):
96
- """
97
- Convert obj into a pseudo. Accepts:
95
+ def as_pseudo (cls , obj : Self | str ) -> Self :
96
+ """Convert obj into a Pseudo.
98
97
99
- * Pseudo object.
100
- * string defining a valid path .
98
+ Args:
99
+ obj (str | Pseudo): Path to the pseudo file or a Pseudo object .
101
100
"""
102
101
return obj if isinstance (obj , cls ) else cls .from_file (obj )
103
102
@@ -227,7 +226,7 @@ def compute_md5(self):
227
226
text = file .read ()
228
227
# usedforsecurity=False needed in FIPS mode (Federal Information Processing Standards)
229
228
# https://github.com/materialsproject/pymatgen/issues/2804
230
- md5 = hashlib .new ( " md5" , usedforsecurity = False ) # hashlib.md5 (usedforsecurity=False) is py39+
229
+ md5 = hashlib .md5 (usedforsecurity = False )
231
230
md5 .update (text .encode ("utf-8" ))
232
231
return md5 .hexdigest ()
233
232
Original file line number Diff line number Diff line change @@ -2327,7 +2327,7 @@ def get_hash(self) -> str:
2327
2327
"""Get a hash of this object."""
2328
2328
# usedforsecurity=False needed in FIPS mode (Federal Information Processing Standards)
2329
2329
# https://github.com/materialsproject/pymatgen/issues/2804
2330
- md5 = hashlib .new ( " md5" , usedforsecurity = False ) # hashlib.md5 (usedforsecurity=False) is py39+
2330
+ md5 = hashlib .md5 (usedforsecurity = False )
2331
2331
md5 .update (self .get_str ().lower ().encode ("utf-8" ))
2332
2332
return md5 .hexdigest ()
2333
2333
Original file line number Diff line number Diff line change @@ -2028,7 +2028,7 @@ def md5_computed_file_hash(self) -> str:
2028
2028
"""MD5 hash of the entire PotcarSingle."""
2029
2029
# usedforsecurity=False needed in FIPS mode (Federal Information Processing Standards)
2030
2030
# https://github.com/materialsproject/pymatgen/issues/2804
2031
- md5 = hashlib .new ( " md5" , usedforsecurity = False ) # hashlib.md5 (usedforsecurity=False) is py39+
2031
+ md5 = hashlib .md5 (usedforsecurity = False )
2032
2032
md5 .update (self .data .encode ("utf-8" ))
2033
2033
return md5 .hexdigest ()
2034
2034
@@ -2064,7 +2064,7 @@ def md5_header_hash(self) -> str:
2064
2064
self .hash_str = hash_str
2065
2065
# usedforsecurity=False needed in FIPS mode (Federal Information Processing Standards)
2066
2066
# https://github.com/materialsproject/pymatgen/issues/2804
2067
- md5 = hashlib .new ( " md5" , usedforsecurity = False ) # hashlib.md5 (usedforsecurity=False) is py39+
2067
+ md5 = hashlib .md5 (usedforsecurity = False )
2068
2068
md5 .update (hash_str .lower ().encode ("utf-8" ))
2069
2069
return md5 .hexdigest ()
2070
2070
You can’t perform that action at this time.
0 commit comments