diff --git a/src/curate_gpt/agents/concept_recognition_agent.py b/src/curate_gpt/agents/concept_recognition_agent.py index 7556f33..f54eb83 100644 --- a/src/curate_gpt/agents/concept_recognition_agent.py +++ b/src/curate_gpt/agents/concept_recognition_agent.py @@ -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.""" diff --git a/src/curate_gpt/cli.py b/src/curate_gpt/cli.py index 56bfc90..880d2d1 100644 --- a/src/curate_gpt/cli.py +++ b/src/curate_gpt/cli.py @@ -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") diff --git a/src/curate_gpt/wrappers/clinical/maxoa_wrapper.py b/src/curate_gpt/wrappers/clinical/maxoa_wrapper.py index 3441aa3..0821da3 100644 --- a/src/curate_gpt/wrappers/clinical/maxoa_wrapper.py +++ b/src/curate_gpt/wrappers/clinical/maxoa_wrapper.py @@ -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: diff --git a/tests/agents/conftest.py b/tests/agents/conftest.py index f395107..59e0843 100644 --- a/tests/agents/conftest.py +++ b/tests/agents/conftest.py @@ -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") diff --git a/tests/agents/test_concept_recognizer.py b/tests/agents/test_concept_recognizer.py index fc7d9c2..fc138b7 100644 --- a/tests/agents/test_concept_recognizer.py +++ b/tests/agents/test_concept_recognizer.py @@ -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)) diff --git a/tests/input/dbs/go-nucleus-chroma/chroma.sqlite3 b/tests/input/dbs/go-nucleus-chroma/chroma.sqlite3 index d960ebe..a7c8db7 100644 Binary files a/tests/input/dbs/go-nucleus-chroma/chroma.sqlite3 and b/tests/input/dbs/go-nucleus-chroma/chroma.sqlite3 differ