-
Notifications
You must be signed in to change notification settings - Fork 41
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
[WIP] Data fetcher for a local GDAC ftp copy #5
Conversation
- Data fetchers are responsible for: - loading all available data from a given source - making data compliant to Argo standards (data type, variable name, attributes, etc ...) - providing the end-user API (argopy.fetchers.ArgoDataFetcher) methods to filter data according to user level or requests. These must includes: 1. filter_data_mode 1. filter_qc 1. filter_variables
More cast_types
Arising from recent update at #11
This was required to avoid managing local ftp path. This commit creates ``argopy.set_options()`` to be used directly or within a context.
Codecov Report
@@ Coverage Diff @@
## master #5 +/- ##
=========================================
Coverage ? 77.76%
=========================================
Files ? 10
Lines ? 1030
Branches ? 0
=========================================
Hits ? 801
Misses ? 229
Partials ? 0
Continue to review full report at Codecov.
|
…dev/argopy into feature-fetch-local-ftp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't test much but no surprises so far. I let you merge the branch, I'll test more on master.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's new
Features and front-end API
- Added new data fetcher backend
localftp
in ArgoDataFetcher (c5f7cb6):
from argopy import DataFetcher as ArgoDataFetcher
argo_loader = ArgoDataFetcher(backend='localftp', path_ftp='/data/Argo/ftp_copy')
argo_loader.float(6902746).to_xarray()
- Introduced global OPTIONS to set values for: cache folder, dataset (eg:'phy' or 'bgc'), local ftp path, data fetcher ('erddap' or 'localftp') and user level ('standard' or 'expert'). Can be used in context
with
(83ccfb5):
with argopy.set_options(mode='expert', datasrc='erddap'):
ds = argopy.DataFetcher().float(3901530).to_xarray()
- Added a
argopy.tutorial
module to be able to load sample data for documentation and unit testing (4af09b5):
ftproot, flist = argopy.tutorial.open_dataset('localftp')
txtfile = argopy.tutorial.open_dataset('weekly_index_prof')
- Improved xarray argo accessor. Added methods for casting data types, to filter variables according to data mode, to filter variables according to quality flags. Useful methods to transform collection of points into collection of profiles, and vice versa (14cda55):
ds = argopy.DataFetcher().float(3901530).to_xarray() # get a collection of points
dsprof = ds.argo.point2profile() # transform to profiles
ds = dsprof.argo.profile2point() # transform to points
- Changed License from MIT to Apache (25f90c9)
Inner machinery
- Add
__all__
to controlfrom argopy import *
(83ccfb5) - All data fetchers inherit from class
ArgoDataFetcherProto
inproto.py
(44f45a5) - Data fetchers use default options from global OPTIONS
- In Erddap fetcher: methods to cast data type, to filter by data mode and by QC flags are now delegated to the xarray argo accessor methods.
- Data fetchers methods to filter variables according to user mode are using variable lists defined in utilities.
argopy.utilities
augmented with listing functions of: backends, standard variables and multiprofile files variables.- Introduce custom errors in errors.py (2563c9f)
- Front-end API ArgoDataFetcher uses a more general way of auto-discovering fetcher backend and their access points. Turned of the
deployments
access point, waiting for the index fetcher to do that. - Improved xarray argo accessor. More reliable
point2profile
and data type casting withcast_type
Many users or institutes work with a local copy of a GDAC ftp.
GDAC ftp (from Argo-France at Coriolis or Argo-US at AOML) are the official, and only reliable, Argo data access point.
Here, I want to merge work from https://github.com/euroargodev/argopy-osnet to the official
argopy
.The resulting API may look like: