Skip to content

Commit 446a49c

Browse files
committed
Bump to v0.5.0 and update docs.
1 parent 8e4efeb commit 446a49c

File tree

10 files changed

+78
-52
lines changed

10 files changed

+78
-52
lines changed

docs/available_parameters.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ Models are evaluated along the satellite track at the positions of the time seri
9393
MCO_SHA_2D,
9494
MLI_SHA_2D,
9595
MIO_SHA_2D-Primary, MIO_SHA_2D-Secondary
96+
AMPS
9697

9798
# Fast-track models:
9899
MMA_SHA_2F-Primary, MMA_SHA_2F-Secondary,
@@ -134,10 +135,7 @@ NB: When using model names containing a hyphen (``-``) then extra single (``'``)
134135
AscendingNodeLongitude, QDLat, QDLon, QDBasis, MLT, SunDeclination,
135136
SunHourAngle, SunRightAscension, SunAzimuthAngle, SunZenithAngle,
136137
SunLongitude, SunVector, DipoleAxisVector, NGPLatitude, NGPLongitude,
137-
DipoleTiltAngle,
138-
139-
UpwardCurrent, TotalCurrent, # AMPS
140-
DivergenceFreeCurrentFunction, F_AMPS, B_NEC_AMPS # AMPS
138+
DipoleTiltAngle
141139

142140

143141
.. note::

docs/conf.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#
1515
import os
1616
import sys
17+
import urllib.request
1718
sys.path.insert(0, os.path.abspath('..'))
1819

1920

@@ -109,6 +110,14 @@
109110
#
110111
# html_sidebars = {}
111112

113+
# Fetch and use external logo
114+
logo_filename = 'vre_logo.svg'
115+
if not os.path.exists(logo_filename):
116+
urllib.request.urlretrieve(
117+
'https://raw.githubusercontent.com/ESA-VirES/Swarm-VRE/staging/docs/_static/vre_logo.svg',
118+
logo_filename)
119+
html_logo = logo_filename
120+
112121

113122
# -- Options for HTMLHelp output ---------------------------------------------
114123

docs/index.rst

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
Welcome to VirES-Python-Client's documentation!
22
===============================================
33

4+
.. toctree::
5+
:caption: Virtual Research Environment
6+
7+
--> [Launch VRE] <https://vre.vires.services/>
8+
--> [VRE docs] <https://swarm-vre.readthedocs.io/en/latest/intro.html>
9+
410
.. toctree::
511
:maxdepth: 2
6-
:caption: Overview
12+
:caption: Information on viresclient
713

814
readme
915
installation
1016
config_details
1117
access_token
1218
available_parameters
13-
release_notes
14-
15-
.. toctree::
16-
:maxdepth: 2
17-
:caption: Example notebooks
18-
1919
notebook_intro
20-
notebooks/simple_example
20+
release_notes
2121

2222
.. toctree::
2323
:maxdepth: 2
@@ -35,8 +35,5 @@ Welcome to VirES-Python-Client's documentation!
3535
:maxdepth: 2
3636
:caption: External Links
3737

38-
Notebook repository <https://nbviewer.jupyter.org/github/smithara/viresclient_examples/>
39-
VirES web interface <https://vires.services/>
40-
VirES-VRE <https://vre.vires.services/>
41-
viresclient GitHub <https://github.com/ESA-VirES/VirES-Python-Client/>
42-
Swarm-DISC GitHub <https://github.com/Swarm-DISC/>
38+
GitHub: viresclient <https://github.com/ESA-VirES/VirES-Python-Client/>
39+
GitHub: Swarm-DISC <https://github.com/Swarm-DISC/>

docs/installation.rst

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,11 @@ Recommended setup if starting without Python already
6161

6262
and follow the instructions.
6363

64-
[ Below instructions to be updated with new notebook. ]
64+
A first usage guide is provided as a Jupyter notebook (`view <https://nbviewer.jupyter.org/github/Swarm-DISC/Swarm_notebooks/blob/master/02a__Intro-Swarm-viresclient.ipynb>`_). To run the notebook on your computer running Jupyter locally, `right click here to download <https://raw.githubusercontent.com/Swarm-DISC/Swarm_notebooks/master/02a__Intro-Swarm-viresclient.ipynb>`_, or use git to get the whole example repository::
6565

66-
The guide for first time usage are also provided as a Jupyter notebook. Download the notebook to your environment and follow the instructions.
66+
git clone https://github.com/Swarm-DISC/Swarm_notebooks.git
6767

68-
https://github.com/smithara/viresclient_examples/blob/master/0_first_usage.ipynb
69-
70-
To download the whole example repository, open a terminal and do::
71-
72-
git clone https://github.com/smithara/viresclient_examples.git
73-
74-
then launch the notebook, ``viresclient_examples/0_first_usage.ipynb``
75-
76-
Access to the service is through the same user account as on the web interface (https://vires.services/) and is enabled through an access token (essentially a password). To get a token, log in to the website and click on your name on the top right to access the settings. From here, click on "Manage access tokens" and follow the instructions to create a new token.
68+
Access to the service is through the same user account as on the web interface (https://vires.services/) and is enabled through an access token (essentially a password). To get a token, log in to the website and click on your name on the top right to access the settings (`or follow this link <https://vires.services/accounts/tokens/>`_). From here, click on "Manage access tokens" and follow the instructions to create a new token.
7769

7870
To set your token in the client, use either the Python interface:
7971

docs/notebook_intro.rst

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,44 @@
11
Introduction to notebooks
22
=========================
33

4-
Jupyter notebooks are a convenient tool for interactive data exploration and are used here to demonstrate usage of ``viresclient``. We encourage users to try out Jupyter for themselves and to consider sharing notebooks with others. If you have a comment about one of the notebooks, or would like a particular demonstration, you can `open a GitHub Issue <https://github.com/smithara/viresclient_examples/issues/new>`_ or get in touch otherwise.
4+
Jupyter notebooks are a convenient tool for interactive data exploration, rapid prototyping, and producing reports. The Virtual Research Environment provides free JupyterLab instances with persistent storage where you can run notebooks working with Swarm data. For more information, see the `Swarm-VRE docs <https://swarm-vre.readthedocs.io/>`_.
55

6-
Click `here <https://nbviewer.jupyter.org/github/smithara/viresclient_examples/>`_ (nbviewer) to view viresclient_examples non-interactively. Sometimes notebooks won't render directly on the GitHub website - try `nbviewer <https://nbviewer.jupyter.org/>`_ instead.
76

8-
Here is a list of related notebook repositories where you are welcome to submit changes or additions. Please get in touch if you would like your own repository to be listed here.
97

10-
- https://github.com/smithara/viresclient_examples
11-
- https://github.com/pacesm/jupyter_notebooks
8+
.. list-table:: Notebook repositories
9+
:header-rows: 1
10+
:widths: 7 5 5
1211

13-
Other repositories with wider scope:
12+
* - Name (GitHub Link)
13+
- View (nbviewer)
14+
- Launch/interact (VRE)
15+
* - `Swarm-DISC/Swarm_notebooks <https://github.com/Swarm-DISC/Swarm_notebooks>`_
16+
- .. image:: https://img.shields.io/badge/render-nbviewer-orange.svg
17+
:target: https://nbviewer.jupyter.org/github/Swarm-DISC/Swarm_notebooks
18+
- (to do)
19+
* - `smithara/viresclient_examples <https://github.com/smithara/viresclient_examples>`_
20+
- .. image:: https://img.shields.io/badge/render-nbviewer-orange.svg
21+
:target: https://nbviewer.jupyter.org/github/smithara/viresclient_examples
22+
- (to do)
23+
* - `pacesm/jupyter_notebooks <https://github.com/pacesm/jupyter_notebooks>`_
24+
- .. image:: https://img.shields.io/badge/render-nbviewer-orange.svg
25+
:target: https://nbviewer.jupyter.org/github/pacesm/jupyter_notebooks
26+
- (to do)
1427

15-
- https://github.com/smithara/IAGA_SummerSchool2019
28+
29+
.. note::
30+
31+
Sometimes notebooks won't render directly on the GitHub website (or are slow). Try `nbviewer <https://nbviewer.jupyter.org/>`_ instead (see the "Render" links above).
32+
33+
Notebooks can be uploaded to JupyterLab using the "Upload" button (which means you must first download the notebooks to your computer from GitHub). To easily access a full repository, open a command line console and use git:
1634

1735
To clone a repository to your working space::
1836

19-
cd ~
20-
git clone https://github.com/smithara/viresclient_examples.git
37+
git clone https://github.com/Swarm-DISC/Swarm_notebooks.git
38+
39+
(this will clone it into ``Swarm_notebooks`` within your current directory)
2140

22-
To clear any changes you made and fetch the latest version::
41+
To clear any changes you made and fetch the latest version, from within ``Swarm_notebooks`` run::
2342

24-
cd ~/viresclient_examples/
2543
git fetch
2644
git reset --hard origin/master

docs/release_notes.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
Release notes
22
=============
33

4-
Changes from 0.4.3 to 0.5.0 (alpha)
5-
-----------------------------------
4+
Changes from 0.4.3 to 0.5.0
5+
---------------------------
66

77
- IGRF model series have changed name: ``IGRF-12`` is dropped in favour of ``IGRF`` which now provides the latest IGRF (currently IGRF-13)
8-
- ``request.available_collections("MAG")`` can now be called to filter by collection groups, and now returns a dict instead of a list
8+
- ``request.available_collections("MAG")`` can now be called to filter by collection groups, *and now returns a dict instead of a list*
99
- Improvements for ``xarray.Dataset`` support:
1010

1111
- NEC now provided as named coordinates for ``B_NEC``-type variables
12+
- Similarly (VFM, quaternion, WGS84) coordinates also provided for the variables ["B_VFM", "dB_Sun", "dB_AOCS", "dB_other", "B_error"], ["q_NEC_CRF"], ["GPS_Position", "LEO_Position"] respectively
1213
- Metadata (units and description) are now set for each variable
1314
- (With xarray 0.14+, try ``xarray.set_options(display_style="html")`` for nicer output)
14-
- Changed global attributes setting to set as "; "-separated strings instead of lists, to solve https://github.com/pydata/xarray/issues/3647
1515

1616
Changes from 0.4.2 to 0.4.3
1717
---------------------------

viresclient/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@
3434
from ._data_handling import ReturnedDataFile
3535
from ._api.upload import DataUpload
3636

37-
__version__ = "0.5.0-alpha"
37+
__version__ = "0.5.0"

viresclient/_client_swarm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ def available_collections(self, groupname=None, details=True):
508508
"""Show details of available collections.
509509
510510
Args:
511-
collection_group (str): one of: ("MAG", "EFI", etc.)
511+
groupname (str): one of: ("MAG", "EFI", etc.)
512512
details (bool): If True then print a nice output.
513513
If False then return a dict of available collections.
514514

viresclient/_config.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@ def set_token(url="https://vires.services/ows", token=None, set_default=False):
8282
if IN_JUPYTER:
8383
def _linkify(_url):
8484
if _url:
85-
return f'<a href="{_url}">{_url}</a>'
85+
return '<a href="{}">{}</a>'.format(_url, _url)
8686
else:
8787
return '(link not found)'
8888
display_html(
89-
f'Setting access token for {url}...<br>'
90-
f'Generate a token at {_linkify(url4token)}',
89+
'Setting access token for {}...<br>'.format(url)
90+
+ 'Generate a token at {}'.format(_linkify(url4token)),
9191
raw=True)
9292
else:
93-
print('Setting access token for', url, '...')
93+
print('Setting access token for', url, ' ...')
9494
url4token = url4token if url4token else '(link not found)'
9595
print('Generate a token at', url4token)
9696
token = getpass("Enter token:")

viresclient/_data_handling.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ def as_pandas_dataframe(self, expand=False):
181181
return df
182182

183183
def as_xarray_dataset(self):
184+
# NB currrently does not set the global metadata (attrs)
185+
# (avoids issues with concatenating them)
186+
# (this is done in ReturnedData)
184187
# Initialise dataset with time coordinate
185188
ds = xarray.Dataset(
186189
coords={"Timestamp":
@@ -620,13 +623,22 @@ def to_file(self, path, overwrite=False):
620623
Only write to file if it does not yet exist, or if overwrite=True.
621624
Currently handles CSV and CDF formats.
622625
626+
.. note::
627+
628+
This is currently only implemented for smaller data when the
629+
request has not been split into multiple requests - the limit is
630+
the equivalent of 50 days of 1Hz measurements. In these situations,
631+
you can still load the data as pandas/xarray objects (the contents
632+
of each file is automatically concatenated) and save them as a
633+
different file type. Or use ``.to_files()`` to save the split data
634+
directly.
635+
623636
Args:
624637
path (str): path to the file to save as
625638
overwrite (bool): Will overwrite existing file if True
626639
627640
"""
628641
if len(self.contents) != 1:
629-
raise Exception("Data is split into multiple files. "
630-
"Use .to_files instead"
631-
)
642+
raise NotImplementedError(
643+
"Data is split into multiple files. Use .to_files instead")
632644
self.contents[0].to_file(path, overwrite)

0 commit comments

Comments
 (0)