[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
71985d5e3a
commit
de3b6c9573
@ -3,9 +3,11 @@
|
|||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import os, sys
|
import os, sys
|
||||||
|
|
||||||
sys.path.insert(0, os.path.abspath("scripts"))
|
sys.path.insert(0, os.path.abspath("scripts"))
|
||||||
from _helpers import validate_checksum
|
from _helpers import validate_checksum
|
||||||
|
|
||||||
|
|
||||||
def memory(w):
|
def memory(w):
|
||||||
factor = 3.0
|
factor = 3.0
|
||||||
for o in w.opts.split("-"):
|
for o in w.opts.split("-"):
|
||||||
|
@ -340,8 +340,8 @@ def get_checksum_from_zenodo(file_url):
|
|||||||
def validate_checksum(file_path, zenodo_url=None, checksum=None):
|
def validate_checksum(file_path, zenodo_url=None, checksum=None):
|
||||||
"""
|
"""
|
||||||
Validate file checksum against provided or Zenodo-retrieved checksum.
|
Validate file checksum against provided or Zenodo-retrieved checksum.
|
||||||
Calculates the hash of a file using 64KB chunks. Compares it against a given
|
Calculates the hash of a file using 64KB chunks. Compares it against a
|
||||||
checksum or one from a Zenodo URL.
|
given checksum or one from a Zenodo URL.
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
----------
|
----------
|
||||||
@ -360,8 +360,11 @@ def validate_checksum(file_path, zenodo_url=None, checksum=None):
|
|||||||
|
|
||||||
Examples
|
Examples
|
||||||
--------
|
--------
|
||||||
>>> validate_checksum('/path/to/file', checksum='md5:abc123...')
|
>>> validate_checksum("/path/to/file", checksum="md5:abc123...")
|
||||||
>>> validate_checksum('/path/to/file', zenodo_url='https://zenodo.org/record/12345/files/example.txt')
|
>>> validate_checksum(
|
||||||
|
... "/path/to/file",
|
||||||
|
... zenodo_url="https://zenodo.org/record/12345/files/example.txt",
|
||||||
|
... )
|
||||||
|
|
||||||
If the checksum is invalid, an AssertionError will be raised.
|
If the checksum is invalid, an AssertionError will be raised.
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user