Skip to content
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
2 changes: 1 addition & 1 deletion compass/extraction/date.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ async def _parse(self, doc):
)
if response:
date = _parse_date([response])
logger.debug("Parsed date from URL: %s", str(date))
logger.debug("Parsed date from URL: %s", date)
return date

if not doc.raw_pages:
Expand Down
6 changes: 3 additions & 3 deletions compass/extraction/solar/ordinance.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ async def _check_chunk_contains_ord(self, key, text_chunk):
content=text_chunk,
usage_sub_label=(LLMUsageCategory.DOCUMENT_CONTENT_VALIDATION),
)
logger.debug("LLM response: %s", str(content))
logger.debug("LLM response: %s", content)
return content.get(key, False)

async def _check_chunk_is_for_utility_scale(self, key, text_chunk):
Expand All @@ -203,7 +203,7 @@ async def _check_chunk_is_for_utility_scale(self, key, text_chunk):
content=text_chunk,
usage_sub_label=(LLMUsageCategory.DOCUMENT_CONTENT_VALIDATION),
)
logger.debug("LLM response: %s", str(content))
logger.debug("LLM response: %s", content)
return content.get(key, False)


Expand Down Expand Up @@ -267,7 +267,7 @@ async def check_chunk(self, chunk_parser, ind):
LLMUsageCategory.DOCUMENT_PERMITTED_USE_CONTENT_VALIDATION
),
)
logger.debug("LLM response: %s", str(content))
logger.debug("LLM response: %s", content)
contains_district_info = content.get(key, False)

if contains_district_info:
Expand Down
6 changes: 3 additions & 3 deletions compass/extraction/wind/ordinance.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ async def _check_chunk_contains_ord(self, key, text_chunk):
content=text_chunk,
usage_sub_label=(LLMUsageCategory.DOCUMENT_CONTENT_VALIDATION),
)
logger.debug("LLM response: %s", str(content))
logger.debug("LLM response: %s", content)
return content.get(key, False)

async def _check_chunk_is_for_utility_scale(self, key, text_chunk):
Expand All @@ -220,7 +220,7 @@ async def _check_chunk_is_for_utility_scale(self, key, text_chunk):
content=text_chunk,
usage_sub_label=(LLMUsageCategory.DOCUMENT_CONTENT_VALIDATION),
)
logger.debug("LLM response: %s", str(content))
logger.debug("LLM response: %s", content)
return content.get(key, False)


Expand Down Expand Up @@ -285,7 +285,7 @@ async def check_chunk(self, chunk_parser, ind):
LLMUsageCategory.DOCUMENT_PERMITTED_USE_CONTENT_VALIDATION
),
)
logger.debug("LLM response: %s", str(content))
logger.debug("LLM response: %s", content)
contains_district_info = content.get(key, False)

if contains_district_info:
Expand Down
2 changes: 1 addition & 1 deletion compass/scripts/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ async def _processed_jurisdiction_info(self, *args, **kwargs):

keys = ["source", "date", "jurisdiction", "ord_db_fp"]
doc_info = {key: doc.attrs.get(key) for key in keys}
logger.debug("Saving the following doc info:\n%s", str(doc_info))
logger.debug("Saving the following doc info:\n%s", doc_info)
return doc_info

async def _process_jurisdiction_with_logging(
Expand Down
2 changes: 1 addition & 1 deletion compass/validation/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ async def _check_chunk_for_legal_text(self, key, text_chunk):
doc_is_from_ocr=self.doc_is_from_ocr,
)
out = await run_async_tree(tree, response_as_json=True)
logger.debug("LLM response: %s", str(out))
logger.debug("LLM response: %s", out)
return out.get(key, False)


Expand Down
2 changes: 1 addition & 1 deletion compass/validation/location.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ async def _validator_check_for_doc(validator, doc, score_thresh=0.9, **kwargs):
validator.META_SCORE_KEY,
score,
doc.attrs.get("source", "Unknown"),
str(score >= score_thresh),
score >= score_thresh,
score_thresh,
)
return score >= score_thresh
Expand Down
17 changes: 17 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,23 @@
),
]


def skip_pydantic_methods(app, what, name, obj, skip, options):
if name in (
"model_dump_json",
"model_json_schema",
"model_dump",
"model_construct",
"model_copy",
):
return True
return None


def setup(app):
app.connect("autodoc-skip-member", skip_pydantic_methods)


# -- Extension configuration -------------------------------------------------

autosummary_generate = True # Turn on sphinx.ext.autosummary
Expand Down
15 changes: 13 additions & 2 deletions docs/source/dev/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,19 @@ Ruff is an "opinionated" formatter and linter designed to enhance code readabili
maintainability, and consistency that is extremely fast.

You can use the `Ruff VSCode extension <https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff>`_
if you are developing using VSCode. Alternatively, you can set a pre-commit hook to run Ruff.
This would perform automatic code formatting before any code is committed to the repository.
if you are developing using VSCode. If you do so, make sure to set the path to the ``ruff``
executable in your VSCode settings to point to the ``ruff`` installed in the ``pdev`` environment.
You can do this by adding the following to your ``settings.json`` file:

.. code-block:: json

"ruff.path": [
"${workspaceFolder}/.pixi/envs/pdev/bin/ruff"
]

Alternatively, you can set a pre-commit hook to run Ruff. This would perform automatic code formatting
before any code is committed to the repository.

Both of these tools ensure that all code contributions meet the established quality standards,
minimizing the chances of introducing formatting inconsistencies or potential issues.

Expand Down
124 changes: 59 additions & 65 deletions pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ ocr = [
dev = [
"jupyter>=1.0.0,<1.1",
"pipreqs>=0.4.13,<0.5",
"ruff>=0.8.0,<0.9",
"ruff-lsp>=0.0.60,<0.0.61",
"ruff>=0.13.3,<0.14",
"ruff-lsp>=0.0.62,<0.0.63",
]
test = [
"flaky>=3.8.1,<4",
Expand Down Expand Up @@ -211,8 +211,8 @@ tf-playwright-stealth = ">=1.2.0,<2"
geopandas = ">=1.0.1,<2"
jupyter = ">=1.0.0,<1.1"
pipreqs = ">=0.4.13,<0.5"
ruff = ">=0.8.0,<0.9"
ruff-lsp = ">=0.0.60,<0.0.61"
ruff = ">=0.13.3,<0.14"
ruff-lsp = ">=0.0.62,<0.0.63"
seaborn = ">=0.13.2,<0.14"

[tool.pixi.feature.python-test.dependencies]
Expand Down