Re: Managing packages in the workbench
- To: mathgroup at smc.vnet.net
- Subject: [mg108562] Re: Managing packages in the workbench
- From: "David Park" <djmpark at comcast.net>
- Date: Tue, 23 Mar 2010 04:24:23 -0500 (EST)
Basically, I wouldn't mess around with the default settings. When deploying the application check the $UserBaseDirectory box to determine the location and deploy to there, which should be your private Applications folder. I think you may have gotten an extra Math directory into your structure and then Mathematica won't find the documentation. When creating a new application, "MyApplication" (say): 1) Create an Application Project with name "MyApplicationProject" (say). 2) Give the application the name "MyApplication". This will also be the PacletName. The paclet name is the same as the application name. You can have more than one package but they will all be in the same application and all their routines be documented under the same single paclet. 3) WRI seems to concentrate on the case where there is only a single package and the package name is the same as the application name. In that case, your package name would be MyApplication`MyApplication.m. The BeginPackage statement would be BeginPackage["MyApplication`MyApplication`"] and the entire application would be contained in a MyApplication folder directly within your $UserBaseDirectory/Applications folder. The init.m file would contain the statement Get["MyApplication`MyApplication`"] and the package could be loaded with <<MyApplication`, which will evaluate the init.m file. 4) But you might want to give the package a different name than the application, or you might have several packages. Suppose you have two packages: PackageA.m and PackageB.m, with BeginPackage["MyApplication`PackageA`"] etc. The init.m file would load both packages. All packages would still be loaded with <<MyApplication`. 5) But there is one caveat. To get all the usage message links you have to add an undocumented specification to PacletInfo.m. Under Extensions -> add an item: {"Kernel", "Context"-> {"MyApplication`PackageA`","MyApplication`PackageB`"}} Not only is this undocumented, but it will display warning messages in the PacletInfo.m display. It will also display an "Unknown" folder in the Extensions tab. The warnings can be ignored. I assume this will be straightened up in the next release. That's the basic structure. I wouldn't experiment with putting things in out of the way places until you can get the basic structure working. You should be able to go with the default settings for locations. David Park djmpark at comcast.net http://home.comcast.net/~djmpark/ From: Hannes Kessler [mailto:HannesKessler at hushmail.com] Hello, the thread http://groups.google.de/group/comp.soft-sys.math.mathematica/browse_thread/t hread/a67d924983da8c34# has several good recommendations for the transition to the workbench, thanks to John Fultz, Albert Retey, Adam Berry, David Park and others. Nevertheless, I was not successful to get my packages into workbench management and need som further advice. The Workbench help system wasn't really helpful as all concrete examples relate to the trivial standard case. Anyways, here is my problem with an example: I imported the NumericalAnalysis project from the Wolfram website (http://www.wolfram.com/products/workbench/examples/ ExampleProjects.zip) to the Workbench. Next, I modified In NumericalAnalysis.m the BeginPackage statement to BeginPackage["Math`NumericalAnalysis`"] and in init.m the Get statement to Get["Math`NumericalAnalysis`NumericalAnalysis`"]. Then I built the documentation in the ApplicationTools and exported the application to the directory $UserBaseDirectory/Applications/Math/ (instead to the standard $UserBaseDirectory/Applications). The resulting basic file structure is $UserBaseDirectory/Applications/Math/NumericalAnalysisDocumentation/.. $UserBaseDirectory/Applications/Math/NumericalAnalysis/Kernel/init.m $UserBaseDirectory/Applications/Math/NumericalAnalysis/ NumericalAnalysis.m $UserBaseDirectory/Applications/Math/NumericalAnalysis/PacletInfo.m Needs["Math`NumericalAnalysis`"] works as expected, but the documentation is not found. I played with the project settings "Paclet Location" and "Documentation Location" (setting these to Math/NumericalAnalysis and Math/NumericalAnalysis/Documentation). I tried also modifying the PacletInfo.m file with Extensions -> {{"Documentation", Resources -> {"Guides/NumericalAnalysis"}, Language -> "English", LinkBase -> "Math"}}, but without any success. The NumericalAnalysis help files were not found. So how should one modify the standard Workbench settings to make the help files accessible? Help is greatly appreciated. Best regards, Hannes Kessler