Paramater-based dependecies and outs in DVC from constants file

28 views Asked by At

I am trying to define a single-source set of paths such that it can be modified if necessary from a single spot rather than modifying it in various places across many scripts. I am doing this by simply using a constants.py file:

constants.py

MY_DATA="data/location"
MY_OUT="data/out"

I tried doing it by using the top-level vars declaration in my dvc.yaml but to no avail:

dvc.yaml

vars:
  - constants.py

stages:
  something:
    deps:
      - ${MY_DATA}
    outs:
      - ${MY_OUT}
    cmd: python some_script.py

What is the proper way to do this in DVC? I looked at params too but I'm not sure whether that fits this specific use case or whether it'd be valid.

1

There are 1 answers

0
davemb83 On

That syntax looks correct and works for me when I try it. If you are still having trouble, you can open an issue in https://github.com/iterative/dvc.