Skip to content

Commit

Permalink
Cleanup satpy demo sphinx documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
djhoese committed Apr 9, 2019
1 parent 6e76f37 commit 834329a
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 26 deletions.
12 changes: 0 additions & 12 deletions doc/source/api/satpy.demo.rst
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
satpy.demo package
==================

Submodules
----------

satpy.demo.google\_cloud\_platform module
-----------------------------------------

.. automodule:: satpy.demo.google_cloud_platform
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

Expand Down
10 changes: 9 additions & 1 deletion doc/source/api/satpy.readers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ satpy.readers.viirs\_compact module
:show-inheritance:

satpy.readers.viirs\_edr\_active\_fires module
--------------------------------------
----------------------------------------------

.. automodule:: satpy.readers.viirs_edr_active_fires
:members:
Expand Down Expand Up @@ -396,6 +396,14 @@ satpy.readers.viirs\_sdr module
:undoc-members:
:show-inheritance:

satpy.readers.virr\_l1b module
------------------------------

.. automodule:: satpy.readers.virr_l1b
:members:
:undoc-members:
:show-inheritance:

satpy.readers.xmlformat module
------------------------------

Expand Down
7 changes: 5 additions & 2 deletions doc/source/data_download.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ Downloading Data
================

One of the main features of Satpy is its ability to read various satellite
data formats. However, it does not currently provide any functionality for
downloading data from any remote sources. Satpy assumes all data is available
data formats. However, it currently only provides limited methods for
downloading data from remote sources and these methods are limited to demo
data for `Pytroll examples <https://github.com/pytroll/pytroll-examples>`_.
See the examples and the :mod:`~satpy.demo` API documentation for details.
Otherwise, Satpy assumes all data is available
through the local system, either as a local directory or network
mounted file systems. Certain readers that use ``xarray`` to open data files
may be able to load files from remote systems by using OpenDAP or similar
Expand Down
17 changes: 11 additions & 6 deletions satpy/demo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,22 @@
for how the data is downloaded (via the ``method`` keyword argument)
including:
- gcsfs: Download data from a public google cloud storage bucket using the
- gcsfs:
Download data from a public google cloud storage bucket using the
``gcsfs`` package.
- unidata_thredds: Access data using OpenDAP or similar method from Unidata's
- unidata_thredds:
Access data using OpenDAP or similar method from Unidata's
public THREDDS server
(https://thredds.unidata.ucar.edu/thredds/catalog.html).
- uwaos_thredds: Access data using OpenDAP or similar method from the
- uwaos_thredds:
Access data using OpenDAP or similar method from the
University of Wisconsin - Madison's AOS department's THREDDS server.
- http: A last resort download method when nothing else is available of a
- http:
A last resort download method when nothing else is available of a
tarball or zip file from one or more servers available to the Satpy
project.
- uw_arcdata: A network mount available on many servers at the Space Science
- uw_arcdata:
A network mount available on many servers at the Space Science
and Engineering Center (SSEC) at the University of Wisconsin - Madison.
This is method is mainly meant when tutorials are taught at the SSEC
using a Jupyter Hub server.
Expand Down Expand Up @@ -82,7 +87,7 @@ def get_us_midlatitude_cyclone_abi(base_dir='.', method=None, force=False):
raise NotImplementedError("Demo data download method '{}' not "
"implemented yet.".format(method))

from .google_cloud_platform import get_bucket_files
from ._google_cloud_platform import get_bucket_files
patterns = ['gs://gcp-public-data-goes-16/ABI-L1b-RadC/2019/073/00/*0002*.nc']
subdir = os.path.join(base_dir, 'abi_l1b', '20190314_us_midlatitude_cyclone')
makedirs(subdir, exist_ok=True)
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion satpy/readers/viirs_edr_active_fires.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
#
#
"""VIIRS Active Fires reader
*********************
*************************
This module implements readers for VIIRS Active Fires NetCDF and
ASCII files.
"""
Expand Down
2 changes: 1 addition & 1 deletion satpy/readers/viirs_sdr.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def get_dataset(self, dataset_id, ds_info):
scans actually sensed, and not necessarily the regular 768 scanlines
that the file contains for each granule. To that end, the number of
scans for each granule is read from:
`Data_Products/...Gran_x/N_Number_Of_Scans`.
``Data_Products/...Gran_x/N_Number_Of_Scans``.
"""
dataset_group = [ds_group for ds_group in ds_info['dataset_groups'] if ds_group in self.datasets]
if not dataset_group:
Expand Down
6 changes: 3 additions & 3 deletions satpy/tests/test_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ class TestGCPUtils(unittest.TestCase):
@mock.patch('satpy.demo.google_cloud_platform.urlopen')
def test_is_gcp_instance(self, uo):
"""Test is_google_cloud_instance."""
from satpy.demo.google_cloud_platform import is_google_cloud_instance, URLError
from satpy.demo._google_cloud_platform import is_google_cloud_instance, URLError
uo.side_effect = URLError("Test Environment")
self.assertFalse(is_google_cloud_instance())

@mock.patch('satpy.demo.google_cloud_platform.gcsfs')
def test_get_bucket_files(self, gcsfs_mod):
"""Test get_bucket_files basic cases."""
from satpy.demo.google_cloud_platform import get_bucket_files
from satpy.demo._google_cloud_platform import get_bucket_files
gcsfs_mod.GCSFileSystem = mock.MagicMock()
gcsfs_inst = mock.MagicMock()
gcsfs_mod.GCSFileSystem.return_value = gcsfs_inst
Expand Down Expand Up @@ -99,7 +99,7 @@ def test_get_bucket_files(self, gcsfs_mod):
@mock.patch('satpy.demo.google_cloud_platform.gcsfs', None)
def test_no_gcsfs(self):
"""Test that 'gcsfs' is required."""
from satpy.demo.google_cloud_platform import get_bucket_files
from satpy.demo._google_cloud_platform import get_bucket_files
self.assertRaises(RuntimeError, get_bucket_files, '*.nc', '.')


Expand Down

0 comments on commit 834329a

Please sign in to comment.