argopy.set_options

argopy.set_options#

class set_options(**kwargs)[source]#

Set options for argopy

Parameters:
  • ds (str, default: phy) – Define the Dataset to work with: phy, bgc or ref

  • src (str, default: erddap) – Source of fetched data: erddap, gdac, argovis

  • mode (str, default: standard) – User mode: standard, expert or research

  • gdac (str, default: https://data-argo.ifremer.fr) – Default path to be used by the GDAC fetchers and Argo index stores

  • 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

  • parallel (bool, str, distributed.Client, default: False) –

    Set whether to use parallelisation or not, and possibly which method to use.

    Possible values:
    • False: no parallelisation is used

    • True: use default method specified by the parallel_default_method option (see below)

    • any other values accepted by the parallel_default_method option (see below)

  • parallel_default_method (str, distributed.Client, default: thread) –

    The default parallelisation method to use if the option parallel is simply set to True.

  • server (: str, default: None) –

    Other than expected/default server to be uses by a function/method

    This is mostly intended to be used by unit tests.

Examples

You can use set_options either 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

__init__(**kwargs)[source]#

Methods

__init__(**kwargs)