Skip to content

Commit

Permalink
Merge pull request #218 from mhearne-usgs/v20
Browse files Browse the repository at this point in the history
Added DOI for software release.
  • Loading branch information
hschovanec-usgs authored Jan 23, 2020
2 parents ceb141b + da880c2 commit 73cbf66
Show file tree
Hide file tree
Showing 22 changed files with 27,724 additions and 46,012 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,9 @@ Example Jupyter notebooks show how the API can be used to get and manipulate inf
- [Magnitude Comparison Notebook](https://github.com/usgs/libcomcat/blob/master/notebooks/ComparingMagnitudes.ipynb)
- [Phase and Magnitude Notebook](https://github.com/usgs/libcomcat/blob/master/notebooks/PhasesAndMagnitudes.ipynb)
- [Search Notebook](https://github.com/usgs/libcomcat/blob/master/notebooks/Search.ipynb)

## Citation

If you wish to cite this work in your own publication, you may use this DOI:
https://doi.org/10.5066/P91WN1UQ

19 changes: 11 additions & 8 deletions libcomcat/bin/geteventhist.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def get_parser():
# optional arguments
ohelp = '''Directory where files are stored.'''
parser.add_argument('-d', '--outdir', help=ohelp,
default=None)
default=os.path.expanduser('~'))
parser.add_argument('--exclude-products',
help='COMCAT products to be excluded from the spreadsheet.',
nargs='*', default=[])
Expand Down Expand Up @@ -341,13 +341,16 @@ def main():

# web output and directory output are mutually exclusive
if args.outdir and args.web:
msg = '''The -d and --web options are mutually exclusive, meaning
that you cannot choose to write files to a directory and print
HTML output to the screen simultaneously. Please choose one of
those two options and try again.
'''
print(msg)
sys.exit(1)
if args.outdir != os.path.expanduser('~'):
msg = '''The -d and --web options are mutually exclusive, meaning
that you cannot choose to write files to a directory and print
HTML output to the screen simultaneously. Please choose one of
those two options and try again.
'''
print(msg)
sys.exit(1)
else:
args.outdir = None
if args.radius and not args.window:
msg = '''To define a time and distance range, the radius and window
options must both be set.
Expand Down
4 changes: 3 additions & 1 deletion libcomcat/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def __init__(self, url):
response = requests.get(url, timeout=TIMEOUT, headers=HEADERS)
self._jdict = response.json()
self._actual_url = url
except HTTPError:
except requests.exceptions.ReadTimeout as rt:
try:
response = requests.get(url, timeout=TIMEOUT, headers=HEADERS)
self._jdict = response.json()
Expand Down Expand Up @@ -909,6 +909,8 @@ def getContentURL(self, regexp):
content_name = 'a' * 1000
found = False
content_url = ''
if 'contents' not in self._product:
return None
if not len(self._product['contents']):
return None
for contentkey, content in self._product['contents'].items():
Expand Down
309 changes: 152 additions & 157 deletions tests/libcomcat/cassettes/classes_detailevent.yaml

Large diffs are not rendered by default.

1,767 changes: 1,683 additions & 84 deletions tests/libcomcat/cassettes/classes_detailsummary.yaml

Large diffs are not rendered by default.

310 changes: 217 additions & 93 deletions tests/libcomcat/cassettes/classes_moment.yaml

Large diffs are not rendered by default.

458 changes: 321 additions & 137 deletions tests/libcomcat/cassettes/classes_product.yaml

Large diffs are not rendered by default.

1,070 changes: 531 additions & 539 deletions tests/libcomcat/cassettes/classes_summary.yaml

Large diffs are not rendered by default.

9,619 changes: 1,847 additions & 7,772 deletions tests/libcomcat/cassettes/dataframes_detailed.yaml

Large diffs are not rendered by default.

19,903 changes: 7,140 additions & 12,763 deletions tests/libcomcat/cassettes/dataframes_dyfi.yaml

Large diffs are not rendered by default.

20,630 changes: 10,441 additions & 10,189 deletions tests/libcomcat/cassettes/dataframes_history.yaml

Large diffs are not rendered by default.

11,689 changes: 1,174 additions & 10,515 deletions tests/libcomcat/cassettes/dataframes_magnitude.yaml

Large diffs are not rendered by default.

Loading

0 comments on commit 73cbf66

Please sign in to comment.