Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/test_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def test_cache_save_after_clear():
# calls to `cache.save()` will automatically save both `.nbi` and `.nbc` cache files
cache.save() # Save both `.nbi` and `.nbc` cache files

comp_cache = cache._get_cache(cache_dir)
cmp_cache = cache._get_cache(cache_dir)

assert sorted(ref_cache) == sorted(comp_cache)
assert sorted(cmp_cache) == sorted(ref_cache)

cache.clear(cache_dir)
20 changes: 10 additions & 10 deletions tests/test_chains.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,26 @@
@pytest.mark.parametrize("Value, IR, IL", test_data)
def test_atsc(Value, IR, IL):
j = 2
ref = np.array([2, 4, 6, 8, 10], np.int64)
comp = atsc(IL, IR, j)
npt.assert_equal(ref, comp)
ref_chain = np.array([2, 4, 6, 8, 10], np.int64)
cmp_chain = atsc(IL, IR, j)
npt.assert_array_equal(cmp_chain, ref_chain)


@pytest.mark.parametrize("Value, IR, IL", test_data)
def test_allc(Value, IR, IL):
S_ref = [
ref_chains = [
np.array([1, 7, 11], dtype=np.int64),
np.array([0], dtype=np.int64),
np.array([3], dtype=np.int64),
np.array([9], dtype=np.int64),
np.array([2, 4, 6, 8, 10], dtype=np.int64),
np.array([5], dtype=np.int64),
]
C_ref = np.array([2, 4, 6, 8, 10], dtype=np.int64)
S_comp, C_comp = allc(IL, IR)
ref_longest_chain = np.array([2, 4, 6, 8, 10], dtype=np.int64)
cmp_chains, cmp_longest_chain = allc(IL, IR)

S_ref = sorted(S_ref, key=lambda x: (len(x), list(x)))
S_comp = sorted(S_comp, key=lambda x: (len(x), list(x)))
ref_chains = sorted(ref_chains, key=lambda x: (len(x), list(x)))
cmp_chains = sorted(cmp_chains, key=lambda x: (len(x), list(x)))

npt.assert_equal(S_ref, S_comp)
npt.assert_equal(C_ref, C_comp)
npt.assert_equal(cmp_chains, ref_chains)
npt.assert_array_equal(cmp_longest_chain, ref_longest_chain)
Loading
Loading