File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,7 +40,6 @@ all = [
4040 " emmet-core[all]>=0.86.4rc1,<0.86.5" ,
4141 " fastmcp" ,
4242 " flask" ,
43- " matminer>=0.10.0" ,
4443 " mpcontribs-client>=5.10" ,
4544]
4645test = [
Original file line number Diff line number Diff line change 1212from mp_api .client .routes .materials .similarity import SimilarityRester
1313
1414
15- try :
16- import matminer
17- except ImportError :
18- matminer = None
19-
20-
2115@pytest .fixture (scope = "module" )
2216def test_struct ():
2317 poscar = """Al2
@@ -59,21 +53,18 @@ def test_similarity_search():
5953def test_similarity_vector_search (test_struct ):
6054 rester = SimilarityRester ()
6155
62- # skip these tests if `matminer` is not installed
63- if matminer is not None :
64- fv = rester .fingerprint_structure (test_struct )
65- assert isinstance (fv , np .ndarray )
66- assert len (fv ) == 122
67- assert isinstance (rester ._fingerprinter , SimilarityScorer )
68-
69- assert all (
70- isinstance (entry , SimilarityEntry )
71- and isinstance (entry .dissimilarity , float )
72- for entry in rester .find_similar (
73- test_struct ,
74- top = 2 ,
75- )
56+ fv = rester .fingerprint_structure (test_struct )
57+ assert isinstance (fv , np .ndarray )
58+ assert len (fv ) == 122
59+ assert isinstance (rester ._fingerprinter , SimilarityScorer )
60+
61+ assert all (
62+ isinstance (entry , SimilarityEntry ) and isinstance (entry .dissimilarity , float )
63+ for entry in rester .find_similar (
64+ test_struct ,
65+ top = 2 ,
7666 )
67+ )
7768
7869 get_top = 5
7970 sim_entries = rester .find_similar ("mp-149" , top = get_top )
You can’t perform that action at this time.
0 commit comments