c84decca8d
Feature/rework table handling * test: add cases for configuration boundary * test: add table post-processing tests (cases to ensure preservation of post-table text and metadata during table operations) * test: enhance table handling tests for small and large tables, ensuring proper suffixing and splitting behavior * Fix and clarify intent in comments * fix: enhance handling of post-table text when combining tables * refactor: remove commented-out code in clean_tables function for clarity * test: update post-table text preservation assertions and add debug tracing * refactor: remove unused remove_table_from_page function and its test * refactor: enhance combine method documentation and clarify split_by_size_with_smart_tables logic * Merge remote-tracking branch 'origin/main' into feature/rework-table-handling * refactor: reduce large table threshold from 1000 to 50 rows for better table splitting * Add simple splitting * refactor: uncomment dynamic answer retrieval in run_one_to_n_prompts for improved functionality * Merge remote-tracking branch 'origin/main' into feature/rework-table-handling * refactor: remove unused table handling functions and related constants for cleaner code * refactor: remove unused test functions in preparation for new tests * refactor: streamline continuation table handling by utilizing existing flags * refactor: update table combination logic to include all tables from the main page * refactor: enhance table handling to automatically resolve column mismatches, respect row limits, and improve unit/integration test coverage * rename clean_tables_simple to clean_tables * Update docstrings * refactor: rename table handling functions * Fix indentation and add tests * isort, black * Merge remote-tracking branch 'origin/main' into feature/rework-table-handling Approved-by: Katon Minhas
Field Extraction
Running the Code
This project uses Python's module system for imports. To run the code properly:
-
DO NOT run files directly like this:
python src/client/main.py # ❌ This won't work -
INSTEAD, use Python's module flag (
-m) from the project root:python -m src.client.main # ✅ This is correct
Why?
The code uses absolute imports (e.g., from src.utils import llm_utils) to maintain a clear and consistent package structure. Running with python -m ensures Python can properly resolve these imports.
Development
- All imports should use the
src.prefix (e.g.,from src.utils import llm_utils) - Always run code from the project root directory using the
-mflag - Tests are configured to handle these imports automatically via pytest settings in pyproject.toml
Configuration
The project uses poetry for dependency management and pytest for testing. Key configurations in pyproject.toml:
[tool.pytest.ini_options]
pythonpath=["."]
testpaths = [
"tests"
]
Dependencies
To install dependencies:
poetry install
To run tests:
poetry run pytest
To run type checking:
poetry run mypy .