Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] It'd be nice to have a custom resolver for accessing data files for a given python package. #2943

Open
mmcdermott opened this issue Sep 1, 2024 · 0 comments
Labels
enhancement Enhanvement request

Comments

@mmcdermott
Copy link

🚀 Feature Request

I built a tool that uses Hydra. A second tool is using that tool and wants to have defaults in their config that point to data files within that second tool's package. But, the filepath of those data files depends on how that second file is installed. In python, with importlib you can easily identify the root filepath of a python package or access data files from said package. It'd be nice to have a simple resolver in Hydra that could accomplish this.

Motivation

See above

Pitch

Describe the solution you'd like
I'd like a simple python_package_path or package_file or something resolver added that can return a data file's path for a python package.

Describe alternatives you've considered
I naturally considered implementing my own resolver and adding it via OmegaConf. The problem with this is that then the user of the second tool needs to run a python file from the second tool to see that resolver; if instead, the second tool has, for example, some application that re-routes to a different Hydra app with file defaults set to data files in the package, python code in the second tool would not be run, and the custom resolver wouldn't be loaded.

Are you willing to open a pull request? (See CONTRIBUTING)
Yes, with guidance on where this should best be added.

@mmcdermott mmcdermott added the enhancement Enhanvement request label Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhanvement request
Projects
None yet
Development

No branches or pull requests

1 participant