Skip to content

Commit

Permalink
merge LinkFinder to MetcalfScoring class (#248)
Browse files Browse the repository at this point in the history
* merge LinkFinder to MetcalfScoring class

The actual role of LinkFinder is to calculate metcalf score, so it makes more sense to merge its functions to MetcalfScoring class

* remove LinkFinder

* move unit tests of LinkFinder

* update static typings

* Delete conftest.py

* create temporary root dir only in the places that require  it

* update fixture scopes

* Update test_metcalf_scoring.py

caplog cannot capture all logs, so remove the assertions.

* update pytest dist value to loadgroup

This option is much faster and easier to control the group of tests for same worker.

* fix repeatings
  • Loading branch information
CunliangGeng authored Jun 6, 2024
1 parent 3de97c1 commit 276aff6
Show file tree
Hide file tree
Showing 9 changed files with 526 additions and 586 deletions.
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ namespaces = true # enable data directory to be identified

[tool.pytest.ini_options]
minversion = "6.0"
# pytest options: -ra: show summary info for all test outcomes; -n auto: run tests in parallel; --dist loadscope: distribute tests by loading scope
addopts = "-ra -n auto --dist loadscope"
# -ra: show summary info for all test outcomes;
# -n auto: run tests in parallel;
# --dist loadgroup: sends tests marked with 'xdist_group' to the same worker
addopts = "-ra -n auto --dist loadgroup"
testpaths = ["tests/unit"]

[tool.coverage.run]
Expand Down
3 changes: 1 addition & 2 deletions src/nplinker/scoring/linking/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from .data_links import LINK_TYPES
from .data_links import DataLinks
from .link_finder import LinkFinder
from .utils import calc_correlation_matrix
from .utils import isinstance_all


__all__ = ["DataLinks", "LINK_TYPES", "LinkFinder", "calc_correlation_matrix", "isinstance_all"]
__all__ = ["DataLinks", "LINK_TYPES", "calc_correlation_matrix", "isinstance_all"]
201 changes: 0 additions & 201 deletions src/nplinker/scoring/linking/link_finder.py

This file was deleted.

Loading

0 comments on commit 276aff6

Please sign in to comment.