Message Boards Message Boards

0
|
9041 Views
|
7 Replies
|
5 Total Likes
View groups...
Share
Share this post:

Turning functions into programs and distributing them

Posted 9 years ago

I have written many, >100, functions for use in my day to day engineering design work. These mostly make use of a units package I have also written, and the Symbolise package. Many of the functions also call other functions. To date, I have put most of these functions into a single notebook and load and run this at the start of a new Notebook. This is tedious and a bit slow. Is there a better way?

Should I be splitting these functions into groups and installing them as packages? If so, can I get them to call other packages eg. the units one and does it matter if I get multiple calls to that package?

Finally, I wish to distribute some of the functions as stand alone programs, either as CDFs, if user inputted data is not required, or else with Player Pro. How do I then manage packages?

Any guidance will be gratefully received.

POSTED BY: malcolm woodruff
7 Replies

Write Applications!

If you look in your copy of Presentations you will find an essay on "Writing Applications" that lays out the entire structure. I believe it is the way WRI designed packages to work.

Packages will generally be part of an application. That is the place to put your routines. If later you obtain Workbench (and when is WRI going to provide a Workbench for Version 10!) you could add documentation pages, Anyway, you can build up an application over time but it's very useful to start with the right structure. An application can also contain extra folders and notebooks related to the application. Also palettes and style sheets. It is a good way to organize and preserve work.

You can also produce versions of you applications with packages, perhaps encoding the packages, that also contain style sheets but eliminating documentation, and send these to people who have the free CDF player. They can install them in their CDF player and then read your CDF files that use your packages.

It would be very nice if WRI provided a CDFUserBaseDirectory that paralleled UserBaseDirectory. This would be a better place to put packages associated to CDF files.

Thank you! I will try this and see how I get on. I do have Mathematica 10 so no longer have Workbench. I did look at it when it first came out in an earlier version but found I got on better directly in a Notebook. I will look at it again when the new version appears. I think I am like a good many engineers that come to Mathematica. I started using it as a scratch pad for presenting calculations and then writing my own functions as needed, as I became more proficient at this I have become more ambitious and have ended up writing many programs, some of which are quite complex. Now others want to make use of them and I need to sort out a proper and more logical way of organising and distributing them. Hence the question. Thank you again for your help.

POSTED BY: malcolm woodruff
Posted 9 years ago

To which Presentations are you referring, David?

POSTED BY: David Keith

Sorry, it's the one that I sell for $50 from the Kagi store with links from my web site. It's quite large and oriented to writing literate notebooks with custom graphics, custom tables and custom dynamics. There are many examples and essays so it is a bit like a book.

Posted 9 years ago

Thanks, David. It sounds very useful.

POSTED BY: David Keith

I face the same challenge - packaging initially for my own use, eventually for use by others. I look forward to following this thread.

POSTED BY: Mark Tuttle
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract