While reviewing movement/io/load.py, I noticed that the loader registry
(_LOADER_REGISTRY) silently overwrites existing loaders if a loader is
registered multiple times for the same source_software.
Currently, register_loader() performs:
_LOADER_REGISTRY[source_software] = wrapper
If multiple loaders are registered for the same software (possibly across
different modules or during imports), the previous loader is silently replaced
without any warning or error.
This could make debugging difficult and lead to unexpected behavior if
duplicate registrations occur.
Possible approaches could include:
- raising an error if a loader is already registered
- emitting a warning before overwriting an existing loader
I'd be happy to open a PR implementing a safeguard if this behavior should be
restricted.
While reviewing
movement/io/load.py, I noticed that the loader registry(
_LOADER_REGISTRY) silently overwrites existing loaders if a loader isregistered multiple times for the same
source_software.Currently,
register_loader()performs:If multiple loaders are registered for the same software (possibly across
different modules or during imports), the previous loader is silently replaced
without any warning or error.
This could make debugging difficult and lead to unexpected behavior if
duplicate registrations occur.
Possible approaches could include:
I'd be happy to open a PR implementing a safeguard if this behavior should be
restricted.