Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show how to parse params into stage cmd #3913

Merged
merged 5 commits into from
Sep 6, 2022
Merged

Conversation

RCdeWit
Copy link
Contributor

@RCdeWit RCdeWit commented Aug 31, 2022

@alex000kim showed me how to do this for a project in which I'm using Papermill to run an entire notebook from a single stage. As far as I could find, this approach isn't yet covered by the docs. Thought it might be worth highlighting, even though it's not always the most proper approach.

@alex000kim showed me how to do this for a project in which I'm using Papermill to run an entire notebook from a single stage. As far as I could find, this approach isn't yet covered by the docs. Thought it might be worth highlighting, even though it's not always the most proper approach.
@RCdeWit RCdeWit added A: docs Area: user documentation (gatsby-theme-iterative) C: ref Content of /doc/*-reference labels Aug 31, 2022
@shcheklein shcheklein temporarily deployed to dvc-org-param-parsing-c-qo7k9r August 31, 2022 14:53 Inactive
@daavoo
Copy link
Contributor

daavoo commented Aug 31, 2022

As far as I could find, this approach isn't yet covered by the docs.

It is documented but quite "hidden": #3670

Thought it might be worth highlighting, even though it's not always the most proper approach.

I think it's a valid and proper approach in many cases. In fact, I consider it a "signature" feature that allows you to track and use parameters in a non-intrusive manner (no need to alter your code to load params as long as you had set up argument parsing)

@github-actions
Copy link
Contributor

Link Check Report

There were no links to check!

@RCdeWit
Copy link
Contributor Author

RCdeWit commented Aug 31, 2022

Ah, thanks for pointing that out, @daavoo! In that case, a link to the relevant section would probably suffice here!

Comment on lines 428 to 439
You can also parse parameters directly from `params.yaml` into the command that
DVC executes in a stage:

```yaml
stages:
train:
cmd: python train_model.py ${seed} model.p
deps:
- train_model.py
- matrix-train.p
params:
- seed
Copy link
Contributor

@jorgeorpinel jorgeorpinel Sep 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wat. I didn't even know this was a thing! It should be in https://dvc.org/doc/user-guide/project-structure/dvcyaml-files TBH.

Not sure it makes sense to have it in a command reference example. Maybe just mentioning templating in general in the stage add ref (if it's not now).

This comment was marked as resolved.

@jorgeorpinel
Copy link
Contributor

a link to the relevant section would probably suffice here!

@RCdeWit

@shcheklein shcheklein temporarily deployed to dvc-org-param-parsing-c-qo7k9r September 1, 2022 21:12 Inactive
@RCdeWit
Copy link
Contributor Author

RCdeWit commented Sep 2, 2022

How about an admon with a reference like this? 😄

@shcheklein shcheklein requested a deployment to dvc-org-param-parsing-c-qo7k9r September 6, 2022 20:30 Abandoned
@shcheklein shcheklein temporarily deployed to dvc-org-param-parsing-c-qo7k9r September 6, 2022 20:32 Inactive
Copy link
Contributor

@jorgeorpinel jorgeorpinel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🙂

@jorgeorpinel jorgeorpinel merged commit f85cc08 into main Sep 6, 2022
@jorgeorpinel jorgeorpinel deleted the param-parsing-cmd branch September 6, 2022 20:33
@jorgeorpinel jorgeorpinel added the type: enhancement Something is not clear, small updates, improvement suggestions label Oct 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: docs Area: user documentation (gatsby-theme-iterative) C: ref Content of /doc/*-reference type: enhancement Something is not clear, small updates, improvement suggestions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants