Skip to content

Remove config calls from internal functions and expose only at interf… - #31

Closed
nicoloesch wants to merge 1 commit into
mainfrom
30-remove-config-reads
Closed

Remove config calls from internal functions and expose only at interf…#31
nicoloesch wants to merge 1 commit into
mainfrom
30-remove-config-reads

Conversation

@nicoloesch

@nicoloesch nicoloesch commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Notes

Depends on omop-emb to pass: AustralianCancerDataNetwork/omop-emb#50. (The reason the typer fails).
Requires version bump in pyproject.toml to 2.0 for omop-emb.

Summary

OmopGraphConfig.get_config()/OmopEmbConfig.get_config() were being called deep inside graph-traversal functions and a dataclass field default instead of once at a caller-resolved boundary.

  • find_shortest_paths, find_shortest_paths_batch, find_standard_paths (graph/paths.py) revert max_depth/max_paths/max_concepts to literal defaults, removing OmopGraphConfig from this module entirely.
  • GroundingConstraints.max_depth (reasoning/grounding.py) was an unguarded default_factory reachable with zero exception handling from oaklib_interface/omop_implementation.py:314 (an external OAK adapter entry point). Same fix: literal default instead of a config read.
  • KnowledgeGraph.emb property (graph/kg.py) updated for the new omop-emb resolve_backend(backend_type, *, sqlite_path=...) signature, and its own config resolution pushed up to EmbeddingConfiguration construction rather than the property re-resolving on first access.

@nicoloesch

Copy link
Copy Markdown
Collaborator Author

Closing in favor of absorbing this into #34.

Depends on AustralianCancerDataNetwork/omop-emb#50, which is being absorbed the same way (see that PR). Merging this chain independently first would mean two breaking releases in quick succession instead of one.

The config-boundary fixes here (paths.py, grounding.py, kg.py) are being adopted as designed.

@nicoloesch nicoloesch closed this Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Incompatible API change. MAJOR: x+1.y.z

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor: move config reads out of dataclasses and algorithmic functions

1 participant