MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How to store data files in packages

  • To: mathgroup at smc.vnet.net
  • Subject: [mg103664] Re: [mg103663] How to store data files in packages
  • From: "David Annetts" <david.annetts at iinet.net.au>
  • Date: Thu, 1 Oct 2009 07:33:07 -0400 (EDT)
  • References: <200910011042.GAA23813@smc.vnet.net>

Hi Karsten,

> my packages uses some data files. Currently, I store them in 
> a subdirectory "resources" below the package directory and 
> access the data via
> 
> ToFileName[{$UserBaseDirectory, "Applications", myPackage, 
> "resources"}, myDataFileName];

I used to do this with filter coefficients.  There were only a few hundred
of them, and it was easier at the time to cut them from an F77 data block
and insert them into a file.
 
> I wonder if this is a portable way. I am afraid it is not, 
> since the package may be installed under $BaseDirectory as 
> well. And then there is this directory at the same level as 
> "Applications" named "ApplicationData"
> 
> What is the recommended way to store my data files?

I don't know whether it's recommended or not, but currently, I've got the
coefficients defined in the package's initialisation.  The disadvantage is
that function readability goes way down, but upside is that I no longer need
to worry about reading multiple files when a function is called. 

I would store them in the package rather than read them with the package.

But your mileage may vary,

D.




  • Prev by Date: DateListPlot & Locator
  • Next by Date: Re: Using Mathematica 5.2 and 7.01 with separate settings
  • Previous by thread: How to store data files in packages
  • Next by thread: Re: How to store data files in packages