Summary
Add support for file-path syntax in pconfigs.run, allowing users to specify configs as path/to/module.py:config_name in addition to the existing dotpath syntax path.to.module.config_name.
Motivation
Code editors make it trivial to copy the file path to a module (e.g., via "Copy Relative Path"), but converting that path to a dotpath requires manual effort: replacing / with ., stripping the .py extension, and prepending the repo package root. This friction is a daily papercut when iterating on experiments. The file-path syntax would let users copy a path directly from their editor and paste it into the run command without any transformation.
Proposed behavior
The runner accepts a colon-delimited file path and config name:
# New syntax — file path with colon-separated config name
python -m pconfigs.run path/to/pconfig/module.py:config
# Existing syntax — unchanged
python -m pconfigs.run path.to.pconfig.module.config
The runner detects which form is being used by checking whether the argument contains a / or ends in .py (before the :). If the file-path form is detected, the runner imports the module from the given path and looks up the named attribute (config in the example above). If no :name is given, the runner could default to config (the conventional instance name) or raise a clear error asking the user to specify one.
Current workaround
Manually convert the file path to a dotpath before running:
# File path from editor: genrg/pconfig/foo/bar.py
# Must be converted to:
python -m pconfigs.run genrg.pconfig.foo.bar.config
Summary
Add support for file-path syntax in
pconfigs.run, allowing users to specify configs aspath/to/module.py:config_namein addition to the existing dotpath syntaxpath.to.module.config_name.Motivation
Code editors make it trivial to copy the file path to a module (e.g., via "Copy Relative Path"), but converting that path to a dotpath requires manual effort: replacing
/with., stripping the.pyextension, and prepending the repo package root. This friction is a daily papercut when iterating on experiments. The file-path syntax would let users copy a path directly from their editor and paste it into the run command without any transformation.Proposed behavior
The runner accepts a colon-delimited file path and config name:
The runner detects which form is being used by checking whether the argument contains a
/or ends in.py(before the:). If the file-path form is detected, the runner imports the module from the given path and looks up the named attribute (configin the example above). If no:nameis given, the runner could default toconfig(the conventional instance name) or raise a clear error asking the user to specify one.Current workaround
Manually convert the file path to a dotpath before running: