Skip to content

Commit

Permalink
add https filesystem and support load yaml from url
Browse files Browse the repository at this point in the history
  • Loading branch information
niyiyu committed Feb 21, 2024
1 parent d4cab8d commit 8a532f3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/noisepy/seis/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from noisepy.seis.constants import AWS_EXECUTION_ENV

S3_SCHEME = "s3"
HTTPS_SCHEME = "https"
FIND_RETRIES = 5
FIND_RETRY_SLEEP = 0.1 # (100ms)
utils_logger = logging.getLogger(__name__)
Expand All @@ -28,6 +29,8 @@ def get_filesystem(path: str, storage_options: dict = {}) -> fsspec.AbstractFile
storage_options = storage_options.get(url.scheme, storage_options)
if url.scheme == S3_SCHEME:
return fsspec.filesystem(url.scheme, **storage_options)
elif url.scheme == HTTPS_SCHEME:
return fsspec.filesystem(url.scheme)

Check warning on line 33 in src/noisepy/seis/utils.py

View check run for this annotation

Codecov / codecov/patch

src/noisepy/seis/utils.py#L33

Added line #L33 was not covered by tests
else:
return fsspec.filesystem("file", **storage_options)

Expand Down

0 comments on commit 8a532f3

Please sign in to comment.