question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Stating dependencies between scripts/modules

See original GitHub issue

Hello!

I hope the explanation below is clear. Please let me know otherwise.

Say I have a utils.py with some awesome helpful classes that I reuse frequently in a certain dvc tracked repo.

Say I have:

  • script1.py that uses utils.py and that takes data0.csv and processes it to data1.csv
  • script2.py that uses utils.py and that takes data1.csv and processes it to data2.csv
  • script3.py that uses utils.py and that takes data2.csv and processes it to data3.csv
  • etc …

(In the example above all scripts are part of the same pipeline but it they could be from different pipelines.)

The point that perhaps could be improved is that, as far as I know, for each data*.csv I have to add to its dependencies the correspondent script and utils.py. And of course that this can cascade if utils.py depends on utils1.py which depends on utils2.py, etc… If that is the case, then I have to remember to, every time utils.py is a dependency, to include the others utils*.py as dependencies as well.

Is there a way in the dvc to say that a scriptB.py depends on scriptA.py so that every time scriptB.py is a dependency, then scriptA.py is also an implicit dependency? Like a variant or an alternative to dvc run where the “output” is not a data file but a .py?

Thanks is advance!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
efiopcommented, Jan 27, 2020

Hi @anotherbugmaster !

Looks like I’ve indeed missed something in the original request, but for the issue you’ve described we have another ticket https://github.com/iterative/dvc/issues/1577 . Please take a look and let us know if that is what you mean 😃

Thanks for the feedback!

1reaction
efiopcommented, Dec 4, 2018

Hi @andrethrill !

Amazing idea! We could totally support that, by implementing something like --no-remove-outs(we will figure out a better name, suggestions are welcome 🙂 ) https://github.com/iterative/dvc/issues/1214 and using it with the already existing -O|--outs-no-cache option. So your command would look like dvc run -d scriptA.py -O scriptB.py --no-remove-outs.

Thanks, Ruslan

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to manage dependencies between scripts in multi-file ...
Since a module's contents are all loaded together, I would like to split apart my files so that each script has its own...
Read more >
Declaring Dependencies between Subprojects
Project dependencies model dependencies between modules. Effectively, you are saying that you depend on the main output of another project.
Read more >
Visualize dependencies between Python Modules - Medium
So I was looking for a way to get a graph of all dependencies between python scripts. Then I found this tool called...
Read more >
Understanding dependency management with Node Modules
You can inspect the dependency tree by using the commands yarn why or npm ls followed by the package name (e.g. yarn why...
Read more >
Handling Compiler and other Package Dependencies
Basic dependency handling: seeing how well the strategy supports the loading of the correct build of a package depending on the previously loaded...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found