v0.2.1 from main into release#25
Merged
CodeWithBotinaOficial merged 9 commits intoreleasefrom Dec 5, 2025
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.