Message Boards Message Boards

A Mathematica package for developing, testing and deploying packages

Posted 10 years ago

I have read several posts on the topic of writing packages in Mathematica and noted that many people struggle a bit with the concept. I can recommend the excellent tutorial on the subject posted some time ago. There are however some issues I have found cumbersome when developing Mathematica packages.

When you code the functionality the first time starting from scratch and working with functions declared in a Global context, most things are straight forward and intuitive. But once a package has been deployed and needs to be loaded, things become more complicated. Every time the package needs to be updated or extended, you will have to make the necessary changes to your local package "Package.m" residing in your development directory. To test out your changes, you need to copy your updated file "Package.m" replacing the old "Package.m" file, install the updated version of the package using Get[Pakage] and test it. With frequent changes and updates, this becomes time consuming and prone to errors. It is also difficult to keep track of frequent changes, and you become in doubt of which version of the package you have loaded and are testing out.

PackageDeployment.m encapsulates the tedious steps of deploying the package and ensuring that the version you are currently working on in your local development directory is the one that is loaded into Mathematica. I have included a simple functionality for keeping track of the version history of the package which also helps you to ensure that you are working with the latest version. The package also provides a template for creating a new notebook for developing packages and a template for a creating a package test notebook.

I have attached the package and a short user documentation to this posting. I hope some of you can find this useful, at least I have.

3 Replies

What are the advantages of your code compared to Wolfram Workbench?

POSTED BY: Frank Kampas

Workbench is a comprehensive development environment and the package is for those reluctant to invest in learning Workbench. The package provides some basic functionality for developing packages using Mathematica only.

Ole Christian Astrup,

This is interesting and thank you for the compliment! I will take a look at it over the next few days.

Frank, it's really a matter of taste, ultimately, whether one wants to use Workbench vs Mathematica. There are differing advantages of both. I always prefer to write my code in a notebook--with all the advantages that they have (in place documentation as well as being able to program the notebook itself among many other things) rather than in a text file. But Workbench has advantages as well, especially for those who are very used to a conventional IDE.

POSTED BY: David Reiss
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract