mit-ll-responsible-ai / hydra-zen

Create powerful Hydra applications without the yaml files and boilerplate code.
https://mit-ll-responsible-ai.github.io/hydra-zen/
MIT License
317 stars 14 forks source link

Update _get_obj_path to support ClassA.ClassB #708

Closed rsokl closed 2 months ago

rsokl commented 2 months ago

Closes #705

Given:

from hydra_zen import builds, instantiate

class Outer:
    class Inner:
        pass

cfg = builds(Outer.Inner)

Before:

>>> instantiate(cfg)
InstantiationException: Error locating target '__main__.Inner'

After:

>>> instantiate(cfg)
Outer.Inner()