Skip to content

Commit

Permalink
Merge pull request #18 from EarthScope/17-userrequest-fails-when-csv_…
Browse files Browse the repository at this point in the history
…dir-is-blank

UserRequest fix for empty _dir fields
  • Loading branch information
gillian-earthscope authored Aug 2, 2023
2 parents e19d90d + f549c50 commit 162b895
Show file tree
Hide file tree
Showing 4 changed files with 2,607 additions and 60 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
3.1.2
* bug fix for when csv_dir, psd_dir, and/or pdf_dir are blank
* replaced test_data/RESP.KAPI.II.00.BHZ.txt to a functional resp file

3.1.1
* updated conda package versions when running './run_ispaq.py -U'

Expand Down
2 changes: 1 addition & 1 deletion ispaq/ispaq.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from _ast import Try
from numpy.random import sample

__version__ = "3.1.1"
__version__ = "3.1.2"

# dictionary of currently defined ISPAQ metric groups and business logic
# for comparison with R package IRISMustangMetrics/ISPAQUtils.R json
Expand Down
15 changes: 9 additions & 6 deletions ispaq/user_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,26 +316,29 @@ def __init__(self,
self.db_name = 'ispaq.db'

if self.pdf_dir is None:
if 'pdf_dir' in preferences:
try:
self.pdf_dir = os.path.abspath(os.path.expanduser(preferences['pdf_dir']))
else:
except:
logger.debug("Unable to resolve pdf_dir, using working directory instead")
self.pdf_dir = os.path.abspath('.')
else:
self.pdf_dir = os.path.abspath(os.path.expanduser(self.pdf_dir))


if self.csv_dir is None:
if 'csv_dir' in preferences:
try:
self.csv_dir = os.path.abspath(os.path.expanduser(preferences['csv_dir']))
else:
except:
logger.debug("Unable to resolve csv_dir, using working directory instead")
self.csv_dir = os.path.abspath('.')
else:
self.csv_dir = os.path.abspath(os.path.expanduser(self.csv_dir))

if self.psd_dir is None:
if 'psd_dir' in preferences:
try:
self.psd_dir = os.path.abspath(os.path.expanduser(preferences['psd_dir']))
else:
except:
logger.debug("Unable to resolve psd_dir, using working directory instead")
self.psd_dir = os.path.abspath('.')
else:
self.psd_dir = os.path.abspath(os.path.expanduser(self.psd_dir))
Expand Down
Loading

0 comments on commit 162b895

Please sign in to comment.