argopy.set_options#
- class set_options(**kwargs)[source]#
Set options for argopy
- Parameters:
dataset (str, default: 'phy') β
Define the Dataset to work with:
phy,bgcorrefDeprecated since version 0.1.17:
Replaced by
dsin versions >= v0.1.18
src (str, default: 'erddap') β Source of fetched data:
erddap,gdac,argovismode (str, default: 'standard') β User mode:
standard,expertorresearchftp (str, default: βhttps://data-argo.ifremer.frβ) β
Default path to be used by the GDAC fetchers and Argo index stores
Deprecated since version 0.1.17:
Replaced by
gdacin versions >= v0.1.18
erddap (str, default: βhttps://erddap.ifremer.fr/erddapβ) β Default server address to be used by the data and index erddap fetchers
cachedir (str, default: '~/.cache/argopy') β Absolute path to a local cache directory
cache_expiration (int, default: 86400) β Expiration delay of cache files in seconds
api_timeout (int, default: 60) β Time out for internet requests to web API, in seconds
trust_env (bool, default: False) β
Allow for local environment variables to be used to connect to the internet.
Argopy will get proxies information from HTTP_PROXY / HTTPS_PROXY environment variables if this option is True and it can also get proxy credentials from ~/.netrc file if this file exists
user (str, default: None) β Username to use when a simple authentication is required
password (str, default: None) β Password to use when a simple authentication is required
argovis_api_key (str, default:'guest') β
The API key to use when fetching data from the argovis data source
You can get a free key at https://argovis-keygen.colorado.edu
server (: str, default: None) β
Other than expected/default server to be uses by a function/method
This is mostly intended to be used for unit testing
Examples
You can use
set_optionseither as a context manager for temporary setting:>>> import argopy >>> with argopy.set_options(src='gdac'): >>> ds = argopy.DataFetcher().float(3901530).to_xarray()
or to set global options (at the beginning of a script for instance):
>>> argopy.set_options(src='gdac')
- Warns:
A DeprecationWarning can be raised when a deprecated option is set
Methods
__init__(**kwargs)