You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add prediction to dir-path for meta-recipes using and ID
* New unit tests for predict-path with 'dir-path' and 'id' arguments for meta-recipes
* Update search results for meta-recipes
* Unit test for searching for meta-recipes
* Update version to 1.1.1
Copy file name to clipboardExpand all lines: ggd/predict_path.py
+79-44Lines changed: 79 additions & 44 deletions
Original file line number
Diff line number
Diff line change
@@ -18,31 +18,53 @@ def add_predict_path(p):
18
18
help="Predict the install file path of a data package that hasn't been installed yet. (Use for workflows, such as Snakemake)",
19
19
description="Get a predicted install file path for a data package before it is installed. (Use for workflows, such as Snakemake)",
20
20
)
21
+
21
22
c.add_argument(
22
23
"-c",
23
24
"--channel",
24
25
default="genomics",
25
26
choices=[str(x) forxinget_ggd_channels()],
26
27
help="The ggd channel of the recipe to find. (Default = genomics)",
28
+
27
29
)
28
30
c.add_argument(
29
31
"--prefix",
30
32
default=None,
31
33
help="(Optional) The name or the full directory path to an conda environment. The predicted path will be based on this conda environment. When installing, the data package should also be installed in this environment. (Only needed if not predicting for a path in the current conda environment)",
32
34
)
33
-
c2=c.add_argument_group("required arguments")
35
+
36
+
c.add_argument(
37
+
"--id",
38
+
metavar="meta-recipe ID",
39
+
default=None,
40
+
help="(Optional) The ID to predict the path for if the package is a meta-recipe. If it is not a meta-recipe it will be ignored"
41
+
)
42
+
43
+
c2=c.add_argument_group("One Argument Required")
44
+
34
45
c2.add_argument(
35
-
"-pn",
36
-
"--package-name",
37
-
required=True,
38
-
help="(Required) The name of the data package to predict a file path for",
46
+
47
+
"--dir-path",
48
+
action="store_true",
49
+
help="(Required if '--file-name' not used) Whether or not to get the predicted directory path rather then the predicted file path. If both --file-name and --dir-path are provided the --file-name will be used and --dir-path will be ignored",
39
50
)
51
+
40
52
c2.add_argument(
41
53
"-fn",
42
54
"--file-name",
55
+
default=None,
56
+
help="(Required if '--dir-path' not used) The name of the file to predict that path for. It is best if you give the full and correct name of the file to predict the path for. If not, ggd will try to identify the right file, but won't guarantee that it is the right file",
57
+
)
58
+
59
+
c3=c.add_argument_group("Required Arguments")
60
+
61
+
c3.add_argument(
62
+
"-pn",
63
+
"--package-name",
43
64
required=True,
44
-
help="(Required) The name of the file to predict that path for. It is best if you give the full and correct name of the file to predict the path for. If not, ggd will try to identify the right file, but won't guarantee that it is the right file",
65
+
help="(Required) The name of the data package to predict a file path for",
"\n:ggd:predict-path: The {p} data package does not have the final data files listed. This packages needs to be updated. To update, contact the GoGetData team at https://github.com/gogetdata/ggd-recipes\n".format(
122
-
p=args.package_name
123
-
)
124
-
)
139
+
ifargs.file_nameisnotNone:
125
140
126
-
## Check that the file is one of the final-files listed in the metadata
"\n:ggd:predict-path: The {p} data package does not have the final data files listed. This packages needs to be updated. To update, contact the GoGetData team at https://github.com/gogetdata/ggd-recipes\n".format(
151
+
p=args.package_name
148
152
)
149
153
)
150
-
else:
151
-
file_name=args.file_name
154
+
155
+
## Check that the file is one of the final-files listed in the metadata
0 commit comments