Skip to content

Commit 88c5af0

Browse files
committed
Merge branch 'staging'
2 parents 2843493 + 18cef6e commit 88c5af0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1925
-1414
lines changed

.flake8

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[flake8]
2+
extend-ignore = E203, E501, E722, B950, T001
3+
select = C,E,F,W,T,B,B9,I
4+
per-file-ignores =
5+
tests/*: T
6+
noxfile.py: T
7+
__init__.py:F401

.github/workflows/CI.yml

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,41 @@
11
name: CI
22

3+
34
on:
4-
push:
5-
branches: [ staging ]
5+
workflow_dispatch:
66
pull_request:
7+
push:
78
branches: [ staging ]
8-
workflow_dispatch:
99

1010
jobs:
11-
run-tests:
12-
runs-on: ${{ matrix.operating-system }}
11+
pre-commit:
12+
name: Format
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v1
16+
- uses: actions/setup-python@v2
17+
- uses: pre-commit/[email protected]
18+
with:
19+
extra_args: --hook-stage manual --all-files
20+
21+
checks:
22+
name: Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}
23+
runs-on: ${{ matrix.runs-on }}
1324
strategy:
25+
fail-fast: false
1426
matrix:
15-
operating-system:
16-
- ubuntu-latest
17-
- windows-latest
18-
- macOS-latest
27+
python-version: ["3.6", "3.10"]
28+
runs-on: [ubuntu-latest, macos-latest, windows-latest]
1929
steps:
20-
- name: Checkout
21-
uses: actions/checkout@v2
22-
- name: Setup Nox
23-
uses: excitedleigh/[email protected]
24-
- name: Run Nox
25-
run: nox
30+
- uses: actions/checkout@v2
31+
- uses: actions/setup-python@v2
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
- name: Install package
35+
run: python -m pip install .[test]
36+
- name: Configure token access
37+
run: |
38+
viresclient set_token "https://vires.services/ows" ${{ secrets.VIRES_TOKEN_SWARM }}
39+
viresclient set_default_server https://vires.services/ows
40+
- name: Test package
41+
run: python -m pytest -ra

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ MANIFEST
3434
docs/_build/
3535

3636
# nox
37-
.nox
37+
.nox

.pre-commit-config.yaml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
repos:
2+
- repo: https://github.com/psf/black
3+
rev: 22.3.0
4+
hooks:
5+
- id: black-jupyter
6+
7+
- repo: https://github.com/kynan/nbstripout
8+
rev: "0.5.0"
9+
hooks:
10+
- id: nbstripout
11+
12+
- repo: https://github.com/pre-commit/pre-commit-hooks
13+
rev: v4.1.0
14+
hooks:
15+
- id: check-added-large-files
16+
- id: check-case-conflict
17+
- id: check-merge-conflict
18+
- id: check-symlinks
19+
- id: check-yaml
20+
- id: debug-statements
21+
- id: end-of-file-fixer
22+
- id: mixed-line-ending
23+
- id: requirements-txt-fixer
24+
- id: trailing-whitespace
25+
26+
- repo: https://github.com/pre-commit/pygrep-hooks
27+
rev: v1.9.0
28+
hooks:
29+
- id: python-check-blanket-noqa
30+
# - id: python-check-blanket-type-ignore
31+
- id: python-no-eval
32+
- id: python-use-type-annotations
33+
- id: rst-backticks
34+
- id: rst-directive-colons
35+
- id: rst-inline-touching-normal
36+
37+
- repo: https://github.com/PyCQA/isort
38+
rev: 5.10.1
39+
hooks:
40+
- id: isort
41+
# args: ["-a", "from __future__ import annotations"] # Python 3.7+
42+
43+
- repo: https://github.com/asottile/pyupgrade
44+
rev: v2.31.1
45+
hooks:
46+
- id: pyupgrade
47+
args: ["--py37-plus"]
48+
49+
# - repo: https://github.com/hadialqattan/pycln
50+
# rev: v1.1.0
51+
# hooks:
52+
# - id: pycln
53+
# args: [--config=pyproject.toml]
54+
55+
- repo: https://github.com/asottile/yesqa
56+
rev: v1.3.0
57+
hooks:
58+
- id: yesqa
59+
exclude: docs/conf.py
60+
additional_dependencies: &flake8_dependencies
61+
- flake8-bugbear
62+
- flake8-print
63+
64+
- repo: https://github.com/pycqa/flake8
65+
rev: 4.0.1
66+
hooks:
67+
- id: flake8
68+
exclude: docs/conf.py
69+
additional_dependencies: *flake8_dependencies
70+
71+
# - repo: https://github.com/pre-commit/mirrors-mypy
72+
# rev: v0.930
73+
# hooks:
74+
# - id: mypy
75+
# files: src
76+
# args: [--show-error-codes]
77+
78+
# - repo: https://github.com/codespell-project/codespell
79+
# rev: v2.1.0
80+
# hooks:
81+
# - id: codespell
82+
83+
- repo: https://github.com/shellcheck-py/shellcheck-py
84+
rev: v0.8.0.4
85+
hooks:
86+
- id: shellcheck
87+
88+
- repo: local
89+
hooks:
90+
- id: disallow-caps
91+
name: Disallow improper capitalization
92+
language: pygrep
93+
entry: PyBind|Numpy|Cmake|CCache|Github|PyTest
94+
exclude: .pre-commit-config.yaml

.readthedocs.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# .readthedocs.yml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
# Build documentation in the docs/ directory with Sphinx
9+
sphinx:
10+
configuration: docs/conf.py
11+
12+
# Include PDF and ePub
13+
formats: all
14+
15+
python:
16+
version: 3.8
17+
install:
18+
- method: pip
19+
path: .
20+
extra_requirements:
21+
- docs

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ viresclient_ is a Python package which connects to a VirES server, of which ther
2828

2929
For code recipes and more, see `Swarm Notebooks`_ & `Aeolus Notebooks`_. To start experimenting right away, *viresclient* is installed on the "Virtual Research Environment" (VRE), which is a managed Jupyter-based system provided for ESA by EOX. The service is free and open to all, accessible through your VirES account - check the notebooks to read more and get started.
3030

31-
.. _`Swarm Notebooks`: https://swarm.magneticearth.org
31+
.. _`Swarm Notebooks`: https://notebooks.vires.services
3232
.. _`Aeolus Notebooks`: https://notebooks.aeolus.services
3333

3434
Data and models are processed on demand on the VirES server - a combination of measurements from any time interval can be accessed. These are the same data that can be accessed by the VirES GUI. *viresclient* handles the returned data to allow direct loading as a single pandas.DataFrame_, or xarray.Dataset_.
@@ -101,6 +101,6 @@ You can reference *viresclient* directly using the DOI of our zenodo_ record. Vi
101101

102102
.. _zenodo: https://doi.org/10.5281/zenodo.2554162
103103

104-
| "We use the Python package, viresclient [1], to access [...] from ESA's VirES for Swarm service [2]"
105-
| [1] https://doi.org/10.5281/zenodo.2554162
104+
| "We use the Python package, viresclient [1], to access [...] from ESA's VirES for Swarm service [2]"
105+
| [1] https://doi.org/10.5281/zenodo.2554162
106106
| [2] https://vires.services

docs/access_token.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ The tokens are managed via the web user interface.
66

77
Assuming you have an existing VirES account and you can access
88
the VirES web client (https://vires.services or https://aeolus.services),
9-
you get to token manager via `Manage access tokens` item in your account menu
9+
you get to token manager via *Manage access tokens* item in your account menu
1010
(displaying your username)
1111

1212
.. image:: images/vires_token_manager_menu.png
1313
:align: center
1414

1515
The token manager user interface allows creation of new tokens by pressing the
16-
`Create New Access Token` button
16+
*Create New Access Token* button
1717

1818
.. image:: images/vires_token_manager_create_blank.png
1919
:align: center
@@ -24,7 +24,7 @@ brief label indicating its purpose
2424
.. image:: images/vires_token_manager_create_filled.png
2525
:align: center
2626

27-
Once the `Create New Access Token` button has been pressed, a new token is
27+
Once the *Create New Access Token* button has been pressed, a new token is
2828
generated and displayed to the user
2929

3030
.. image:: images/vires_token_manager_new_token.png
@@ -42,4 +42,3 @@ The token manager list the active access tokens and allows their revocation
4242
*The tokens are secret.* Therefore, do not keep thier copies or share them
4343
with others. When a token is needed generate new one. When a token is no
4444
longer needed revoke it.
45-

docs/api.rst

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
API Reference
2+
=============
3+
14
SwarmRequest
2-
============
5+
------------
36

47
.. autoclass:: viresclient.SwarmRequest
58
:members:
@@ -9,7 +12,7 @@ SwarmRequest
912
:exclude-members: AUXILIARY_VARIABLES, COLLECTIONS, COLLECTION_SAMPLING_STEPS, MAGNETIC_MODELS, MAGNETIC_MODEL_VARIABLES, OBS_COLLECTIONS, PRODUCT_VARIABLES
1013

1114
AeolusRequest
12-
=============
15+
-------------
1316

1417
.. autoclass:: viresclient.AeolusRequest
1518
:members:
@@ -18,7 +21,7 @@ AeolusRequest
1821
:inherited-members:
1922

2023
ReturnedData
21-
============
24+
------------
2225

2326
.. autoclass:: viresclient.ReturnedData
2427
:members:
@@ -34,7 +37,7 @@ ReturnedData
3437

3538

3639
ClientConfig
37-
============
40+
------------
3841

3942
.. autoclass:: viresclient.ClientConfig
4043
:members:
@@ -43,12 +46,12 @@ ClientConfig
4346
:inherited-members:
4447

4548
set_token
46-
=========
49+
---------
4750

4851
.. autofunction:: viresclient.set_token
4952

5053
DataUpload
51-
==========
54+
----------
5255

5356
.. autoclass:: viresclient.DataUpload
5457
:members:

docs/available_parameters.rst

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Available parameters for Swarm
33

44
.. note::
55

6-
| `See also: Jupyter notebook about data and model availability <https://swarm.magneticearth.org/notebooks/02b__viresclient-available-data>`_ - check out the other demo notebooks there too.
6+
| `See also: Jupyter notebook about data and model availability <https://notebooks.vires.services/notebooks/02b__viresclient-available-data>`_ - check out the other demo notebooks there too.
77
88
You can check which parameters are available with:
99

@@ -25,7 +25,7 @@ See the `Swarm Data Handbook`_ for details about the products and `Swarm Product
2525

2626
.. _`Swarm Data Handbook`: https://earth.esa.int/eogateway/missions/swarm/product-data-handbook
2727

28-
.. _`Swarm Product Demos`: https://swarm.magneticearth.org/notebooks/03a1_demo-magx_lr_1b
28+
.. _`Swarm Product Demos`: https://notebooks.vires.services/notebooks/03a1_demo-magx_lr_1b
2929

3030
----
3131

@@ -73,7 +73,7 @@ SW_OPER_MITx_LP_2F MIT_LP Minima of the Midlatitude Ionospheric Tr
7373
SW_OPER_MITx_LP_2F:ID MIT_LP:ID -> Boundaries of the MIT - derived from the LP
7474
SW_OPER_MITxTEC_2F MIT_TEC Minima of the MIT - derived from Total Electron Content (TEC)
7575
SW_OPER_MITxTEC_2F:ID MIT_TEC:ID -> Boundaries of the MIT - derived from TEC
76-
SW_OPER_PPIxFAC_2F PPI_FAC Midnight Plasmapause Index (PPI)
76+
SW_OPER_PPIxFAC_2F PPI_FAC Midnight Plasmapause Index (PPI)
7777
SW_OPER_PPIxFAC_2F:ID PPI_FAC:ID -> Boundaries of the Small-Scale Field Aligned Currents (SSFAC)
7878
====================== ================ ===================================================================================================
7979

@@ -125,7 +125,7 @@ The ``measurements``, ``models``, and ``auxiliaries`` chosen will match the cade
125125
----
126126

127127
``measurements``
128-
----------------
128+
----------------
129129

130130
Choose combinations of measurements from one of the following sets, corresponding to the collection chosen above. The collection full name or collection type can be given to :py:meth:`viresclient.SwarmRequest.available_measurements` to retrieve the list of available measurements for a given collection (e.g. ``request.available_measurements("SW_OPER_MAGA_LR_1B")``)
131131

@@ -184,7 +184,7 @@ AUX_OBSH contains a special variable, ``ObsIndex``, which is set to 0, 1, 2 ...
184184

185185
VOBS products:
186186

187-
==================================== ===========================================
187+
==================================== ===========================================
188188
Collection full name Available measurement names
189189
==================================== ===========================================
190190
SW_OPER_VOBS_1M_2\_ ``SiteCode,B_CF,B_OB,sigma_CF,sigma_OB``
@@ -205,7 +205,7 @@ Models are evaluated along the satellite track at the positions of the time seri
205205
For a good estimate of the ionospheric field measured by a Swarm satellite (with the core, crust and magnetosphere effects removed) use a composed model defined as:
206206
``models=["'CHAOS-full' = 'CHAOS-Core' + 'CHAOS-Static' + 'CHAOS-MMA-Primary' + 'CHAOS-MMA-Secondary'"]``
207207
`(click for more info) <https://github.com/klaundal/notebooks/blob/master/get_external_field.ipynb>`_
208-
208+
209209
This composed model can also be accessed by an alias: ``models=["CHAOS"]`` which represents the full CHAOS model
210210

211211
See `Magnetic Earth <https://magneticearth.org/pages/models.html>`_ for an introduction to geomagnetic models.
@@ -292,8 +292,7 @@ NB: When using model names containing a hyphen (``-``) then extra single (``'``)
292292
.. note::
293293

294294
Check other packages such as `hapiclient`_ and others from `PyHC`_ for data from other sources.
295-
295+
296296
.. _`hapiclient`: https://github.com/hapi-server/client-python
297297

298298
.. _`PyHC`: http://heliopython.org/projects/
299-

docs/available_parameters_aeolus.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ Available parameters for Aeolus
22
===============================
33

44
.. note::
5-
Details to follow. See https://notebooks.aeolus.services for examples.
5+
Details to follow. See https://notebooks.aeolus.services for examples.

0 commit comments

Comments
 (0)