Skip to content

Comments

v0.2.1 from main into release#25

Merged
CodeWithBotinaOficial merged 9 commits intoreleasefrom
main
Dec 5, 2025
Merged

v0.2.1 from main into release#25
CodeWithBotinaOficial merged 9 commits intoreleasefrom
main

Conversation

@CodeWithBotinaOficial
Copy link
Member

No description provided.

Implements a comprehensive system for accurate real-world measurements.

- Adds `UnitConverter` service to handle conversions between pixels, meters, feet, and other units for all calculations (volume, arc length).
- Introduces `PerspectiveCorrector` to compute and apply a homography matrix from a 4-point user selection, correcting for perspective distortion.
- Updates the `AnalysisPanel` with UI controls for initiating calibration and selecting output units.
- Integrates perspective-aware scaling into the calculus strategies and 3D plotting to ensure dimensional accuracy.
- Adds interactive tutorials for the new calibration and unit features.
- Updates all relevant documentation and tests.
feat(measurements): add unit conversion and perspective calibration
This commit introduces a comprehensive refactoring across multiple modules to improve code quality, maintainability, and type safety.

Key changes include:
- Standardized NumPy type hints from specific dtypes (e.g., `NDArray[np.uint8]`) to the more flexible `NDArray[Any]` in high-level interfaces like `CameraController` and `MainWindow`. This accommodates the various data types passed between the GUI, processing, and analysis layers.
- Replaced `matplotlib.axes.Axes` with the more specific `mpl_toolkits.mplot3d.Axes3D` in the 3D plotting module for better type checking and clarity.
- Refactored the `ImagePreprocessor` and its strategies to consistently implement the `IPreprocessor` interface, improving adherence to the Strategy pattern.
- Removed redundant type casts and unused `Any` type hints in `CanvasPanel` and other GUI components.
- Updated `pyproject.toml` with stricter `mypy` configurations to enforce these improvements.
- Corrected minor inconsistencies in function signatures and variable naming throughout the codebase.
Migrates all static analysis settings from the standalone `mypy.ini` file into `pyproject.toml` under the `[tool.mypy]` section. This centralizes project configuration and simplifies the toolchain.

- Deletes `mypy.ini`.
- Adds a comprehensive `[tool.mypy]` configuration to `pyproject.toml`, enabling stricter checks like `disallow_untyped_defs` and `no_implicit_optional`.
- Configures `mypy` to ignore missing imports for third-party libraries like `matplotlib`, `numpy`, and `cv2` to reduce noise.
- Updates the CI workflow in `tests.yml` to correctly run `mypy` without referencing the old config file.
- Refactors type hints and adds explicit `cast` calls across the GUI and visualization modules (`gui_module`, `plot3d`, `visualizers`) to resolve errors surfaced by the new, stricter type-checking rules.
- Corrects a runtime bug in `visualizers.py` where `cv2.fillConvexPoly` was passed an integer for color instead of a tuple.
Introduces a new GitHub Actions workflow, `ci-github-actions.yml`, specifically for running quality checks (linting and type checking) across multiple operating systems.

This change separates the quality assurance steps from the testing pipeline (`tests.yml`), allowing for more granular and focused CI jobs.

Key features of the new workflow:
- Runs on both `ubuntu-latest` and `windows-latest` to ensure cross-platform compatibility.
- Uses `black --check` and `flake8` for code formatting and style enforcement.
- Executes `mypy` for static type analysis.
- Modernizes dependency installation by using `pip install -e '.[dev]'`, which installs dependencies directly from `pyproject.toml`.
- Sets `PYTHONPATH` correctly to ensure linters can find the source modules.
refactor: enhance type safety and API consistency
@CodeWithBotinaOficial CodeWithBotinaOficial merged commit e7b5c9b into release Dec 5, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant