v0.27.2#

This patch release improves error messaging for optional-extra imports, adds bounds validation and warnings for RandomCropPerturber and WaterDropletPerturber, and includes corresponding test coverage.

Updates#

  • Updated import guard error messages across all optional-extra modules to surface the original upstream ImportError when an extra is installed but fails to import due to a transitive dependency issue. Previously, users would only see a message to install the extra even when it was already installed.

  • Updated crop_size check in RandomCropPerturber.perturb to check width and height by element and to warn the user if crop_size is greater than image size.

Additions#

  • Added test_crop_size_bounds to TestRandomCropPerturber to check crop_size warning.

  • Added a UserWarning in WaterDropletPerturber when size_range values are below the minimum effective droplet size of 0.1. The water droplet model enforces a minimum droplet radius of 0.1 in glass coordinate units; values below this threshold are clamped to 0.1. Updated docstrings to document this constraint and advise using num_drops to control the number of droplets instead.

  • Added test_size_range_below_minimum_warns and test_size_range_above_minimum_no_warning to TestWaterDropletPerturber to verify the new warning behavior.