Questions tagged [packages]

Questions on Mathematica packages, which are self-contained bundles of Mathematica code that add new functions and other functionality.

Packages are self-contained bundles of Mathematica code that add new functions and other functionality. They are called using the code Needs["myPackage`"]. Each package uses its own namespace, called Context.

See the official documentation for help on how to set up your own packages. These can be written either in Mathematica itself or using Wolfram Workbench.

On the Wolfram site one will find standard extra packages as well as quite a few Mathematica applications developed from other sources. There is the mathematica-users.org list and a reference for tensor software on wikipedia.

Grassmann, Exterior, Clifford and Geometric algebra packages

Geometric algebra, or Clifford algebra, is a powerful mathematical language that contains vector algebra as a subsystem. It has applications across a range of subjects in physics and engineering, and is well suited to symbolic and numeric computations using Mathematica because of its very regular structure.1

Plotting and Graphics Packages

  • LevelScheme, now called SciDraw: "Publication-quality scientific figures with Mathematica"
    LevelScheme Poster

  • David Park's Presentations Package: This package adds LOTS of custom graphics and other helper functions to Mathematica.
    two-axis plot

  • CurvesGraphics: allows for easily placing arrows along curves (in 2D or 3D space) produced by Plot, ParametricPlot, ParametricPlot3D, and ContourPlot and along the solutions to differential equations given by NDSolve; drawing parametric, contour or stream curves or text on a surface in 3D space, or the intersection line of two surfaces, all curves with optional arrows along them.
    Mobius

870 questions
51
votes
3 answers

How to distribute proprietary Mathematica code

If I want to make package-code completely unreadable, in a way that the end-user can only call my functions, but has no way to re-engineer my definitions, how would I do that? I know I can use Encode to make scrambled code which, quoting the doc,…
halirutan
  • 112,764
  • 7
  • 263
  • 474
44
votes
4 answers

Declaring Package with dependencies in multiples files?

I am new to using Mathematica where I write most of my code in packages. So to get the hang of it I am trying to set up an example of what a project might actually look like. /TestPackage /TestPackage.m (* top level package code goes here…
SumNeuron
  • 5,422
  • 19
  • 51
35
votes
2 answers

What's the difference between these two ways of specifying dependent packages?

What's the difference between these two ways of specifying dependent packages? Method 1: BeginPackage["foo`bar`", {"xxx`", "yyy`"}] Method 2: BeginPackage["foo`bar`"] Needs["xxx`"] Needs["yyy`"] Do they always have the same effect? Note that…
user13253
  • 8,666
  • 2
  • 42
  • 65
32
votes
2 answers

What to be aware when using new-style package?

A new package format is described in this post. This format does not use BeginPackage and Begin. Instead, each package file is scanned before its contents are evaluated, and the context of each symbol is decided beforehand. What are some of the…
Szabolcs
  • 234,956
  • 30
  • 623
  • 1,263
25
votes
2 answers

How safe is Encode?

How safe is an encoded package (using locked, etc)? If I don't specify a personal key, I understand that the encoding key must be somewhere in the Mathematica program itself, and so it is not a perfect system, but: can we trust it for commercial…
P. Fonseca
  • 6,665
  • 2
  • 28
  • 60
24
votes
2 answers

Sharing small code snippets

As part of my never-ending goal of getting Mathematica code to be as easily shared as python packages I was recently thinking about how to make code easy to share. So what's are some good ways to share code snippets, if, say, someone wants to put…
b3m2a1
  • 46,870
  • 3
  • 92
  • 239
18
votes
3 answers

What is the purpose of tags like :Name:, :Context:, etc. in packages?

I noticed that all of the packages that come with Mathematica start with a header that is in a standard format. (See e.g. the header of NIntegrateUtilities` at the end.) There are several commented sections, each starting with a word surrounded by…
Szabolcs
  • 234,956
  • 30
  • 623
  • 1,263
18
votes
0 answers

How to design re-usable sub-modules?

There was a recent question asking about how to design modular packages: Declaring Package with dependencies in multiples files? This is an important issue for which unfortunately there is no One True Solution. People use various approaches, some…
Szabolcs
  • 234,956
  • 30
  • 623
  • 1,263
17
votes
3 answers

How can I return private members of a Mathematica package as the output of package functions without the "PackageName`Private`" prefix?

I have created a Mathematica package that manipulates various types of input physics data into a common form of output data for further analysis. To make this process more efficient and manageable, I assign each specific set of data a different head…
AnInquiringMind
  • 743
  • 3
  • 11
17
votes
1 answer

Making a Mathematica package manager?

I'd like to get a serious discussion started about a package manager. This has come up elsewhere, and many people have implemented their own solutions. It would be nice to have a standardized way to deploy and distribute Mathematica code to…
mfvonh
  • 8,460
  • 27
  • 42
17
votes
1 answer

Mathematica Syntax Coloring in GitHub README

GitHub doesn't auto-detect and color Mathematica code in its markdown. Can we make it do so? This may be trivial, but many README files don't seem to have it.
b3m2a1
  • 46,870
  • 3
  • 92
  • 239
16
votes
1 answer

Can I emulate Wolfram's automatic package updating in my own packages?

It seems that some Wolfram-provided packages are smart enough to automatically check with the Wolfram servers, notice when a newer version is available, and download it, so that the user always has the latest version. I'd like to implement this with…
ibeatty
  • 2,533
  • 11
  • 22
14
votes
3 answers

How to define a package without adding it to $ContextPath

How can you introduce a package, so that it is listed in $Packages, without adding it to $ContextPath? Note that this question is concerned with defining a package when evaluating code, e.g. through evaluating a cell, rather than loading a package…
Joel Klein
  • 5,225
  • 1
  • 31
  • 44
11
votes
2 answers

What is contained in a GeneralUtilities package?

In Programmatic formatting for Mathematica code - possible? masterxilo proposed to use <
mrz
  • 11,686
  • 2
  • 25
  • 81
10
votes
1 answer

Possible Bug of loading Package @ Mathematica 10.1

When I open mathematica, there will pop-up some messages where << package` is in the following file FindFile["init.m"] (* C:\Users\HyperGroups\AppData\Roaming\Mathematica\Kernel\init.m *) package content in the package…
HyperGroups
  • 8,619
  • 1
  • 26
  • 63
1
2 3
9 10