Skip to content

Commit

Permalink
correct unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tvatter committed Feb 8, 2025
1 parent 0ed8c30 commit 33b4986
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test_bicop.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ def test_bicop():
bicop.npars = 2

# Test passing a single row of data (#169 & #170 fix)
bicop.var_types = ["c", "c"]
u = np.array([[0.1, 0.2]])
d = bicop.pdf(u)
assert isinstance(d, np.ndarray) and d.shape == (1,)

# Test loglik method
bicop.var_types = ["c", "c"]
u = np.array([[0.1, 0.2], [0.3, 0.4]])
loglik = bicop.loglik(u)
assert isinstance(loglik, float)
Expand Down
7 changes: 7 additions & 0 deletions tests/test_vinecop.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ def test_vinecop():
assert isinstance(values, np.ndarray)
assert values.shape == (n,)

# Test passing a single row of data (#169 & #170 fix)
u1 = u[0, :].reshape(1, d)
for method in ["pdf", "cdf"]:
values = getattr(cop, method)(u1)
assert isinstance(values, np.ndarray)
assert values.shape == (1,)

# Test simulate method
simulated_data = cop.simulate(n)
assert simulated_data.shape == (n, d)
Expand Down

0 comments on commit 33b4986

Please sign in to comment.