Motivation
Part of the #608 cleanup. The public top-level validate() currently lives in src/hdmf/common/__init__.py, but hdmf.common is the module for the hdmf-common data types; validation is orthogonal to it. The hdmf.validate subpackage already houses the validator classes (ValidatorMap, Validator, ...) but exposes no validate() function.
Proposed change (target a major release)
Depends on #1529 (the namespace-aware validation dispatcher).
Acceptance criteria
hdmf.validate.validate(io) validates against all loaded namespaces in one pass.
hdmf.common.validate(...) still imports and works (deprecated shim).
- Docs/CHANGELOG updated for the new canonical location and the deprecation.
Motivation
Part of the #608 cleanup. The public top-level
validate()currently lives insrc/hdmf/common/__init__.py, buthdmf.commonis the module for the hdmf-common data types; validation is orthogonal to it. Thehdmf.validatesubpackage already houses the validator classes (ValidatorMap,Validator, ...) but exposes novalidate()function.Proposed change (target a major release)
validate(io, ...)in thehdmf.validatesubpackage and export it fromsrc/hdmf/validate/__init__.py. With the namespace-aware dispatcher (Validate against all loaded namespaces via a namespace-aware dispatcher (fixes #608) #1529), the body is a single validation pass over the whole file's builder tree against all loaded namespaces. No per-namespace scoping argument (per-namespace scoping of a whole-file validation is exactly the Account for all loaded namespaces during validation #608 bug).hdmf.common.validateas a thin back-compat shim delegating tohdmf.validate.validate; thenamespace/experimentalscoping args are accepted-but-ignored with a deprecation note.Depends on #1529 (the namespace-aware validation dispatcher).
Acceptance criteria
hdmf.validate.validate(io)validates against all loaded namespaces in one pass.hdmf.common.validate(...)still imports and works (deprecated shim).