Commit a17493d1 authored by damb's avatar damb
Browse files

[DOC]: Add docstrings

parent 946d7621
......@@ -12,8 +12,6 @@ _ATTR_PREFIX = 'm_'
# XXX(damb): Currently, there are no validation facilities implemented.
#XXX(damb): Finish off docstrings
class QuakeMLQuantityField(fields.Field):
"""
......@@ -66,6 +64,9 @@ class SchemaBase(Schema):
class HydraulicSampleSchema(SchemaBase):
"""
Schema implementation of an hydraulic data sample.
"""
datetime = QuakeMLQuantityField()
downtemperature = QuakeMLQuantityField()
downflow = QuakeMLQuantityField()
......@@ -80,6 +81,9 @@ class HydraulicSampleSchema(SchemaBase):
class BoreholeSectionSchema(SchemaBase):
"""
Schema implementation of a borehole section.
"""
starttime = fields.DateTime(format='iso')
endtime = fields.DateTime(format='iso')
toplongitude = QuakeMLQuantityField()
......@@ -102,6 +106,9 @@ class BoreholeSectionSchema(SchemaBase):
class BoreholeSchema(SchemaBase):
"""
Schema implementation of a borehole.
"""
# TODO(damb): Provide a hierarchical implementation of sub_types; create
# them dynamically (see: e.g. QuakeMLQuantityField)
longitude = QuakeMLQuantityField()
......
......@@ -31,16 +31,35 @@ class ResourceBase(Resource):
self.logger = logging.getLogger(logger if logger else self.LOGGER)
def get(self):
"""
Template method to be implemented by HYDWS resources in order to serve
HTTP GET requests.
"""
raise NotImplementedError
def _handle_nodata(self, kwargs):
def _handle_nodata(self, query_params):
"""
Handle an empty query result
:param dict query_params: Dict of query parameters
:raises: :py:class:`FDSNHTTPError`
"""
raise FDSNHTTPError.create(
int(kwargs.get(
int(query_params.get(
'nodata',
settings.FDSN_DEFAULT_NO_CONTENT_ERROR_CODE)))
def _process_request(self, borehole_id=None, section_id=None,
**query_params):
"""
Template method intended to process a request
:param borehole_id: Borehole publicid
:type borehole_id: str or None
:param section_id: Borehole section publicid
:type section_id: str or None
"""
raise NotImplementedError
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment