From 229d8be78dc0b34f83350c198ef157547936188b Mon Sep 17 00:00:00 2001 From: memeier Date: Fri, 13 Aug 2021 17:40:09 +0200 Subject: [PATCH 1/2] two minor bug fixes --- README.md | 14 ++++++++++++++ hashpy/__init__.py | 4 ++-- hashpy/hashpype.py | 3 ++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8e52c50..75a3fe6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,20 @@ HASHpy ------ +This fork contains two minor bug fixes that are necessary to get hashpy up and running smoothly in 2021: +. in hashpy/hashpype.py, change 'class HashError(StandardError):' to 'class HashError(Exception):' +. in hashpy/__init__.py, add a dot before 'hashpype' and 'doublecouple' + +That's it. Thank you Luca Scarabello for figuring this out. Now let's go compute some FMs :) + + + + + + + + + [![DOI](https://zenodo.org/badge/3723/markcwill/hashpy.png)](http://dx.doi.org/10.5281/zenodo.9808) This is a fork of HASH v1.2, the first motion focal mechanism program by Hardebeck and Shearer. The subroutines (in Fortran 77, which I did not write) are compiled into a python module, 'libhashpy.so', which will import all the subs and common blocks into the python namespace. There is a base class, HashPype, that contains attributes which hold data for a HASH calculation, and methods which can be called to do the HASH calculation. This class facilitates easily writing a 'hash driver' script in python. See below for details. diff --git a/hashpy/__init__.py b/hashpy/__init__.py index 4aa71b0..8ed14c8 100644 --- a/hashpy/__init__.py +++ b/hashpy/__init__.py @@ -10,8 +10,8 @@ """ -from hashpype import HashPype, HashError -from doublecouple import DoubleCouple +from .hashpype import HashPype, HashError +from .doublecouple import DoubleCouple __version__ = "0.5.6" diff --git a/hashpy/hashpype.py b/hashpy/hashpype.py index a0d8644..4b1a0e6 100644 --- a/hashpy/hashpype.py +++ b/hashpy/hashpype.py @@ -514,7 +514,8 @@ def driver3(self, check_for_minimum_picks=True, check_for_maximum_gap_size=True) self.calculate_quality(use_amplitudes=True) -class HashError(StandardError): +#class HashError(StandardError): +class HashError(Exception): """Throw this if something happens while running""" pass From 36a75ff841258bca5889873583c988632534e9ac Mon Sep 17 00:00:00 2001 From: seismotologist Date: Fri, 13 Aug 2021 17:59:18 +0200 Subject: [PATCH 2/2] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 75a3fe6..2ec0593 100644 --- a/README.md +++ b/README.md @@ -2,18 +2,18 @@ HASHpy ------ This fork contains two minor bug fixes that are necessary to get hashpy up and running smoothly in 2021: -. in hashpy/hashpype.py, change 'class HashError(StandardError):' to 'class HashError(Exception):' -. in hashpy/__init__.py, add a dot before 'hashpype' and 'doublecouple' - -That's it. Thank you Luca Scarabello for figuring this out. Now let's go compute some FMs :) - +* in hashpy/hashpype.py, change 'class HashError(StandardError):' to 'class HashError(Exception):' +* in hashpy/__init__.py, add a dot before 'hashpype' and 'doublecouple' +That's it. Thank you Luca Scarabello for figuring this out. Now let's go compute some FMs (\\__/) +- - - - +#### Original README: #### [![DOI](https://zenodo.org/badge/3723/markcwill/hashpy.png)](http://dx.doi.org/10.5281/zenodo.9808)