Skip to content

Commit eb0fe1a

Browse files
committed
Merge branch 'main' of https://github.com/VirtualPlanetaryLaboratory/vspace into comprehensive-testing
2 parents 62f14e0 + 34bd188 commit eb0fe1a

3 files changed

Lines changed: 27 additions & 20 deletions

File tree

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
# a list of builtin themes.
5151
#
5252
html_theme = 'sphinx_rtd_theme'
53+
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
5354

5455
# Add any paths that contain custom static files (such as style sheets) here,
5556
# relative to this directory. They are copied after the builtin static files,

environment.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ dependencies:
1414
- pytest-dependency>=0.5.1
1515
- pytest-env>=0.6.2
1616
- pytest-cov>=2.11.1
17-
- sphinx==4.2.0
17+
- sphinx==7.2.6
18+
- sphinx-rtd-theme==1.3.0
1819
- breathe>=4.30.0
1920
- sphinxcontrib-bibtex>=2.2.0
2021
- coverage>=5.5

vspace/vspace.py

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -196,25 +196,30 @@ def main():
196196
values = spl[1].split(",")
197197
for j in range(len(values)):
198198
values[j] = values[j].strip()
199-
if values[2][0] == 'p':
200-
if mode != 1:
201-
raise IOError("Random mode must be used when passing predefined priors")
202-
if values[0] not in prior_files:
203-
prior_files.append(values[0])
204-
if values[1] == 'npy':
205-
fprior = np.load(values[0])
206-
prior_index = np.random.choice(fprior.shape[0], size=randsize, replace=False)
207-
prior_indicies.append(prior_index)
208-
samp = fprior[prior_index]
209-
prior_samples.append(samp)
210-
elif values[1] == 'txt' or values[1] == 'dat':
211-
fprior = ascii.read(values[0])
212-
prior_index = np.random.choice(len(fprior), size=randsize, replace=False)
213-
prior_indicies.append(prior_index)
214-
samp = fprior[prior_index]
215-
prior_samples.append(samp)
216-
elif values[1] != 'npy' and values[1] != 'txt' and values[1] != 'dat':
217-
raise IOError("File type incompatible for predefined prior mode. Acceptable file types: npy, ascii formatted txt, ascii formatted dat")
199+
try:
200+
if values[2][0] == 'p':
201+
if mode != 1:
202+
raise IOError("Random mode must be used when passing predefined priors")
203+
if values[0] not in prior_files:
204+
prior_files.append(values[0])
205+
if values[1] == 'npy':
206+
fprior = np.load(values[0])
207+
prior_index = np.random.choice(fprior.shape[0], size=randsize, replace=False)
208+
prior_indicies.append(prior_index)
209+
samp = fprior[prior_index]
210+
prior_samples.append(samp)
211+
elif values[1] == 'txt' or values[1] == 'dat':
212+
fprior = ascii.read(values[0])
213+
prior_index = np.random.choice(len(fprior), size=randsize, replace=False)
214+
prior_indicies.append(prior_index)
215+
samp = fprior[prior_index]
216+
prior_samples.append(samp)
217+
elif values[1] != 'npy' and values[1] != 'txt' and values[1] != 'dat':
218+
raise IOError("File type incompatible for predefined prior mode. Acceptable file types: npy, ascii formatted txt, ascii formatted dat")
219+
except:
220+
print('ERROR: Incorrect number of arguments.')
221+
print(inputf+', line '+i+': '+lines[i])
222+
exit()
218223
# End pass 1a through input file -------------------------------
219224
# End Megans Addition ------------------------------------------
220225

0 commit comments

Comments
 (0)