Aquileo | Recent changes to feature-requestshttps://sourceforge.net/p/idlsave/feature-requests/2010-09-09T11:41:41ZRecent changes to feature-requestsAquileo | Passing file objects to idlsave.read2010-09-09T11:41:41Z2010-09-09T11:41:41ZMaurizio Tomasihttps://sourceforge.net/u/ziotom/https://sourceforge.net965197017028cb213ebba712bd0d1120e33b1e09<div class="markdown_content"><p>Currently, it is possible to read files saved to disk but not file-like objects (like StringIO) with idlsave.read. A nice addition would be to have two parameters to specify the SAV file: "file_name" and "file_obj" (see the gzip.GzipFile constructor in the standard Python library for an example).</p>
<p>It would be nice to have such a feature, as I often have to read gzipped SAV files downloaded from a FTP server: I can download and decompress them only using StringIO objects, but then I must save the result in a temporary file before calling idlsave.read.</p>
<p>I am attaching here a possible patch which implements what I described. There should be no change required for existing code. The following snippet illustrates the new feature:</p>
<p>import idlsave<br />
from gzip import GzipFile</p>
<p>d = idlsave.read (file_obj = GzipFile ('foo.sav.gz'))</p></div>Aquileo | Support for 32-bit complex2010-09-02T14:52:56Z2010-09-02T14:52:56ZAnonymoushttps://sourceforge.net/u/userid-None/https://sourceforge.net020326189a6c108847658c9aebad4382571dfe1e<div class="markdown_content"><p>Just got this message so I guess I need it.</p>
<p>Exception: 32-bit complex type not implemented</p>
<p>Thanks.</p></div>Aquileo | Support for IDL pointers2009-11-28T23:42:43Z2009-11-28T23:42:43ZAnonymoushttps://sourceforge.net/u/userid-None/https://sourceforge.netd65aa64f3696b44b5ad0f89c4d7ae04c47b1581d<div class="markdown_content"><p>It would be great if the next release supported reading save files with pointers in them. The example I am trying is a save file with a coyote library linked list of structures saved in it (http://www.dfanning.com/programs/linkedlist__define.pro)</p>
<p>The error given is:<br />
In [7]: s=idlsave.read('thd_2008101000000-2008201000000_vpp.sav')<br />
---------------------------------------------------------------------------<br />
KeyError Traceback (most recent call last)</p>
<p>/Users/balarsen/Desktop/<ipython console> in <module>()</p>
<p>/Library/Frameworks/Python.framework/Versions/5.1.1/lib/python2.5/site-packages/IDLSave-0.9.2-py2.5.egg/idlsave/idlsave.pyc in read(filename, verbose)<br />
589 <br />
590 def read(filename, verbose=True):<br />
591 s = IDLSaveFile(filename)<br />
--> 592 s.parse(verbose=verbose)<br />
593 return s</p>
<p>/Library/Frameworks/Python.framework/Versions/5.1.1/lib/python2.5/site-packages/IDLSave-0.9.2-py2.5.egg/idlsave/idlsave.pyc in parse(self, verbose)<br />
537 rectypes = []<br />
538 while True:<br />
--> 539 r = Record().read(f)<br />
540 self.records.append(r)<br />
541 rectypes.append(r.rectype)</p>
<p>/Library/Frameworks/Python.framework/Versions/5.1.1/lib/python2.5/site-packages/IDLSave-0.9.2-py2.5.egg/idlsave/idlsave.pyc in read(self, f)<br />
340 <br />
341 raise Exception("RECTYPE=%s not implemented" % \
--> 342 rectype_dict[self.rectype])<br />
343 <br />
344 f.seek(self.nextrec)</p>
<p>KeyError: 'HEAP_DATA'</p></div>