Skip to content

Commit

Permalink
Minor docstring formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
blazs committed Jan 17, 2018
1 parent 7ddcbc0 commit 4b8d777
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 18 deletions.
8 changes: 4 additions & 4 deletions sentinelhub/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ class SGConfig:
""" This is a singleton implementation of the sentinelhub configuration class.
The class reads during its first initialisation the configurable settings from
./config.json file:
``./config.json`` file:
- ogc_base_url: base url for Sentinel Hub's services (should not be changed by the user)
- aws_base_url: base url for Sentinel-2 data on AWS (should not be changed by the user)
- aws_website_url: base url for AWS' public Sentinel-2 image browser
- instance_id: users' instance id. User can set it to his/hers instance id in config.json instead of specifying
it explicitly every time he/she creates new ogc request.
- instance_id: users' instance id. User can set it to his/hers instance id in ``config.json`` instead
of specifying it explicitly every time he/she creates new ogc request.
Usage in the code:
Expand All @@ -40,7 +40,7 @@ def _check_configuration(self, config):
"""
Checks if configuration file has contains all keys.
:param config: configuration dictionary read from `config.json`
:param config: configuration dictionary read from ``config.json``
:type config: dict
"""

Expand Down
20 changes: 12 additions & 8 deletions sentinelhub/data_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def get_data(self, save_data=False, redownload=False, max_threads=None):

def _update_download_requests(self, save_data):
"""
Updates attributes of download requests in download_list
Updates attributes of download requests in ``self.download_list``
:param save_data: Tells whether to save data or not
:type: bool
"""
Expand Down Expand Up @@ -178,7 +178,8 @@ class OgcRequest(DataRequest):
in some cases 32-bit TIFF is required, i.e. if requesting unprocessed raw bands.
Default is ``constants.MimeType.PNG``.
:type image_format: constants.MimeType
:param instance_id: user's instance id. If None the instance id is taken from the config.json configuration file.
:param instance_id: user's instance id. If ``None`` the instance id is taken from the ``config.json``
configuration file.
:type instance_id: str
:param custom_url_params: dictionary of CustomUrlParameters and their values supported by Sentinel Hub's WMS and WCS
services. All available parameters are described at
Expand Down Expand Up @@ -282,7 +283,8 @@ class WmsRequest(OgcRequest):
in some cases 32-bit TIFF is required, i.e. if requesting unprocessed raw bands.
Default is ``constants.MimeType.PNG``.
:type image_format: constants.MimeType
:param instance_id: user's instance id. If None the instance id is taken from the config.json configuration file.
:param instance_id: user's instance id. If ``None`` the instance id is taken from the ``config.json``
configuration file.
:type instance_id: str
:param custom_url_params: dictionary of CustomUrlParameters and their values supported by Sentinel Hub's WMS and WCS
services. All available parameters are described at
Expand Down Expand Up @@ -341,7 +343,8 @@ class WcsRequest(OgcRequest):
in some cases 32-bit TIFF is required, i.e. if requesting unprocessed raw bands.
Default is ``constants.MimeType.PNG``.
:type image_format: constants.MimeType
:param instance_id: user's instance id. If None the instance id is taken from the config.json configuration file.
:param instance_id: user's instance id. If ``None`` the instance id is taken from the ``config.json``
configuration file.
:type instance_id: str
:param custom_url_params: dictionary of CustomUrlParameters and their values supported by Sentinel Hub's WMS and WCS
services. All available parameters are described at
Expand Down Expand Up @@ -484,7 +487,7 @@ def create_request(self):

def get_safe_format(product_id=None, tile=None, entire_product=False, bands=None):
"""
Returns .SAFE format structure in form of nested dictionaries. Either product_id or tile must be specified.
Returns .SAFE format structure in form of nested dictionaries. Either ``product_id`` or ``tile`` must be specified.
:param product_id: original ESA product identification string. Default is ``None``
:type product_id: str
Expand All @@ -493,7 +496,7 @@ def get_safe_format(product_id=None, tile=None, entire_product=False, bands=None
:param entire_product: in case tile is specified this flag determines if it will be place inside a .SAFE structure
of the product. Default is ``False``
:type entire_product: bool
:param bands: list of bands to download. If None all bands will be downloaded. Default is ``None``
:param bands: list of bands to download. If ``None`` all bands will be downloaded. Default is ``None``
:type bands: list(str) or None
:return: Nested dictionaries representing .SAFE structure.
:rtype: dict
Expand All @@ -514,7 +517,8 @@ def get_safe_format(product_id=None, tile=None, entire_product=False, bands=None

def download_safe_format(product_id=None, tile=None, folder='.', redownload=False, entire_product=False, bands=None):
"""
Downloads .SAFE format structure in form of nested dictionaries. Either product_id or tile must be specified.
Downloads .SAFE format structure in form of nested dictionaries. Either ``product_id`` or ``tile`` must
be specified.
:param product_id: original ESA product identification string. Default is ``None``
:type product_id: str
Expand All @@ -528,7 +532,7 @@ def download_safe_format(product_id=None, tile=None, folder='.', redownload=Fals
:param entire_product: in case tile is specified this flag determines if it will be place inside a .SAFE structure
of the product. Default is ``False``
:type entire_product: bool
:param bands: list of bands to download. If None all bands will be downloaded. Default is ``None``
:param bands: list of bands to download. If ``None`` all bands will be downloaded. Default is ``None``
:type bands: list(str) or None
:return: Nested dictionaries representing .SAFE structure.
:rtype: dict
Expand Down
6 changes: 2 additions & 4 deletions sentinelhub/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,7 @@ def execute_download_request(request):


def _do_request(request):
"""
Executes download request
""" Executes download request
:param request: A request
:type: DownloadRequest
:return: Response of the request
Expand All @@ -231,8 +230,7 @@ def _do_request(request):


def _save_if_needed(request, response):
"""
Save data to disk, if requested by the user
""" Save data to disk, if requested by the user
:param request: Download request
:type: DownloadRequest
:param response: Response object from requests module
Expand Down
4 changes: 2 additions & 2 deletions sentinelhub/io_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def read_data(filename, data_format=None):
""" Read image data from file
This function reads input data from file. The format of the file
can be specified in data_format. If not specified, the format is
can be specified in ``data_format``. If not specified, the format is
guessed from the extension of the filename.
:param filename: filename to read data from
Expand Down Expand Up @@ -192,7 +192,7 @@ def write_tiff_image(filename, image, compress=False):
:type filename: str
:param image: image data to write to file
:type image: numpy array
:param compress: whether to compress data. If True, lzma compression is used. Default is ``False``
:param compress: whether to compress data. If ``True``, lzma compression is used. Default is ``False``
:type compress: bool
"""
if compress:
Expand Down

0 comments on commit 4b8d777

Please sign in to comment.