`setup_training_logger` assumes every datastore exposes a private `_config`
#709 opened on Jul 16, 2026
Repository metrics
- Stars
- (282 stars)
- PR merge metrics
- (PR metrics pending)
Description
neural_lam/utils/logging.py:120 and :143 build the logger config with:
config=dict(training=vars(args), datastore=datastore._config)
_config is an MDP-specific private attribute, not part of the datastore interface, so any datastore that doesn't happen to carry one raises AttributeError the moment training starts:
AttributeError: 'DummyDatastore' object has no attribute '_config'. Did you mean: 'config'?
We already work around this in the test suite rather than fixing it: tests/test_cli.py:84, :112 and :145 each inject datastore._config = {} onto a mock before calling the training entry point.
The practical effect is that an in-memory datastore (e.g. tests/dummy_datastore.py::DummyDatastore) cannot be driven through the real training entry point without patching it first.
I suggest the minimal fix:
config=dict(training=vars(args), datastore=getattr(datastore, "_config", None))
Logging None for a datastore with no raw config file is fine. the cleaner option might be smth like a public accessor on the datastore interface, not sure...