Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test suite fixes #63

Merged
merged 4 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Loading