Message Boards Message Boards


Set File and Folder Layout for Workbench project?

Posted 5 months ago
2 Replies
0 Total Likes

enter image description here

The image shows my general and naive structure for a Workbench Project. One of the Workbench videos recommends defining the main package (CausalInference`) to simply be a sequence of Needs, which I took to mean that I can reference the sub-packages with the simple command


in the manual testing file CausalInference.nb and the regression testing file The CausalInference.m file is in the included image.

However, none of the functions defined in either GraphPrimitives.m or GraphSeparation.m are found when I execute the .nb or .mt file, and therefore do not run properly. The .nb and .mt files do execute properly when I "Needs" both sub-packages explicitly. Functionally, this should be doable.

How do I get this to work as I expect?

2 Replies
Posted 5 months ago

A different solution may be to use replace the Needs commands in CausalInference.m with Get on the file paths of GraphPrimitives.m and GraphSeparation.m

I think the standard way to do this is to create an init.m file in the FrontEnd/Kernel folder. Then in the init.m file you read in all the packages that make part of the application and do anything else you may need to do as part of the initiation..

One would load the entire application with:

<< CausalInference`

I discuss a fairly standard approach to writing Mathematica applications and why I think more users should consider doing it in an essay A Mathematical Style . The section 'Adding a Package' discusses this particular question.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract