Skip to content

Commit 953b8a8

Browse files
committed
First pass at making inline doc Sphinx comapatible for HashPype
1 parent 191ab2c commit 953b8a8

File tree

1 file changed

+30
-22
lines changed

1 file changed

+30
-22
lines changed

hashpy/hashpype.py

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
# -*- coding: utf-8 -*-
22
"""
3-
hashpype.py
3+
Module to call and run HASH subroutines in Fortran
4+
5+
Contains: HashPype
6+
First motion focal mechanism class for running HASH
47
5-
by Mark Williams 2012.313
6-
First motion focal mechanism class for running HASH
8+
9+
:copyright:
10+
Mark Williams (2013)
11+
Nevada Seismological Laboratory
712
813
"""
914

@@ -267,16 +272,15 @@ def input(self, data, format=None, *args, **kwargs):
267272
268273
An input function is passed the current HashPype, the object for
269274
input (could be object instance, open file handle, string of filename, etc)
270-
and any other args and kwargs required. New inputs can be added to
271-
hashpy.io module and registered in hashpy.io.core
275+
and any other args and kwargs required. New inputs can be added to the
276+
`hashpy.io` module and registered in `hashpy.io.core`
272277
273-
Inputs
274-
------
275-
data : The picks/data to be input into a HashPype run
276-
format : str of a format type registered in hashpy.io module
278+
:param data: The picks/data to be input into a HashPype run, format
279+
depends on the input function
280+
:param str format: A format type registered in `hashpy.io` module
277281
278-
*args : Passed to the input function to be interpreted by the
279-
**kwargs : registered module for custom behavior
282+
:param args: Additional arguments are passed to the input function
283+
:param kwargs: Additioanl keywords are passed to the input function
280284
281285
"""
282286
try:
@@ -289,12 +293,10 @@ def output(self, format=None, *args, **kwargs):
289293
"""
290294
Output data using a formatting standard from the 'io' module
291295
292-
Inputs
293-
------
294-
format : str of a format type registered in hashpy.io module
295-
296296
The current module will output a simple one-line string of the
297297
best solution stored in the run.
298+
299+
:params str format: A format type registered in `hashpy.io` module
298300
299301
"""
300302
try:
@@ -305,13 +307,14 @@ def output(self, format=None, *args, **kwargs):
305307

306308
def load_velocity_models(self, model_list=None):
307309
"""
308-
"Load velocity model data
310+
Load velocity model data
309311
310-
Inputs
311-
------
312-
model_list : list of str of velocity model filenames
312+
If a None is specified (the default), will use the list in
313+
`HashPype.vmodels`
314+
315+
:type model_list: list of str
316+
:param model_list: Optional velocity model filenames
313317
314-
** if None, will use the list in 'self.vmodels'
315318
"""
316319
# Future -- allow adding on fly, check and append to existing
317320
#
@@ -330,6 +333,7 @@ def load_velocity_models(self, model_list=None):
330333
def generate_trial_data(self):
331334
"""
332335
Make data for running trials
336+
333337
(MUST have loaded data and vel mods already)
334338
335339
Algorithm by H & S (From HASH driver script)
@@ -363,14 +367,18 @@ def view_polarity_data(self):
363367
print '{0} {1} {2} {3} {4}'.format(k,self.sname[k],self.p_azi_mc[k,0],self.p_the_mc[k,0],self.p_pol[k])
364368

365369
def check_minimum_polarity(self):
366-
"""Polarity check"""
370+
"""
371+
Polarity check
372+
"""
367373
if self.npol >= self.npolmin:
368374
return True
369375
else:
370376
return False
371377

372378
def check_maximum_gap(self):
373-
"""Gap check"""
379+
"""
380+
Gap check
381+
"""
374382
if ((self.magap > self.max_agap) or (self.mpgap > self.max_pgap)):
375383
return False
376384
else:

0 commit comments

Comments
 (0)