Skip to content

Commit

Permalink
handling memory error in testing
Browse files Browse the repository at this point in the history
Took 50 minutes
  • Loading branch information
tfm000 committed Oct 10, 2023
1 parent 3a859d9 commit 148570b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions sklarpy/tests/multivariate/test_fitted_dists.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,14 @@ def test_fitted_logpdf_pdf_cdf_mc_cdf(
pd_mvt_discrete_data)

for data in datasets:
output = func(x=data, match_datatype=True,
num_generate=num_generate)
try:
output = func(x=data, match_datatype=True,
num_generate=num_generate)
except MemoryError as e:
print(f"MemoryError occured when calculating fitted "
f"{name}.{func_str} \n{e}")
continue

np_output = np.asarray(output)
n, d = np.asarray(data).shape

Expand Down
10 changes: 8 additions & 2 deletions sklarpy/tests/multivariate/test_prefit_dists.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,14 @@ def test_prefit_logpdf_pdf_cdf_mc_cdfs(
pd_mvt_discrete_data)

for data in datasets:
output = func(x=data, params=params, match_datatype=True,
num_generate=num_generate)
try:
output = func(x=data, params=params, match_datatype=True,
num_generate=num_generate)
except MemoryError as e:
print(f"MemoryError occured when calculating pre-fit "
f"{name}.{func_str} \n{e}")
continue

np_output = np.asarray(output)
n, d = np.asarray(data).shape

Expand Down

0 comments on commit 148570b

Please sign in to comment.