Skip to content

Commit

Permalink
Merge pull request monarch-initiative#63 from monarch-initiative/test…
Browse files Browse the repository at this point in the history
…-suite-fixes
  • Loading branch information
iQuxLE authored Aug 23, 2024
2 parents aa69288 + 7f4d537 commit a212f9a
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/curate_gpt/agents/concept_recognition_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ class Span(BaseModel):
concept_id: str = None
"""Concept ID."""

concept_label: str = None
concept_label: Optional[str] = None
"""Concept label."""

is_suspect: bool = False
is_suspect: Optional[bool] = False
"""Potential hallucination due to ID/label mismatch."""


Expand Down
1 change: 1 addition & 0 deletions src/curate_gpt/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2442,6 +2442,7 @@ def view_objects(view, init_with, settings, object_ids, **kwargs):
else:
for obj in vstore.objects():
print(yaml.dump(obj, sort_keys=False))
print("---")


@view.command(name="unwrap")
Expand Down
2 changes: 2 additions & 0 deletions src/curate_gpt/wrappers/clinical/maxoa_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ def objects(
# open a file handle from a URL using requests
if source_locator is None:
source_locator = self.source_locator
if source_locator is None:
source_locator = self.source_url
if source_locator.startswith("http"):
logger.info(f"Fetching {source_locator}")
with requests.get(source_locator, stream=True) as response:
Expand Down
6 changes: 6 additions & 0 deletions tests/agents/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@

@pytest.fixture
def go_test_chroma_db() -> ChromaDBAdapter:
"""
Fixture for a ChromaDBAdapter instance with the test ontology loaded.
Note: the chromadb is not checked into github - instead,
this relies on test_chromadb_dapter.test_store to create the test db.
"""
db = ChromaDBAdapter(str(INPUT_DBS / "go-nucleus-chroma"))
db.schema_proxy = SchemaProxy(ONTOLOGY_MODEL_PATH)
db.set_collection("test")
Expand Down
2 changes: 1 addition & 1 deletion tests/agents/test_concept_recognizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_concept_recognizer(go_test_chroma_db, text, categories, prefixes, expec
cr.identifier_field = "original_id"
print(f"## METHOD: {method} CATEGORY: {categories} PREFIXES: {prefixes}")
ann = cr.annotate(
text, collection="terms_go", method=method, categories=categories, limit=limit
text, collection="test", method=method, categories=categories, limit=limit
)
print("RESULT:")
print(yaml.dump(ann.dict(), sort_keys=False))
Expand Down
Binary file modified tests/input/dbs/go-nucleus-chroma/chroma.sqlite3
Binary file not shown.

0 comments on commit a212f9a

Please sign in to comment.