Skip to content

Commit a61fa74

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent ff1a0b3 commit a61fa74

File tree

6 files changed

+9
-14
lines changed

6 files changed

+9
-14
lines changed

examples/sessions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
}}
133133
"""
134134
)(citizen=OntologyIndividual, age=int)
135-
for (citizen, age) in result:
135+
for citizen, age in result:
136136
print(citizen.name, age)
137137

138138
# Session contents can be exported to RDF,

simphony_osp/interfaces/interface.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,6 @@ def cache_clear(self):
913913
def _compute_entity_modifications(
914914
self,
915915
) -> Tuple[Set[OntologyEntity], Set[OntologyEntity], Set[OntologyEntity]]:
916-
917916
# Find out from the triples which entities were added, updated and
918917
# deleted.
919918
class Tracker:

simphony_osp/ontology/individual.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1518,7 +1518,7 @@ def get(
15181518
)
15191519
else:
15201520
result = []
1521-
for (i, r, t) in relationship_set.iter_low_level():
1521+
for i, r, t in relationship_set.iter_low_level():
15221522
if not t:
15231523
continue
15241524
session = self.session
@@ -1650,16 +1650,16 @@ def iter(
16501650
iterator = iter(relationship_set)
16511651
else:
16521652

1653-
def iterator() -> Iterator[
1654-
Tuple[OntologyIndividual, OntologyRelationship]
1655-
]:
1653+
def iterator() -> (
1654+
Iterator[Tuple[OntologyIndividual, OntologyRelationship]]
1655+
):
16561656
"""Helper iterator.
16571657
16581658
The purpose of defining this iterator is to be able to
16591659
return it, instead of using the `yield` keyword on the main
16601660
function, as described on the comment above.
16611661
"""
1662-
for (i, r, t) in relationship_set.iter_low_level():
1662+
for i, r, t in relationship_set.iter_low_level():
16631663
if not t:
16641664
continue
16651665
session = self.session
@@ -2242,9 +2242,9 @@ def relationships_iter(
22422242
Iterator with the queried ontology individuals.
22432243
"""
22442244

2245-
def individuals_and_relationships() -> Iterator[
2246-
OntologyIndividual, OntologyEntity
2247-
]:
2245+
def individuals_and_relationships() -> (
2246+
Iterator[OntologyIndividual, OntologyEntity]
2247+
):
22482248
for s, p, o in self.session.graph.triples(
22492249
(
22502250
self.identifier,

simphony_osp/session/session.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,6 @@ def iter(
10511051
)
10521052

10531053
if identifiers:
1054-
10551054
# The yield statement is encapsulated inside a function so that the
10561055
# main function uses the return statement instead of yield. In this
10571056
# way, exceptions are checked when the `iter` method is called

simphony_osp/tools/semantic2dot.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,6 @@ def terminal():
498498

499499
namespaces = set()
500500
for x in args.plot:
501-
502501
try:
503502
namespaces.add(Session.default_ontology.get_namespace(x))
504503
logger.warning("Using installed version of namespace %s" % x)

simphony_osp/utils/cache.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,11 @@ def lru_cache_timestamp(
8484
"""
8585

8686
def decorator(func: Callable):
87-
8887
holder: Dict[Any, Tuple[datetime, Callable]] = dict()
8988
"""For each instance, holds its timestamp and the cached function."""
9089

9190
@wraps(func)
9291
def wrapper(self, *args, **kwargs):
93-
9492
internal_timestamp, cached_function = holder.get(
9593
self, (None, None)
9694
)

0 commit comments

Comments
 (0)