11
$\begingroup$

I occasionally discover Options which look like they might be useful, if only I knew which functions used that option. Is there a resource that lists all the functions which use a given option? What is the best way to search for all functions which use a given option?

In my case today i'm looking for functions that use ProgressReporting, but the question stands generally.

I tried Select[Names["*`*"], MemberQ[Options[ToExpression[#]], ProgressReporting -> _] &] but that's way too much to trawl through.

$\endgroup$

2 Answers 2

12
$\begingroup$

You can use WolframLanguageData with the property "SymbolsUsingAsOption" for this:

WolframLanguageData["ProgressReporting", "SymbolsUsingAsOption"]
(* {BayesianMaximization,  
    BayesianMaximizationObject, 
    BayesianMinimization,  
    BayesianMinimizationObject,  
    ChatEvaluate,  
    FindSystemModelEquilibrium,  
    FunctionCompile,  
    ImageSynthesize,  
    LaunchKernels,  
    LLMExampleFunction,  
    LLMFunction,  
    LLMResourceFunction,  
    LLMSynthesize,  
    ParallelArray,  
    ParallelCombine,  
    ParallelDo,  
    Parallelize,  
    ParallelMap,  
    ParallelProduct,  
    ParallelSum,  
    ParallelTable,  
    PrimePi,  
    ReconstructionMesh,  
    SpeechRecognize,  
    SystemModel,  
    SystemModelCalibrate,  
    SystemModelLinearize,  
    SystemModelMeasurements,  
    SystemModelParametricSimulate,  
    SystemModelSimulate,  
    SystemModelSimulateSensitivity,  
    SystemModelUncertaintyPlot,  
    TestReport,  
    TextSummarize,  
    TrainImageContentDetector,  
    TrainTextContentDetector,  
    WaitAll} *)
$\endgroup$
1
  • $\begingroup$ This is incredibly helpful Lukas, I had no idea this existed. $\endgroup$ Commented Apr 3 at 2:20
2
$\begingroup$

currently trying to look at a subset by first getting all the names in the System` context:

namepatterns = "System`" <> # <> "*" & /@ ToUpperCase@Alphabet[];
allnameswithoptions = Select[Names[#], optionslength] & /@ namepatterns;

but even just generating that list of names with at least one option is slow, took like a minute for just "System`A*" and "System`B*" and its still working on the rest of the alphabet, oh wait it just finished. there are 2130 names in that list.

ok, well, looks like Select[#, MemberQ[Options[ToExpression[#]], ProgressReporting-> _] &] &/@allnameswithpatterns yields the following list:

  • FindSystemModelEquilibrium
  • FunctionCompile
  • SystemModel
  • SystemModelCalibrate
  • SystemModelLinearize
  • SystemModelMeasurements
  • SystemModelParametricSimulate
  • SystemModelSimulate
  • SystemModelSimulateSensitivity
  • SystemModelUncertaintyPlot
  • TrainImageContentDetector
  • TrainTextContentDetector
$\endgroup$
1
  • $\begingroup$ You probably want KeyExistsQ[Options[ToExpression[#]], ProgressReporting] &. Or check for both Rule and RuleDelayed option forms. $\endgroup$
    – Goofy
    Commented Mar 30 at 21:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.