# Problem with WolframModel function in a Package

Posted 11 months ago
1813 Views
|
6 Replies
|
0 Total Likes
|
 I started a toolbox for the Wolfram Physics Project. This was first implemented as a Module in Cloud Access Basic because I'am a beginner in Wolfram Language. Everything was fine in the Module form. Then I transformed my first function to a Package in Wolfram|One. The function "documentrule" (I know that I have to use Uppercase characters in the naming) just displays some aspects of a rule.As you can see in the attached Notebook the evaluation of the Initialization cell is Ok. But then I have some erros when the second WolframModel function is evaluated when the "documentrule" function is called. I guess that there is some problem with the arguments evaluation at "[r, Automatic, 3]". In the previous line WolframModel with only one argument is ok.The other 2 similar lines are commented to reduce the clutter, they have the same error.Is there someone who can help me?
Answer
6 Replies
Sort By:
Posted 11 months ago
 I tried further on and came to following conclusion: There is a difference in evaluation of WolframModel in the Cloud Access and Desktop of the same Notebook. Is there some specific setup necessity for Desktop? Cloud processing is ok: Processed in Desktop, not ok:
Answer
Posted 11 months ago
 Hi Chris,It worked for me $Version (* 12.1.1 for Mac OS X x86 (64-bit) (June 19, 2020) *) wm = ResourceFunction["WolframModel"] wm[rulexx, Automatic, 3]["StatesPlotsList", VertexLabels -> Automatic]  Answer Posted 11 months ago  Thanks for the hint. Package is working now.But I'm still wondering why it's not working with the short hand expression of the WolframModel function. What is the meaning of the first version of the function (SetReplaceWolframModel)? Answer Posted 11 months ago  Hi Chris, I encountered the same issue last week under similar circumstances. With a bit of tinkering I was able to "Uniconize" the short hand expression and got..... ResourceFunction[ ResourceObject[ Association["Name" -> "WolframModel", "ShortName" -> "WolframModel", "UUID" -> "f6eb4e01-15fd-4c52-857b-52f627495c74", "ResourceType" -> "Function", "Version" -> "4.0.0", "Description" -> "Generate evolutions of Wolfram model systems", "RepositoryLocation" -> URL["https://www.wolframcloud.com/objects/resourcesystem/api/1.0"]\ , "SymbolName" -> "FunctionRepository$b6b79aa4e83b4f46b8590449b5d727f9\ WolframModel", "FunctionLocation" -> CloudObject[ "https://www.wolframcloud.com/obj/01613fcc-8070-4284-8425-\ 3c7af256a88f"]], ResourceSystemBase -> Automatic]] `So it appears that this version is tied to the cloud and probably requires above basic access to work with desktop applications. In my case, I ended up clicking on documentation for those functions which pulled them up in a browser and used copy/paste which gives a regular text based command. Hopefully, this answers your question.Anton
Answer
Posted 11 months ago
 Hello Anton,I had no problems when working Cloud Access Basic cloud operation only. But when I switched to Wolfram|One Desktop the problems begun. Now I define the function wm = ResourceFunction["WolframModel"] in the package outside the private part. I use now wm instead of the red-dot function and every thing works (hint from Rohit). The only problem is that the popup help of the function is gone.
Answer
Posted 11 months ago
 Chris,Perhaps you are right and it has nothing to do with basic vs paid package. I found that red-dot function is called 'free-form input" and if you look at upgraded features one of them is: "Free-form inputs use plain English to get instant answers and rich interactive results". Try ctrl+= on your desktop version to see whether it even supports that feature. ResourceFunction[""] commands, on the other hand, refer to your computer hard drive and do not require cloud access. Being able to use free-form input in the cloud but not on your computer sort of makes sense as those two are very different environments.Anton
Answer
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments