v0.27.0#
This is the final minor release before v1.0, focusing on API stabilization, package restructuring, and dependency cleanup. Major changes include the removal of deprecated scoring, image metric, and blackbox generator components; consistent renaming of classes, parameters, and extras; comprehensive import guards for all optional dependencies; and a new random state management system for perturbers. This release also includes entrypoint and container improvements, expanded documentation, and numerous bug fixes.
Breaking Changes#
Removed Components
Removed scoring interfaces and implementations (
ScoreDetections,ScoreClassifications,COCOScorer,NOPScorer,RandomScorer,ClassAgnosticPixelwiseIoUScorer).Removed image metric interfaces and implementations (
ImageMetric,NIIRSImageMetric,SNRImageMetric).Removed blackbox response generator interfaces and implementations (
GenerateBlackboxResponse,GenerateObjectDetectorBlackboxResponse,GenerateClassifierBlackboxResponse,SimpleGenericGenerator,SimplePybsmGenerator).Removed associated example notebooks (
coco_scorer.ipynb,simple_generic_generator.ipynb,simple_pybsm_generator.ipynb,compute_image_metric.ipynb).Removed
CustomPybsmPerturbImageFactory.Removed
PybsmSensorandPybsmScenariofromPerturbImageimplementations and updated notebooks and scripts that previously used these classes.Dissolved the
wrappersubmodule.ComposePerturberandAlbumentationsPerturberare now importable directly fromnrtk.impls.perturb_image. The old import pathnrtk.impls.perturb_image.wrapperno longer exists.Removed the
notebook-testingextra.
Renamed Extras
Renamed the
scikit-imageextra toskimage. Update install commands frompip install nrtk[scikit-image]topip install nrtk[skimage].Renamed the
Pillowextra topillow(lowercase). Update install commands frompip install nrtk[Pillow]topip install nrtk[pillow].The
maiteextra no longer includes API dependencies (fastapi,pydantic,pydantic_settings,uvicorn). Those have moved to thetoolsextra. Users who relied onnrtk[maite]for REST API functionality should installnrtk[tools]instead.
Renamed Classes and Parameters
Renamed perturb image factory classes and modules:
LinspacePerturbImageFactory->PerturberLinspaceFactoryMultivariatePerturbImageFactory->PerturberMultivariateFactoryOneStepPerturbImageFactory->PerturberOneStepFactoryStepPerturbImageFactory->PerturberStepFactory
Renamed PyBSM optical perturber classes, removing the
OTFsuffix:DefocusOTFPerturber->DefocusPerturberCircularApertureOTFPerturber->CircularAperturePerturberDetectorOTFPerturber->DetectorPerturberJitterOTFPerturber->JitterPerturberTurbulenceApertureOTFPerturber->TurbulenceAperturePerturberPybsmOTFPerturber->PybsmPerturberMixin
Renamed
stepparameter tonuminPerturberLinspaceFactoryto matchnumpy.linspaceparameter naming convention.Renamed all references of
additional_paramstokwargsin the codebase and documentation.Renamed
rngandrng_seedparameters toseedacross all random perturbers.Renamed MAITE interoperability classes for consistent task-type prefixes:
JATICDetectionAugmentation->MAITEObjectDetectionAugmentationJATICDetectionTarget->MAITEObjectDetectionTargetJATICClassificationAugmentation->MAITEImageClassificationAugmentationAukusdataCollectionSchema->AukusDataCollectionSchema
Enforced keyword-only arguments (
*) across all perturber constructors and interface methods. Any code using positional arguments will need to switch to keyword arguments.
Random State Changes
Default seeding changed from deterministic (
seed=1) to non-deterministic (seed=None) for all random perturbers.Passing
numpy.random.Generatorobjects is no longer supported. Use integer seeds instead.Changed the default value of the
to_intparameter inPerturberStepFactoryfromTruetoFalse. Users who require integer values should now explicitly passto_int=Truewhen instantiating the factory.
Package Restructuring
Restructured image perturbers based on functionality (environment, geometric, photometric, optical, generative) rather than dependency requirements.
Made perturb image factory submodules private (prefixed with
_) and exposed factory classes directly from the package__init__.py:from nrtk.impls.perturb_image_factory import PerturberLinspaceFactory from nrtk.impls.perturb_image_factory import PerturberMultivariateFactory from nrtk.impls.perturb_image_factory import PerturberOneStepFactory from nrtk.impls.perturb_image_factory import PerturberStepFactory
Moved perturb image factory modules from
nrtk.impls.perturb_image_factory.genericsubdirectory up tonrtk.impls.perturb_image_factory, removing the unnecessarygenericnesting level.Moved
_NOPPerturberfromnrtk.impls.perturb_image.generictonrtk.impls.perturb_image(now a private module).Made MAITE interop modules private:
nrtk.interop.maite.*is nownrtk.interop._maite.*. Public exports are available fromnrtk.interop.Moved entrypoint scripts from
nrtk.interop.maite.utils.bintonrtk.entrypoints.
Updates / New Features#
Random State Management
Added
RandomPerturbImageabstract base class for perturbers using random state. This provides standardized seed handling and the newis_staticoption.Added
is_staticparameter to all random perturbers. WhenTrueand a seed is provided, the RNG state is reset after eachperturb()call, ensuring identical results for repeated calls with the same input.
Perturber Enhancements
Added
clipparameter to skimage perturbers.Added
Dandetaparameters forCircularAperturePerturber.Added a
thetaparameter toNOPPerturberfor interface compatibility.Added support for negative indexing in perturber factory interfaces and implementations.
Replaced albumentations dependency with nrtk-albumentations.
PyBSM Improvements
Removed
PybsmSensorandPybsmScenarioclasses. Sensor and scenario parameters are now passed directly as keyword arguments to PyBSM-based perturbers.Refactored
**kwargshandling fromPybsmPerturberto the shared parent classPybsmPerturberMixin, enabling all PyBSM-based perturbers (DetectorPerturber,TurbulenceAperturePerturber,CircularAperturePerturber,JitterPerturber,DefocusPerturber) to accept**kwargsfor modifying sensor and scenario parameters.Added
paramsproperty toPybsmPerturberMixinto retrieve kwargs passed during initialization.Consolidated pybsm default parameters in a single constants file.
Relaxed altitude validation to only enforce the lower limit in
PybsmPerturberMixin.Updated
pybsmoptional dependency pin from>=0.13.0to>=0.14.3.
Factory Improvements
Added
perturber_kwargstoPerturbImageFactoryinterface to control perturber arguments.Created a generic
PerturberMultivariateFactoryfromCustomPybsmPerturbImageFactoryand_PybsmPerturbImageFactory.
WaterDropletPerturber Optimization
Replaced
geopandasandshapelydependencies with a Numba-accelerated ray casting algorithm for point-in-polygon tests. This reduces the dependency footprint and improves performance for high droplet counts.Refactored numba JIT functions to separate pure Python implementations (
_points_in_polygon_impl,_compute_refraction_mapping_impl) from JIT wrappers. This improves testability and code coverage while maintaining performance when numba is available.Added Protocol type hints for the JIT-compiled functions to ensure proper static type checking without requiring type ignores at call sites.
Removed unused
_to_sphere_section_envmethod that was replaced by the vectorized_compute_refraction_mappingfunction.Renamed internal functions containing
__to_.
Import Guards
All perturber implementations with optional dependencies now have import guards that raise
clear ImportError messages indicating which package to install. Internal modules have been
restructured into private packages with public exports.
Blur perturbers (
AverageBlurPerturber,GaussianBlurPerturber,MedianBlurPerturber) now require theheadlessorgraphicsextra.Enhancement perturbers (
BrightnessPerturber,ColorPerturber,ContrastPerturber,SharpnessPerturber) now require thepillowextra.Noise perturbers (
GaussianNoisePerturber,PepperNoisePerturber,SaltAndPepperNoisePerturber,SaltNoisePerturber,SpeckleNoisePerturber) now require theskimageextra.RandomRotationPerturberandRandomScalePerturberrequire thealbumentationsand (graphicsorheadless) extras.PyBSM optical perturbers (
PybsmPerturber,CircularAperturePerturber,DefocusPerturber,DetectorPerturber,JitterPerturber,TurbulenceAperturePerturber) now require thepybsmextra.WaterDropletPerturbernow requires thescipyandnumbaextras.DiffusionPerturbernow requires thediffusionextra.MAITE augmentations,
nrtk_perturber,nrtk_perturber_cli, and MAITE REST API handlers require themaiteand/ortoolsextras.Added fault-tolerant plugin discovery via
nrtk.interfaces._plugfigurable.PerturbImage.get_impls()andPerturbImageFactory.get_impls()now gracefully skip broken third-party entrypoints instead of crashing.
Entrypoint & Container Updates
Updated failure modes to have a unique exit code and documented each code in
aukus.rst.Updated
--helpcommand for entrypoint script to cover environment variables, directory mounting, and usage syntax.Updated logging to be JSON-formatted.
Removed
generate_config_fileoption from entrypoint for streamlined usage.Added
ENVinstructions to Dockerfile for entrypoint script arguments.Updated
nrtk_perturber_cliinputs to be options instead of arguments.Updated entrypoint script to be executed as a non-root user.
Updated
python:3.11-slimimage to be referenced by digest.Added cosign public key for cosigning docker containers.
Moved
containersfrom an external pipeline to a manual stage.Added semantic versioning to
buildjob for containers.Added
--platform linux/amd64tobuildjob for containers.Updated
scanjob to pull image based on semantic versioning.Added initial
signjob for containers.
Other
Updated to MAITE v0.9.0.
Migrated to
poetryversion>=2.2.0.Bumped
smqtk-coredependency pin to version>=0.21.0.Removed
numpyupper bound and Python-specific versions from pyproject.toml.Standardized internal variable names for perturbed image and perturbed boxes across all image perturbers.
Fixes#
Fixed a bug where input and output bounding boxes shared memory. Added
deepcopyin thePerturbImageinterface and fixed all noise perturbers (GaussianNoisePerturber,PepperNoisePerturber,SaltAndPepperNoisePerturber,SaltNoisePerturber,SpeckleNoisePerturber) where the return value ofsuper().perturb()was discarded, causing output boxes to share identity with the input boxes instead of being deep-copied.Fixed
PerturberOneStepFactoryto preserve float values by passingto_int=Falseto parentPerturberStepFactory. Previously, float values liketheta_value=0.5were incorrectly converted to0due to the parent’s defaultto_int=Truebehavior.Fixed
!=inbbox_perturber_assertions()which should be==.Fixed the formatting of the
Raisessection for all docstrings.Updated
smqtk_pluginsentry points inpyproject.tomlto use fully qualified module paths (nrtk.impls.*instead ofimpls.*).Changed
np.float128tonp.longdoubleinWaterDropletPerturberto support ARM platforms wherenp.float128is not available.
Testing & CI#
Added
tox.iniwith isolated test environments for each optional dependency combination (core,opencv,albumentations,pillow,skimage,pybsm,waterdroplet,diffusion,maite,tools,doctests). Each environment installs only its required extras and runs the corresponding pytest marker-filtered tests.Restructured CI test jobs in
.gitlab-ci/.gitlab-test.yml: split the monolithictox:pytestjob into separate per-Python-version jobs (tox:pytest:py3.10throughtox:pytest:py3.13) and added per-environment tox jobs for finer-grained optional dependency testing.Added
pytest.importorskipguards to test files for graceful skipping when optional test dependencies (httpx,click) are not installed.Fixed notebooks to use correct kernel names and data paths for CI compatibility.
Added pytest fixture which uses the SSIM metric to compare images and optimized
SSIMImageSnapshotExtension._convolve2d().Updated regression testing for the following perturbers to use PSNR and SSIM metrics: all
cv2blur perturbers,DefocusPerturber,CircularAperturePerturber,WaterDropletPerturber.Trimmed redundant
WaterDropletPerturberregression test parametrizations from three seeds to one and downscaled the test image from 512x512 to 128x128, reducing waterdroplet test suite runtime.Refactored
PerturbImageFactorytests to use abstract_make_factorymethod pattern, introducedPerturberFactoryMixinbase test class, and made tests self-contained usingFakePerturberandPerturberFakeFactoryfromtests/fakes.pyinstead of depending onnrtk.implsperturber implementations. AddedPerturbImageFactoryinterface tests intests/interfaces/test_perturb_image_factory.py.Replaced
DummyPerturberwithFakePerturberin test utilities. The new class accepts arbitrary keyword arguments, making it more flexible for factory tests.Added CI jobs from
devel-jaticand removeddevel-jaticinclude from.gitlab-ci.yml.Disabled caching for notebook jobs to improve job time.
Documentation#
Transitioned to the
PyDatatheme for Sphinx docs.Restructured and refined documentation to align with the new perturbation category structure.
Updated all docstrings to be compliant with Google format and to use perturber callable interface.
Updated Interactive Risk Matrix with revised key parameters and risk severity levels. Converted risk factor table into Interactive Risk Matrix with
_static/javascript/custom.js.Added documentation for operational risk modules: extreme illumination, high frequency vibration, sensor noise and resolution, target out-of-focus, radial distortion, atmospheric turbulence, haze, and water droplets.
Added a new input requirements page and a Validation and Trust page.
Added
pybsm_default_config.ipynbto the How-To section.Removed outdated notebooks, obsolete documentation pages, and mentions of
pyBSM factoryinglossary.rst.Refined how-to notebooks and T&E guide notebooks to align with the new perturber structure. Updated variable names to be accurate for their notebook, updated wording and phrasing in various text sections, and fixed numerous grammatical errors and typos.
Added link to albumentations how-to in
risk_factors.rst.Organized perturbers by type on installation page.
Updated API implementations reference and overrode module names so public classes are displayed in docs instead of private submodules, across all perturber categories, perturbation factories, and utility functions.
Updated contact list on README.md and added community collaboration paragraph.