Skip to content

Commit 4fa6c77

Browse files
authored
docs: Fixed errors on docs build from typos in docstrings, tutorials and .rst, as well as missreferenced links. (#275)
1 parent eb10890 commit 4fa6c77

21 files changed

+1133
-1171
lines changed

csep/__init__.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def query_comcat(start_time, end_time, min_magnitude=2.50,
214214
verbose (bool): print catalog summary statistics
215215
216216
Returns:
217-
:class:`csep.core.catalogs.CSEPCatalog
217+
:class:`csep.core.catalogs.CSEPCatalog`
218218
"""
219219

220220
# Timezone should be in UTC
@@ -273,7 +273,7 @@ def query_bsi(start_time, end_time, min_magnitude=2.50,
273273
verbose (bool): print catalog summary statistics
274274
275275
Returns:
276-
:class:`csep.core.catalogs.CSEPCatalog
276+
:class:`csep.core.catalogs.CSEPCatalog`
277277
"""
278278

279279
# Timezone should be in UTC
@@ -429,8 +429,8 @@ class with the region and magnitude members correctly assigned.
429429
Args:
430430
fname (str): path of grid based forecast
431431
loader (func): function to load forecast in bespoke format needs to return :class:`csep.core.forecasts.GriddedForecast`
432-
and first argument should be required and the filename of the forecast to load
433-
called as loader(func, **kwargs).
432+
and should be called with the filename of the forecast to load as the first argument,
433+
followed by additional keyword arguments, like this: ``loader(func, **kwargs)``.
434434
435435
**kwargs: passed into loader function
436436

csep/core/forecasts.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ def from_custom(cls, func, func_args=(), **kwargs):
363363
""" Creates MarkedGriddedDataSet class from custom parsing function.
364364
365365
Args:
366-
func (callable): function will be called as func(*func_args).
366+
func (callable): function will be called as func(func_args).
367367
func_args (tuple): arguments to pass to func
368368
**kwargs: keyword arguments to pass to the GriddedForecast class constructor.
369369
@@ -756,6 +756,7 @@ def load_ascii(cls, fname, **kwargs):
756756
fname (str): path to file or directory containing forecast files
757757
758758
Returns:
759-
:class:`csep.core.forecasts.CatalogForecast
759+
:class:`csep.core.forecasts.CatalogForecast`
760+
760761
"""
761762
raise NotImplementedError("load_ascii is not implemented!")

csep/utils/comcat.py

+70-91
Original file line numberDiff line numberDiff line change
@@ -80,110 +80,89 @@ def search(starttime=None,
8080
host=None,
8181
enable_limit=False,
8282
verbose=False):
83-
"""Search the ComCat database for events matching input criteria.
83+
"""
84+
85+
Search the ComCat database for events matching input criteria.
8486
This search function is a wrapper around the ComCat Web API described here:
8587
https://earthquake.usgs.gov/fdsnws/event/1/
8688
Some of the search parameters described there are NOT implemented here, usually because they do not
8789
apply to GeoJSON search results, which we are getting here and parsing into Python data structures.
8890
This function returns a list of SummaryEvent objects, described elsewhere in this package.
89-
Usage:
90-
TODO: Show usage information.
91+
9192
Args:
92-
starttime (datetime):
93-
Python datetime - Limit to events on or after the specified start time.
94-
endtime (datetime):
95-
Python datetime - Limit to events on or before the specified end time.
96-
updatedafter (datetime):
97-
Python datetime - Limit to events updated after the specified time.
98-
minlatitude (float):
99-
Limit to events with a latitude larger than the specified minimum.
100-
maxlatitude (float):
101-
Limit to events with a latitude smaller than the specified maximum.
102-
minlongitude (float):
103-
Limit to events with a longitude larger than the specified minimum.
104-
maxlongitude (float):
105-
Limit to events with a longitude smaller than the specified maximum.
106-
latitude (float):
107-
Specify the latitude to be used for a radius search.
108-
longitude (float):
109-
Specify the longitude to be used for a radius search.
110-
maxradiuskm (float):
111-
Limit to events within the specified maximum number of kilometers
93+
starttime (datetime): Limit to events on or after the specified start time.
94+
endtime (datetime): Limit to events on or before the specified end time.
95+
updatedafter (datetime): Limit to events updated after the specified time.
96+
minlatitude (float): Limit to events with a latitude larger than the specified minimum.
97+
maxlatitude (float): Limit to events with a latitude smaller than the specified maximum.
98+
minlongitude (float): Limit to events with a longitude larger than the specified minimum.
99+
maxlongitude (float): Limit to events with a longitude smaller than the specified maximum.
100+
latitude (float): Specify the latitude to be used for a radius search.
101+
longitude (float): Specify the longitude to be used for a radius search.
102+
maxradiuskm (float): Limit to events within the specified maximum number of kilometers
112103
from the geographic point defined by the latitude and longitude parameters.
113-
maxradius (float):
114-
Limit to events within the specified maximum number of degrees
104+
maxradius (float): Limit to events within the specified maximum number of degrees
115105
from the geographic point defined by the latitude and longitude parameters.
116-
catalog (str):
117-
Limit to events from a specified catalog.
118-
contributor (str):
119-
Limit to events contributed by a specified contributor.
120-
limit (int):
121-
Limit the results to the specified number of events.
122-
NOTE, this will be throttled by this Python API to the supported Web API limit of 20,000.
123-
maxdepth (float):
124-
Limit to events with depth less than the specified maximum.
125-
maxmagnitude (float):
126-
Limit to events with a magnitude smaller than the specified maximum.
127-
mindepth (float):
128-
Limit to events with depth more than the specified minimum.
129-
minmagnitude (float):
130-
Limit to events with a magnitude larger than the specified minimum.
131-
offset (int):
132-
Return results starting at the event count specified, starting at 1.
133-
orderby (str):
134-
Order the results. The allowed values are:
135-
- time order by origin descending time
136-
- time-asc order by origin ascending time
137-
- magnitude order by descending magnitude
138-
- magnitude-asc order by ascending magnitude
139-
alertlevel (str):
140-
Limit to events with a specific PAGER alert level. The allowed values are:
141-
- green Limit to events with PAGER alert level "green".
142-
- yellow Limit to events with PAGER alert level "yellow".
143-
- orange Limit to events with PAGER alert level "orange".
144-
- red Limit to events with PAGER alert level "red".
145-
eventtype (str):
146-
Limit to events of a specific type. NOTE: "earthquake" will filter non-earthquake events.
147-
maxcdi (float):
148-
Maximum value for Maximum Community Determined Intensity reported by DYFI.
149-
maxgap (float):
150-
Limit to events with no more than this azimuthal gap.
151-
maxmmi (float):
152-
Maximum value for Maximum Modified Mercalli Intensity reported by ShakeMap.
153-
maxsig (float):
154-
Limit to events with no more than this significance.
155-
mincdi (float):
156-
Minimum value for Maximum Community Determined Intensity reported by DYFI.
157-
minfelt (int):
158-
Limit to events with this many DYFI responses.
159-
mingap (float):
160-
Limit to events with no less than this azimuthal gap.
161-
minsig (float):
162-
Limit to events with no less than this significance.
163-
producttype (str):
164-
Limit to events that have this type of product associated. Example producttypes:
165-
- moment-tensor
166-
- focal-mechanism
167-
- shakemap
168-
- losspager
169-
- dyfi
170-
productcode (str):
171-
Return the event that is associated with the productcode.
172-
The event will be returned even if the productcode is not
173-
the preferred code for the event. Example productcodes:
174-
- nn00458749
175-
- at00ndf1fr
176-
reviewstatus (str):
177-
Limit to events with a specific review status. The different review statuses are:
178-
- automatic Limit to events with review status "automatic".
179-
- reviewed Limit to events with review status "reviewed".
180-
host (str):
181-
Replace default ComCat host (earthquake.usgs.gov) with a custom host.
106+
catalog (str): Limit to events from a specified catalog.
107+
contributor (str): Limit to events contributed by a specified contributor.
108+
limit (int): Limit the results to the specified number of events.
109+
NOTE: this will be throttled by this Python API to the supported Web API limit of 20,000.
110+
maxdepth (float): Limit to events with depth less than the specified maximum.
111+
maxmagnitude (float): Limit to events with a magnitude smaller than the specified maximum.
112+
mindepth (float): Limit to events with depth more than the specified minimum.
113+
minmagnitude (float): Limit to events with a magnitude larger than the specified minimum.
114+
offset (int): Return results starting at the event count specified, starting at 1.
115+
orderby (str): Order the results. The allowed values are:
116+
117+
- `time`: order by origin descending time
118+
- `time-asc`: order by origin ascending time
119+
- `magnitude`: order by descending magnitude
120+
- `magnitude-asc`: order by ascending magnitude
121+
122+
alertlevel (str): Limit to events with a specific PAGER alert level. The allowed values are:
123+
124+
- `green`: Limit to events with PAGER alert level "green".
125+
- `yellow`: Limit to events with PAGER alert level "yellow".
126+
- `orange`: Limit to events with PAGER alert level "orange".
127+
- `red`: Limit to events with PAGER alert level "red".
128+
129+
eventtype (str): Limit to events of a specific type. NOTE: "earthquake" will filter non-earthquake events.
130+
maxcdi (float): Maximum value for Maximum Community Determined Intensity reported by DYFI.
131+
maxgap (float): Limit to events with no more than this azimuthal gap.
132+
maxmmi (float): Maximum value for Maximum Modified Mercalli Intensity reported by ShakeMap.
133+
maxsig (float): Limit to events with no more than this significance.
134+
mincdi (float): Minimum value for Maximum Community Determined Intensity reported by DYFI.
135+
minfelt (int): Limit to events with this many DYFI responses.
136+
mingap (float): Limit to events with no less than this azimuthal gap.
137+
minsig (float): Limit to events with no less than this significance.
138+
producttype (str): Limit to events that have this type of product associated. Example product types:
139+
140+
- `moment-tensor`
141+
- `focal-mechanism`
142+
- `shakemap`
143+
- `losspager`
144+
- `dyfi`
145+
146+
productcode (str): Return the event that is associated with the product code.
147+
The event will be returned even if the product code is not
148+
the preferred code for the event. Example product codes:
149+
150+
- `nn00458749`
151+
- `at00ndf1fr`
152+
153+
reviewstatus (str): Limit to events with a specific review status. The different review statuses are:
154+
155+
- `automatic`: Limit to events with review status "automatic".
156+
- `reviewed`: Limit to events with review status "reviewed".
157+
158+
host (str): Replace default ComCat host (earthquake.usgs.gov) with a custom host.
182159
enable_limit (bool): Enable 20,000 event search limit. Will turn off searching
183160
in segments, which is meant to safely avoid that limit.
184161
Use only when you are certain your search will be small.
162+
185163
Returns:
186164
list: List of SummaryEvent() objects.
165+
187166
"""
188167
# getting the inputargs must be the first line of the method!
189168
inputargs = locals().copy()

docs/concepts/catalogs.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ Once you have a function that returns an eventlist, you can create the catalog o
187187
eventlist = my_custom_web_loader(...)
188188
catalog = csep.catalogs.CSEPCatalog(data=eventlist, **kwargs)
189189

190-
The **kwargs represents any other keyword argument that can be passed to
190+
The `**kwargs` represents any other keyword argument that can be passed to
191191
:class:`CSEPCatalog<csep.core.catalogs.CSEPCatalog>`. This could be the ``catalog_id`` or the
192192
:class:`CartesianGrid2D<csep.core.regions.CartesianGrid2D>`.
193193

@@ -216,6 +216,7 @@ provide some getter methods to access the essential catalog data. These return a
216216
``dtype`` defined by the class.
217217

218218
.. automodule:: csep.core.catalogs
219+
:no-index:
219220

220221
The following functions return :class:`numpy.ndarrays<numpy.ndarray>` of the catalog information.
221222

@@ -287,7 +288,7 @@ object to filter events using the data type.
287288

288289
The filter function can accept a string or a list of filter statements. If the function is called without any arguments
289290
the function looks to use the ``catalog.filters`` member. This can be provided during class instantiation or bound
290-
to the class afterward. :ref:`Here<tutorial-catalog-filtering>` is complete example of how to filter a catalog
291+
to the class afterward. :ref:`Here <tutorial-catalog-filtering>` is complete example of how to filter a catalog
291292
using the filtering strings.
292293

293294
Filtering events in space

docs/concepts/evaluations.rst

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.. _evaluation-reference:
22

33
.. automodule:: csep.core.poisson_evaluations
4+
:no-index:
45

56
###########
67
Evaluations
@@ -94,6 +95,7 @@ details please follow the links below and see the :ref:`example<catalog-forecast
9495
forecast evaluation for an end-to-end walk through.
9596

9697
.. automodule:: csep.core.catalog_evaluations
98+
:no-index:
9799

98100
Consistency tests
99101
=================

docs/concepts/forecasts.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ The default file format of a gridded-forecast is a tab delimited ASCII file with
5656

5757
Each row represents a single space-magnitude bin and the entire forecast file contains the rate for a specified
5858
time-horizon. An example of a gridded forecast for the RELM testing region can be found
59-
`here <https://github.com/SCECcode/csep2/blob/dev/csep/artifacts/ExampleForecasts/GriddedForecasts/helmstetter_et_al.hkj.aftershock-fromXML.dat>`_.
59+
`here <https://github.com/SCECcode/csep2/blob/dev/csep/artifacts/ExampleForecasts/GriddedForecasts/helmstetter_et_al.hkj.aftershock-fromXML.dat>`__.
6060

6161

6262
The coordinates (LON, LAT, DEPTH, MAG) describe the independent space-magnitude region of the forecast. The lower
@@ -79,7 +79,7 @@ the forecast into the appropriate format in the first place. This function has n
7979
expected data.
8080

8181
.. automethod:: csep.core.forecasts.GriddedForecast.from_custom
82-
82+
:no-index:
8383

8484
Working with quadtree-gridded forecasts
8585
##############################################
@@ -131,15 +131,15 @@ Working with catalog-based forecasts
131131

132132
Please see visit :ref:`this<catalog-forecast-evaluation>` example for an end-to-end tutorial on how to evaluate a catalog-based
133133
earthquake forecast. An example of a catalog-based forecast stored in the default pyCSEP format can be found
134-
`here <https://github.com/SCECcode/pycsep/blob/dev/csep/artifacts/ExampleForecasts/CatalogForecasts/ucerf3-landers_1992-06-28T11-57-34-14.csv>`_.
134+
`here <https://github.com/SCECcode/pycsep/blob/dev/csep/artifacts/ExampleForecasts/CatalogForecasts/ucerf3-landers_1992-06-28T11-57-34-14.csv>`__.
135135

136136

137137
The standard format for catalog-based forecasts a comma separated value ASCII format. This format was chosen to be
138138
human-readable and easy to implement in all programming languages. Information about the format is shown below.
139139

140140
.. note::
141141
Custom formats can be supported by writing a custom function or sub-classing the
142-
:ref:`AbstractBaseCatalog<csep.core.forecasts.AbstractBaseCatalog>`.
142+
:class:`AbstractBaseCatalog <csep.core.catalogs.AbstractBaseCatalog>`.
143143

144144
The event format matches the follow specfication: ::
145145

docs/concepts/plots.rst

-27
This file was deleted.

0 commit comments

Comments
 (0)