Commit 31373bc
Feat:support customized rglob (#4763)
Currently, when passing a single str as the root data directory, the
`expand_sys_str` function will automatically perform `rglob` to grab all
systems. However, this depends on the structure of the data folder.
There are scenarios where train/val folders are nested, i.e.
"root/dataset\_\*/trn" & "root/dataset\_\*/val".
A customizable rglob function is needed to provide more flexibility when
constructing datasets, and to remove unnecessarily long data lists in
the input file.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Added support for specifying custom glob patterns to filter training
and validation datasets, allowing more flexible and targeted data
selection (PyTorch backend only).
- Introduced recursive pattern matching to improve system directory
selection based on user-defined criteria.
- **Tests**
- Added new test cases to validate the customized glob pattern
functionality for training and validation datasets.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>1 parent ba974fb commit 31373bc
File tree
5 files changed
+83
-5
lines changed- deepmd
- pt/entrypoints
- utils
- source/tests/pt
5 files changed
+83
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
210 | 234 | | |
211 | 235 | | |
212 | 236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
| 118 | + | |
118 | 119 | | |
119 | | - | |
| 120 | + | |
| 121 | + | |
120 | 122 | | |
121 | 123 | | |
122 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2926 | 2926 | | |
2927 | 2927 | | |
2928 | 2928 | | |
| 2929 | + | |
| 2930 | + | |
| 2931 | + | |
2929 | 2932 | | |
2930 | 2933 | | |
2931 | 2934 | | |
| |||
2949 | 2952 | | |
2950 | 2953 | | |
2951 | 2954 | | |
| 2955 | + | |
| 2956 | + | |
| 2957 | + | |
| 2958 | + | |
| 2959 | + | |
| 2960 | + | |
| 2961 | + | |
2952 | 2962 | | |
2953 | 2963 | | |
2954 | 2964 | | |
| |||
2995 | 3005 | | |
2996 | 3006 | | |
2997 | 3007 | | |
| 3008 | + | |
| 3009 | + | |
| 3010 | + | |
2998 | 3011 | | |
2999 | 3012 | | |
3000 | 3013 | | |
| |||
3015 | 3028 | | |
3016 | 3029 | | |
3017 | 3030 | | |
| 3031 | + | |
| 3032 | + | |
| 3033 | + | |
| 3034 | + | |
| 3035 | + | |
| 3036 | + | |
| 3037 | + | |
3018 | 3038 | | |
3019 | 3039 | | |
3020 | 3040 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
730 | 731 | | |
731 | 732 | | |
732 | 733 | | |
733 | | - | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
734 | 737 | | |
735 | 738 | | |
736 | 739 | | |
| |||
740 | 743 | | |
741 | 744 | | |
742 | 745 | | |
| 746 | + | |
| 747 | + | |
743 | 748 | | |
744 | 749 | | |
745 | 750 | | |
746 | 751 | | |
747 | 752 | | |
748 | 753 | | |
749 | 754 | | |
750 | | - | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
751 | 759 | | |
752 | 760 | | |
753 | 761 | | |
| |||
777 | 785 | | |
778 | 786 | | |
779 | 787 | | |
780 | | - | |
| 788 | + | |
| 789 | + | |
781 | 790 | | |
782 | 791 | | |
783 | 792 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
516 | 516 | | |
517 | 517 | | |
518 | 518 | | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
519 | 542 | | |
520 | 543 | | |
0 commit comments