Skip to content

params/metrics: diff: implement tabulated markdown output (--show-md) #3757

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

Merged
merged 4 commits into from
May 10, 2020

Conversation

skshetry
Copy link
Collaborator

@skshetry skshetry commented May 7, 2020

Via --show-md on diffs.

iterative/dvc.org#1266

  • ❌ I will check DeepSource, CodeClimate, and other sanity checks below. (We consider them recommendatory and don't expect everything to be addressed. Please fix things that actually improve code or fix bugs.)

Thank you for the contribution - we'll try to review it as soon as possible. πŸ™

  • Still unsure about what should be shown in dvc diff --show-md.

The dvc params diff and similar commands would output header centered. With this change, it will be left-aligned.

Previously:

$ dvc params diff
   Path           Param        Old     New
params.yaml   lr               None   0.0041
params.yaml   process.bow      None   15000
params.yaml   process.thresh   None   0.98
params.yaml   train.epochs     None   70
params.yaml   train.layers     None   9

Now:

$ dvc params diff
Path         Param           Old    New
params.yaml  lr              None   0.0041
params.yaml  process.bow     None   15000
params.yaml  process.thresh  None   0.98
params.yaml  train.epochs    None   70
params.yaml  train.layers    None   9
$ dvc params diff --show-md
| Path        | Param          | Old   | New    |
|-------------|----------------|-------|--------|
| params.yaml | lr             | None  | 0.0041 |
| params.yaml | process.bow    | None  | 15000  |
| params.yaml | process.thresh | None  | 0.98   |
| params.yaml | train.epochs   | None  | 70     |
| params.yaml | train.layers   | None  | 9      |

^ Same output in markdown parsed by Github:

Path Param Old New
params.yaml lr None 0.0041
params.yaml process.bow None 15000
params.yaml process.thresh None 0.98
params.yaml train.epochs None 70
params.yaml train.layers None 9

Resolve #3690

@skshetry skshetry added the enhancement Enhances DVC label May 7, 2020
@skshetry skshetry self-assigned this May 7, 2020
@skshetry skshetry marked this pull request as draft May 7, 2020 14:20
@skshetry skshetry marked this pull request as ready for review May 8, 2020 09:34
@skshetry skshetry changed the title [WIP] params/metrics: diff: implement tabulated markdown output (--show-md) params/metrics: diff: implement tabulated markdown output (--show-md) May 8, 2020
@@ -78,7 +78,7 @@ def run(self):
"pydot>=1.2.4",
"speedcopy>=2.0.1; python_version < '3.8' and sys_platform == 'win32'",
"flatten_json>=0.1.6",
"texttable>=0.5.2",
"tabulate>=0.8.7",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This does not support aligning headers. It does have colalign but it aligns the whole column, and, I don't think it's a deal-breaker.

@skshetry skshetry requested a review from efiop May 8, 2020 10:15
@skshetry skshetry removed their assignment May 8, 2020
@skshetry skshetry requested review from pared and pmrowla May 8, 2020 10:16
@skshetry skshetry self-assigned this May 8, 2020
@dmpetrov
Copy link
Member

dmpetrov commented May 8, 2020

@skshetry thank you for making the changes!
I added a bit more context - #3690 (comment)

for path in paths:
rows.append([status, path])

return table(["Status", "Path"], rows, True)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should the output's column be swapped?

Path Status
model.pkl Added

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

^ and also capitalized?

Copy link
Contributor

Choose a reason for hiding this comment

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

Should the output's column be swapped?

Currently, it is in the order in which it was requested. And, which matches git status.

^ and also capitalized?

not capitalized because it was requested in that form and matches git status.

@skshetry skshetry deleted the show-md-diff branch May 26, 2020 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhances DVC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

--show-md output for metrics, params and dvc diff
4 participants