I executed a few dvc run ... commands without knowing I could use the flag -f to name the resulting .dvc file. I would like to keep things tidy, hence was wondering how could I rename such .dvc files without breaking reproducibility in the future running dvc repro. Shall I use dvc move <fname>.dvc <new_name>.dvc?
Hi @IamGianluca !
Unfortunately dvc move currently only supports stages created by dvc add, because those don't have commands in them, which make moving a little bit more complicated. I have created https://github.com/iterative/dvc/issues/1332 to track progress on adding support for dvc run stages to dvc move, will try to send a patch for it ASAP.
If you want to rename it without moving to another directory you can simply use mv fname.dvc new_fname.dvc. Otherwise you will need to also edit that dvc file to make sure that your command and paths are specified relative to the new dvcfile location. Basically dvc doesn't care how your dvcfiles are named as long as they have .dvc suffix, which is used to discover dvcfiles in a repository and build DAG based on it.
Thanks,
Ruslan
Most helpful comment
Hi @IamGianluca !
Unfortunately
dvc movecurrently only supports stages created bydvc add, because those don't have commands in them, which make moving a little bit more complicated. I have created https://github.com/iterative/dvc/issues/1332 to track progress on adding support fordvc runstages todvc move, will try to send a patch for it ASAP.If you want to rename it without moving to another directory you can simply use
mv fname.dvc new_fname.dvc. Otherwise you will need to also edit that dvc file to make sure that your command and paths are specified relative to the new dvcfile location. Basically dvc doesn't care how your dvcfiles are named as long as they have .dvc suffix, which is used to discover dvcfiles in a repository and build DAG based on it.Thanks,
Ruslan