MCPcopy Create free account
hub / github.com/SINGROUP/dscribe / assert_sparse

Function assert_sparse

tests/conftest.py:423–435  ·  view source on GitHub ↗

Test that sparse output is created upon request in the correct format.

(descriptor_func)

Source from the content-addressed store, hash-verified

421
422
423def assert_sparse(descriptor_func):
424 """Test that sparse output is created upon request in the correct format."""
425 system = get_simple_finite()
426
427 # Dense
428 desc = descriptor_func(sparse=False)([system])
429 features = desc.create(system)
430 assert type(features) == np.ndarray
431
432 # Sparse
433 desc = descriptor_func(sparse=True)([system])
434 features = desc.create(system)
435 assert type(features) == sparse.COO
436
437
438def assert_n_features(descriptor_func, n_features):

Callers 8

test_sparseFunction · 0.90
test_sparseFunction · 0.90
test_sparseFunction · 0.90
test_sparseFunction · 0.90
test_sparseFunction · 0.90
test_sparseFunction · 0.90
test_sparseFunction · 0.90
test_sparseFunction · 0.90

Calls 2

get_simple_finiteFunction · 0.85
createMethod · 0.45

Tested by

no test coverage detected