Skip to content
Merged
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
repos:
- repo: https://github.com/psf/black
rev: 22.10.0
rev: 23.1.0
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 5.0.4
rev: 6.0.0
hooks:
- id: flake8
- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort
name: isort (python)
1 change: 1 addition & 0 deletions case_utils/case_file/__init__.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -39,6 +39,7 @@

DEFAULT_PREFIX = "http://example.org/kb/"


# Shortcut syntax for defining an immutable named tuple is noted here:
# https://docs.python.org/3/library/typing.html#typing.NamedTuple
# via the "See also" box here: https://docs.python.org/3/library/collections.html#collections.namedtuple
Expand Down
2 changes: 1 addition & 1 deletion case_utils/case_sparql_construct/__init__.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -98,7 +98,7 @@ def main() -> None:
construct_query_result = in_graph.query(construct_query_object)
_logger.debug("type(construct_query_result) = %r." % type(construct_query_result))
_logger.debug("len(construct_query_result) = %d." % len(construct_query_result))
for (row_no, row) in enumerate(construct_query_result):
for row_no, row in enumerate(construct_query_result):
if row_no == 0:
_logger.debug("row[0] = %r." % (row,))
out_graph.add(row)
Expand Down
4 changes: 2 additions & 2 deletions case_utils/case_sparql_select/__init__.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -86,10 +86,10 @@ def graph_and_query_to_data_frame(
select_query_object = rdflib.plugins.sparql.processor.prepareQuery(
select_query_text, initNs=nsdict
)
for (row_no, row) in enumerate(_graph.query(select_query_object)):
for row_no, row in enumerate(_graph.query(select_query_object)):
tally = row_no + 1
record = []
for (column_no, column) in enumerate(row):
for column_no, column in enumerate(row):
if column is None:
column_value = ""
elif (
Expand Down
3 changes: 2 additions & 1 deletion case_utils/ontology/src/ontology_and_version_iris.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -28,7 +28,8 @@

def concept_is_cdo_concept(n_concept: rdflib.URIRef) -> bool:
"""
This function is purposefully distinct from the function used in case_validate. Within this script, the publishing history of CASE and UCO is reviewed."""
This function is purposefully distinct from the function used in case_validate. Within this script, the publishing history of CASE and UCO is reviewed.
"""
concept_iri = str(n_concept)
return (
concept_iri.startswith("https://ontology.unifiedcyberontology.org/")
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -36,9 +36,9 @@
)


def make_data_frame_to_json_table_text_parameters() -> typing.Iterator[
typing.Tuple[str, str, bool, bool]
]:
def make_data_frame_to_json_table_text_parameters() -> (
typing.Iterator[typing.Tuple[str, str, bool, bool]]
):
for use_header in [False, True]:
for use_index in [False, True]:
for output_mode in ["csv", "html", "json", "md", "tsv"]:
Expand Down