Skip to content

Commit

Permalink
Fast run updates
Browse files Browse the repository at this point in the history
- Delete: Some temporary modifications to lower n in save_to_owl()
  • Loading branch information
joeflack4 committed Nov 11, 2024
1 parent 4b0951b commit 6f08c08
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/comp_loinc/loinc_builder_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class LoincBuilderSteps:
"""Builder steps for LOINC."""

def __init__(self, *, configuration: Configuration):
# logger.info(f"Running: {args}")
self.configuration = configuration
self.runtime: t.Optional[Runtime] = None

Expand Down Expand Up @@ -125,7 +124,7 @@ def loinc_terms_all(
if self.configuration.fast_run and count > 5000:
break
if count % 1000 == 0:
logger.debug(f"Finished {count}")
logger.info(f"Finished {count}")

status = node.get_property(LoincTermProps.status)
if active_only and status != "ACTIVE":
Expand Down Expand Up @@ -620,7 +619,7 @@ def loinc_term_class_roots(self):
):
count += 1
if count % 1000 == 0:
logger.debug(f"Finished {count}")
logger.info(f"Finished {count}")
loinc_term_node = self.runtime.graph.get_node_by_code(
type_=LoincNodeType.LoincTerm, code=loinc_term_entity.id
)
Expand Down Expand Up @@ -797,17 +796,9 @@ def save_to_owl(
"""Save the current module to an OWL file."""
logger.info(f"save-owl: Starting")
owl_dumper = OWLDumper()

# TODO temp
ents = list(self.runtime.current_module.get_all_entities())
print('len entities (if over 5k, limit to that)', len(ents))
ents = ents[:5000]

document = owl_dumper.to_ontology_document(
schema=self.runtime.current_schema_view.schema,
# TODO temp
# element=list(self.runtime.current_module.get_all_entities())
element=ents
element=list(self.runtime.current_module.get_all_entities()),
)
document.ontology.iri = funowl.identifiers.IRI(
f"https://comploinc/{self.runtime.current_module.name}"
Expand Down

0 comments on commit 6f08c08

Please sign in to comment.