Skip to content

Commit b41a818

Browse files
author
Lukas Lang
committed
Added support for ImportDataset[...,Parallelize->{opts}]
1 parent 53889fc commit b41a818

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

ForScience/PacletInfo.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Name -> "ForScience",
55
Description -> "Contains various utility functions and styling to make it easier to use MMA for scientific plots",
66
Creator -> "Lukas Lang & Marc Lehner",
7-
Version -> "0.74.24",
7+
Version -> "0.74.25",
88
MathematicaVersion -> "11.1+",
99
Extensions -> {
1010
{ "Documentation", Language -> "English"},

ForScience/Util/ImportDataset.wl

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ Options[ImportDataset]={"Importer"->Import,"GroupFolders"->Automatic,"TransformF
2020
SyntaxInformation[ImportDataset]={"ArgumentsPattern"->{_,_.,_.,OptionsPattern[]}};
2121

2222

23-
(*matches only options that do not start with RuleDelayed, to ensure unique meaning*)
24-
$IDOptionsPattern=OptionsPattern[]?(Not@*MatchQ[PatternSequence[_:>_,___]]);
23+
Parallelize[ImportDataset[args___],opts___]^:=ImportDataset[args,Parallelize->{opts}]
2524

2625

27-
Parallelize[ImportDataset[args___]]^:=ImportDataset[args,Parallelize->True]
26+
(*matches only options that do not start with RuleDelayed, to ensure unique meaning*)
27+
$IDOptionsPattern=OptionsPattern[]?(Not@*MatchQ[PatternSequence[_:>_,___]]);
2828

2929

3030
ImportDataset[
@@ -205,7 +205,7 @@ End[]
205205
BuildAction[
206206

207207

208-
DocumentationHeader[ImportDataset]=FSHeader["0.19.0","0.74.24"];
208+
DocumentationHeader[ImportDataset]=FSHeader["0.19.0","0.74.25"];
209209

210210

211211
Details[ImportDataset]={
@@ -223,10 +223,11 @@ Details[ImportDataset]={
223223
{Parallelize,False,"Whether to distribute the file import to parallel kernels"}
224224
},
225225
"The \"Importer\" option supports the same specification formats as [*CachedImport*].",
226-
"With the default setting [*\"GroupFolders\"->Automatic*], data are grouped by folders whenever an explicity directory/list of directories is specified.",
226+
"With the default setting [*\"GroupFolders\"->Automatic*], data are grouped by folders whenever an explicit directory/list of directories is specified.",
227227
"With the default setting [*\"TransformFullPath\"->Automatic*], the full path is transformed if the data are not grouped by folders, otherwise only the filename is transformed.",
228228
"With [*Parallelize->True*], cache lookups are done on the main kernel, and actual importing is done on parallel kernels (see [*CachedImport*] for more information).",
229-
"[*Parallelize[[*ImportDataset*][\[Ellipsis]]]*] is equivalent to specifiying [*Parallelize->True*]",
229+
"The option [*Parallelize*] can be set to [*False*], [*True*] or a list of [*Parallelize*] options."
230+
"[*Parallelize[[*ImportDataset*][\[Ellipsis]],opts\[Ellipsis]]]*] is equivalent to specifying [*Parallelize->{opts}*]",
230231
"In the replacement rules specified, patterns for file and directory names should string expressions."
231232
};
232233

@@ -355,11 +356,11 @@ Examples[ImportDataset,"Options","\"GroupFolders\""]={
355356
ExampleInput[ImportDataset["test*/test*.tsv"]]
356357
},
357358
{
358-
"Specifiy that data should always be grouped by directory:",
359+
"Specify that data should always be grouped by directory:",
359360
ExampleInput[ImportDataset["test*/test*.tsv","GroupFolders"->True]]
360361
},
361362
{
362-
"Specifiy that data should never be grouped by directory:",
363+
"Specify that data should never be grouped by directory:",
363364
ExampleInput[ImportDataset["test*.tsv","test*","GroupFolders"->False]]
364365
}
365366
};

0 commit comments

Comments
 (0)