From 6d3d3f3a8698ef40be50c083af6aa97ecdf6cc19 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 6 Aug 2026 15:27:26 -0600 Subject: [PATCH 1/6] Add more attrs to doc output --- compass/services/threaded.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compass/services/threaded.py b/compass/services/threaded.py index 4fe6c2d58..2579e902c 100644 --- a/compass/services/threaded.py +++ b/compass/services/threaded.py @@ -649,16 +649,22 @@ def _compile_doc_info(doc): "effective_month": month if month is not None and month > 0 else None, "effective_day": day if day is not None and day > 0 else None, "ord_filename": Path(out_fp or "unknown").name, + "doc_type": doc.attrs.get("doc_type"), "num_pages": doc.attrs.get("num_pages", len(doc.pages)), "checksum": doc.attrs.get("checksum"), "is_pdf": is_pdf_doc(doc), "from_ocr": doc.attrs.get("from_ocr", False), + "conversion_time_seconds": doc.attrs.get("conversion_time_seconds"), + "mean_confidence": doc.attrs.get("mean_confidence"), + "low_score_confidence": doc.attrs.get("low_score_confidence"), + "collection_step_rank": doc.attrs.get("collection_step_rank"), "relevant_text_ngram_score": doc.attrs.get( "relevant_text_ngram_score" ), "permitted_use_text_ngram_score": doc.attrs.get( "permitted_use_text_ngram_score" ), + "from_steps": doc.attrs.get("from_steps"), } From c4fa28ccb99cb85e3545bca35d6978754c0afc5b Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 6 Aug 2026 15:29:24 -0600 Subject: [PATCH 2/6] Add prop --- compass/services/threaded.py | 1 + 1 file changed, 1 insertion(+) diff --git a/compass/services/threaded.py b/compass/services/threaded.py index 2579e902c..afb830f86 100644 --- a/compass/services/threaded.py +++ b/compass/services/threaded.py @@ -655,6 +655,7 @@ def _compile_doc_info(doc): "is_pdf": is_pdf_doc(doc), "from_ocr": doc.attrs.get("from_ocr", False), "conversion_time_seconds": doc.attrs.get("conversion_time_seconds"), + "conversion_status": doc.attrs.get("conversion_status"), "mean_confidence": doc.attrs.get("mean_confidence"), "low_score_confidence": doc.attrs.get("low_score_confidence"), "collection_step_rank": doc.attrs.get("collection_step_rank"), From c9cbf0e5703c98bcc02443a4ec1bcd79bd93de39 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 6 Aug 2026 15:33:05 -0600 Subject: [PATCH 3/6] Add `"num_features_extracted"` to doc attrs --- compass/plugin/ordinance.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/compass/plugin/ordinance.py b/compass/plugin/ordinance.py index 08ff7b017..16c00c6ad 100644 --- a/compass/plugin/ordinance.py +++ b/compass/plugin/ordinance.py @@ -835,9 +835,11 @@ async def parse_single_doc_for_structured_data(self, extraction_context): doc_for_extraction, out_fn_stem=self.jurisdiction.full_name ) extraction_context.attrs["structured_data"] = data_df + n_feats = num_ordinances_dataframe(data_df) + extraction_context.attrs["num_features_extracted"] = n_feats logger.info( "%d ordinance value(s) found for %s from doc:\n%s. ", - num_ordinances_dataframe(data_df), + n_feats, self.jurisdiction.full_name, doc_for_extraction, ) @@ -897,9 +899,11 @@ async def parse_multi_doc_context_for_structured_data( ) extraction_context.attrs["structured_data"] = data_df + n_feats = num_ordinances_dataframe(data_df) + extraction_context.attrs["num_features_extracted"] = n_feats logger.info( "%d ordinance value(s) found for %s in %d docs. ", - num_ordinances_dataframe(data_df), + n_feats, self.jurisdiction.full_name, extraction_context.num_documents, ) @@ -938,6 +942,7 @@ async def parse_multi_doc_concat(self, extraction_context): data_dfs = await asyncio.gather(*tasks) all_data = [] + total_features = 0 for doc_ind, (data_df, doc) in enumerate( zip(data_dfs, extraction_context, strict=True), start=1 ): @@ -950,9 +955,11 @@ async def parse_multi_doc_concat(self, extraction_context): await extraction_context.mark_doc_as_data_source( doc, out_fn_stem=f"{self.jurisdiction.full_name}_{doc_ind}" ) + num_found = num_ordinances_dataframe(data_df) + total_features += num_found logger.info( "%d ordinance value(s) found for %s from doc:\n%s. ", - num_ordinances_dataframe(data_df), + num_found, self.jurisdiction.full_name, doc, ) @@ -968,6 +975,7 @@ async def parse_multi_doc_concat(self, extraction_context): extraction_context.attrs["structured_data"] = pd.concat( all_data, ignore_index=True ) + extraction_context.attrs["num_features_extracted"] = total_features return extraction_context async def parse_multi_doc_merge(self, extraction_context): From 5385fad873be2b87599ee81eee2e13dac6f06994 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 6 Aug 2026 15:33:45 -0600 Subject: [PATCH 4/6] Add attr --- compass/services/threaded.py | 1 + 1 file changed, 1 insertion(+) diff --git a/compass/services/threaded.py b/compass/services/threaded.py index afb830f86..f10a15589 100644 --- a/compass/services/threaded.py +++ b/compass/services/threaded.py @@ -645,6 +645,7 @@ def _compile_doc_info(doc): out_fp = doc.attrs.get("source_fp", doc.attrs.get("out_fp")) return { "source": doc.attrs.get("source"), + "num_features_extracted": doc.attrs.get("num_features_extracted"), "effective_year": year if year is not None and year > 0 else None, "effective_month": month if month is not None and month > 0 else None, "effective_day": day if day is not None and day > 0 else None, From 11eeb0d5ef753bbd425645634f20cf4ee7a66708 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 6 Aug 2026 15:34:25 -0600 Subject: [PATCH 5/6] Add error to catch --- compass/services/openai.py | 1 + 1 file changed, 1 insertion(+) diff --git a/compass/services/openai.py b/compass/services/openai.py index a089d6cc9..2205c4451 100644 --- a/compass/services/openai.py +++ b/compass/services/openai.py @@ -218,6 +218,7 @@ def _update_pb_cost(self, response): openai.RateLimitError, openai.APITimeoutError, openai.BadRequestError, + openai.APIConnectionError, ), ) async def _call_gpt(self, **kwargs): From 1bc86367e3aee18283bec6347764d664f622df4d Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 7 Aug 2026 11:02:59 -0600 Subject: [PATCH 6/6] Update --- README.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 4ad75c2b6..1dd030acd 100644 --- a/README.rst +++ b/README.rst @@ -71,8 +71,8 @@ or check out summaries of the validation results in the `validation report `_: +If you would like to install and run COMPASS from source, we recommend using +`pixi `_: .. code-block:: bash git clone git@github.com:NatLabRockies/COMPASS.git; cd COMPASS pixi run compass -For detailed instructions and troubleshooting, see the `installation documentation `_. +For detailed instructions and troubleshooting, see the +`installation documentation `_. Quickstart