New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cdaweb direct file access #89
Conversation
9195a9c
to
385964e
Compare
9bb8937
to
842fe48
Compare
f5cf14e
to
2a535b9
Compare
|
||
RETRY_AFTER_LIST = [429, 503] # Note: Specific treatment for 429 & 503 error codes (see below) | ||
|
||
_HREF_REGEX = re.compile(' href="([A-Za-z0-9.-_]+)">') |
Check warning
Code scanning / CodeQL
Overly permissive regular expression range Medium
@@ -10,9 +10,9 @@ | |||
from .utils import load_catalog, load_csv, load_timetable | |||
# General modules | |||
from ...config import amda as amda_cfg | |||
from ...core.any_files import any_loc_open |
Check notice
Code scanning / CodeQL
Unused import Note
|
||
RETRY_AFTER_LIST = [429, 503] # Note: Specific treatment for 429 & 503 error codes (see below) | ||
|
||
_HREF_REGEX = re.compile(' href="([A-Za-z0-9.-_]+)">') |
Check notice
Code scanning / CodeQL
Unused global variable Note
9b35369
to
7ad431e
Compare
@@ -104,13 +105,13 @@ | |||
return root | |||
|
|||
|
|||
def _read_cdf(response: requests.Response, variable: str) -> SpeasyVariable: | |||
with tarfile.open(fileobj=BytesIO(response.content)) as tar: | |||
def _load_variable(archive: io.BytesIO, variable: str) -> SpeasyVariable: |
Check notice
Code scanning / CodeQL
Explicit returns mixed with implicit (fall through) returns Note
# -*- coding: utf-8 -*- | ||
|
||
"""Tests for `speasy.common` package.""" | ||
import re |
Check notice
Code scanning / CodeQL
Unused import Note
|
||
from speasy.core.url_utils import ensure_url_scheme, is_local_file | ||
|
||
_HERE_ = os.path.dirname(os.path.abspath(__file__)) |
Check notice
Code scanning / CodeQL
Unused global variable Note
This reduces a lot functions signature size... Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
…tring Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
…y extractor Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
… and remote files + regex filter and file list for archive module Since cda archive datasets have different cdf versions across the same year, this PR adds the capability to list files from remote location parsing html pages such as apache mod_dir generated ones. This allows to give some predictable url base with a small regex part to filter matching files from either remote or local location. Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
7a0c591
to
48d5af9
Compare
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #89 +/- ##
==========================================
+ Coverage 83.86% 86.49% +2.62%
==========================================
Files 45 51 +6
Lines 2771 3043 +272
Branches 437 473 +36
==========================================
+ Hits 2324 2632 +308
+ Misses 316 276 -40
- Partials 131 135 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
c87626a
to
bb1ce68
Compare
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
c100877
to
b1a1e8b
Compare
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
headers usage Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2acbe77
to
256f49a
Compare
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
@brenard-irap can we merge this now? |
Big PR, mostly adding direct archive support plus some refactoring around http module.
Direct Archive support means, Speasy can access servers with no webservices or any local folder as long as:
Most interesting parts for review are:
The module is documented here and human readable here.
This PR also adds PyYAML as new dependency.