Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove duplicate output of Classes added #733

Closed
wants to merge 7 commits into from
Closed
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
8 changes: 0 additions & 8 deletions src/oaklib/implementations/amigo/amigo_implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ def subset_members(self, subset: SUBSET_CURIE, **kwargs) -> Iterable[CURIE]:
for doc in results:
yield doc[ANNOTATION_CLASS]


def associations(
self,
subjects: Iterable[CURIE] = None,
Expand Down Expand Up @@ -348,7 +347,6 @@ def association_counts(
solr, fq, facet_field=ff, rows=0, facet_limit=limit, min_facet_count=min_facet_count
)


# def association_pairwise_coassociations(
# self,
# curies1: Iterable[CURIE],
Expand Down Expand Up @@ -389,8 +387,6 @@ def association_counts(
# yield ff[i], ff[i + 1]
#



def association_subject_counts(
self,
subjects: Iterable[CURIE] = None,
Expand Down Expand Up @@ -446,10 +442,6 @@ def relationships(
self._cache_nodes(nodes, [s, p, o])
yield s, p, o





def basic_search(
self, search_term: str, config: Optional[SearchConfiguration] = None
) -> Iterable[CURIE]:
Expand Down
9 changes: 6 additions & 3 deletions src/oaklib/interfaces/association_provider_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,9 @@ def association_pairwise_coassociations(
curies1 = list(curies1)
curies2 = list(curies2)
logging.info(f"Finding co-associations between {curies1} and {curies2}")
assocmap = {c: list(self.associations(objects=[c], **kwargs)) for c in set(curies1+curies2)}
assocmap = {
c: list(self.associations(objects=[c], **kwargs)) for c in set(curies1 + curies2)
}
assocmap1 = {c: assocmap[c] for c in curies1}
assocmap2 = {c: assocmap[c] for c in curies2}
for c1 in curies1:
Expand All @@ -389,8 +391,9 @@ def association_pairwise_coassociations(
number_subject_unique_to_entity2=len(elements2.difference(elements1)),
)
if coassoc.number_subjects_in_union:
coassoc.proportion_subjects_in_common = (coassoc.number_subjects_in_common /
coassoc.number_subjects_in_union)
coassoc.proportion_subjects_in_common = (
coassoc.number_subjects_in_common / coassoc.number_subjects_in_union
)
if include_entities:
coassoc.subjects_in_common = list(common)
coassoc.associations_for_subjects_in_common = assocs_to_common
Expand Down
4 changes: 3 additions & 1 deletion src/oaklib/utilities/lexical/synonymizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ def apply_synonymizer_to_terms(
if qualifier is None or qualifier == "":
if rule.in_place or scope_pred == "definition":
# preserves the original synonym type
qualifier = pred_to_qual.get(scope_pred, scope_pred).lower()
qualifier = pred_to_qual.get(
scope_pred, scope_pred
).lower()
else:
qualifier = "exact"
n += 1
Expand Down
3 changes: 1 addition & 2 deletions tests/test_utilities/test_synonymizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ def test_synonymizer(rule, input, expected):
"the plasma membrane and nucleus, but including other subcellular structures.' "
"to 'All of the contents of a cell excluding the plasma membrane and "
"NUCLEUS, but including other subcellular structures.'"

)
],
),
Expand All @@ -105,7 +104,7 @@ def test_synonymizer(rule, input, expected):
],
)
def test_syonymizer_on_terms(ruleset, include_all, terms, expected):
#adapter = get_adapter(f"simpleobo:{TEST_SIMPLE_ONT}")
# adapter = get_adapter(f"simpleobo:{TEST_SIMPLE_ONT}")
adapter = get_adapter(f"{TEST_SIMPLE_ONT}")
if isinstance(ruleset, Synonymizer):
ruleset = RuleSet(rules=[ruleset])
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ deps =
ruff
skip_install = true
commands =
black src/ tests/
ruff --fix src/ tests/
black src/ tests/ --exclude src/oaklib/datamodels/*
ruff --fix src/ tests/ --exclude src/oaklib/datamodels
description = Run linters.

# This is used for QC checks.
Expand All @@ -51,7 +51,7 @@ deps =
ruff
skip_install = true
commands =
ruff check src/ tests/
ruff check src/ tests/ --exclude src/oaklib/datamodels
description = Run linters.

[testenv:codespell]
Expand Down
Loading