replaceRoot¶
- lsst.daf.butler.repo_relocation.replaceRoot(configRoot: str, butlerRoot: str | ParseResult | ResourcePath | Path | None) str¶
- Update a configuration root with the butler root location. - No changes are made if the special root string is not found in the configuration entry. The name of the tag is defined in the module variable - BUTLER_ROOT_TAG.- Parameters:
- configRootstr
- Directory root location as specified in a configuration file. 
- butlerRootlsst.resources.ResourcePathExpressionorNone
- Butler root directory. Absolute path is inserted into the - configRootwhere the- BUTLER_ROOT_TAGstring is found. Passing- Nonehere is allowed only as a convenient way to raise an exception (- ValueError).
 
- configRoot
- Returns:
- newRootstr
- New configuration string, with the root tag replaced with the butler root if that tag was present in the supplied configuration root. 
 
- newRoot
- Raises:
- ValueError
- Raised if - butlerRootis not set but a value is required.