-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
exp show: Allow for wildcard patterns in include and exclude params/m… #5720
exp show: Allow for wildcard patterns in include and exclude params/m… #5720
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question I have about this is how we should handle matching across dictionary levels.
Currently, we support matching against nested dictionary levels using the .
syntax to separate nested keys. So for a params.yaml
like in our example-get-started
prepare:
split: 0.20
seed: 20170428
featurize:
max_features: 3000
ngrams: 2
train:
seed: 20170428
n_est: 100
min_split: 64
You can currently do --include-params prepare
to match everything in prepare.*
.
in master:
dvc exp show --no-pager --include-params prepare
┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Experiment ┃ Created ┃ auc ┃ prepare.split ┃ prepare.seed ┃
┡━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ workspace │ - │ 0.57756 │ 0.2 │ 20170428 │
│ master │ Nov 11, 2020 │ 0.57756 │ 0.2 │ 20170428 │
...
I'm not sure what the best way for us to handle globbing would be - should it only match within a single nesting level, or should it match the entire string?
For reference, this PR currently only matches inside one nesting level (and not the entire string), so we get:
dvc exp show --no-pager --include-params \*split
ERROR: failed to show experiments - '*split' does not match any known params
dvc exp show --no-pager --include-params \*.split ⏎
┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Experiment ┃ Created ┃ auc ┃ prepare.split ┃
┡━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ workspace │ - │ 0.57756 │ 0.2 │
│ master │ Nov 11, 2020 │ 0.57756 │ 0.2 │
...
In this case, *split
is only compared against the top level keys (prepare
, featurize
, train
) and does not match anything. Using *.split
matches *
against the top level keys, and then split
against the next level of keys (and matches prepare.split
)
Keeping this as-is for simplicity's sake and requiring separate glob patterns per-nesting level (separated by One concern here would be that if I have multiple levels of nesting like
and wanted "any key ending with
With this structure, there is currently no glob pattern which would match "any key ending with |
So on second thought, maybe it would be best to drop the current method of allowing |
I personally consider this the best solution from the perspectives of both user experience (easier to define patterns for complicated nested params) and maintenance (it will simplify the code) . I did not implemented it because, as you have noted, it introduces a backwards incompatible change and felt like that was out of the scope in a first P.R (I have no problem with implementing the full string matching approach if you so choose). |
I will add a test case for nested params as that use case is not currently covered. |
Yeah, I prefer getting rid of the current approach and simplifying to a full string pattern match. The current way has some nice benefits for exact matches to filenames, sections, etc., but it's less intuitive and flexible. I don't think backwards incompatibility is a big deal since it's an experimental feature and I don't think current behavior is even documented. My other question would be whether |
I think keeping it simple w/fnmatch is best for now. If/when we get enough users asking for regex we can consider it at that point. @daavoo you can go ahead and make the changes to drop the existing behavior and only do the glob matching against the full param string |
Unless I am missing something, replacing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good for the most part, just a couple minor notes.
Co-authored-by: Peter Rowlands (변기호) <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@daavoo can you update the docs PR to reflect the path discussion (the wildcard pattern will not be applied to |
Done: iterative/dvc.org#2334 |
…etrics
Fixes #5642
❗ I have followed the Contributing to DVC checklist.
📖 If this PR requires documentation updates, I have created a separate PR (or issue, at least) in dvc.org and linked it here.
Related doc PR: iterative/dvc.org#2334