Proposal(CLI): after_instantiate_classes hook #20400
Labels
design
Includes a design discussion
feature
Is an improvement or enhancement
lightningcli
pl.cli.LightningCLI
Description & Motivation
Adds a
after_instantiate_classes
hook to the Lightning CLI, called afterself.instantiate_classes()
during the initalization ofLightningCLI
.Pitch
While having the Lightning CLI is great, it is not perfect for each use case out-of-the-box. Hence, you included hooks like
before_instantiate_classes
and describe in the docs how to extend the CLI. Problem is, you cannot extend this feature without hacks or substantial copy-pasta.I think, to further improve the CLI, without adding any complexity, it makes sense to add a
after_instantiate_classes
hook, too.Alternatives
after_instantiate_classes
function before theself._run_subcommand
function.self.subcommand is None
__init__
with the proposed one.Additional context
No response
cc @Borda @tchaton @justusschock @awaelchli @mauvilsa
The text was updated successfully, but these errors were encountered: