<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Thanks Andy,<div class=""><br class=""></div><div class="">I'll give it a try.</div><div class=""><br class=""></div><div class="">Louie</div><div class=""><br class=""><div style=""><blockquote type="cite" class=""><div class="">On 25 Apr 2018, at 11:33, Andy Buckley <<a href="mailto:andy.buckley@cern.ch" class="">andy.buckley@cern.ch</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_default" style="font-size: large;">I dug a bit more: it works from C++ but not from Python. Funny, I could have sworn that I had both working, but apparently not. It also doesn't work for gz output at the Python level, apparently: yoda2yoda test.yoda test.yoda.gz does not work, but it should.</div><div class="gmail_default" style="font-size: large;"><br class=""></div><div class="gmail_default"><font size="4" class="">The Python interface to the YODA IO functions is in pyext/yoda/include/IO.pyx. It does have to play some games to convert the Pythonic view of files to the C++ stream one, and maybe this is where it's going wrong. It's certainly where the complaint about the ascii encoding is coming from. Could you take a look there and see if you can persuade it to do the right thing?</font></div><div class="gmail_default"><font size="4" class=""><br class=""></font></div><div class="gmail_default"><font size="4" class="">The zipped IO itself is only supported for the YODA <span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: large; font-style: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(255, 255, 255); float: none; display: inline;" class="">format, and is implemented in src/<a href="http://readeryoda.cc/" class="">ReaderYODA.cc</a><span class="Apple-converted-space"> </span>and <span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: large; font-style: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(255, 255, 255); float: none; display: inline;" class="">src/<a href="http://writeryoda.cc/" class="">WriterYODA.cc</a></span><span class="Apple-converted-space"> </span>-- it should be completely automatic and you shouldn't have to touch this code, but it might help for understanding how to interface it to the Python.</span></font><br class=""></div><div class="gmail_default"><font size="4" class=""><br class=""></font></div><div class="gmail_default"><font size="4" class="">Andy</font></div><div class="gmail_default"><br class=""></div></div><div class="gmail_extra" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""><div class="gmail_quote">On 23 April 2018 at 13:59, Corpe, Louie<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:l.corpe@ucl.ac.uk" target="_blank" class="">l.corpe@ucl.ac.uk</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">Hi Riveters,<br class=""><br class=""><br class="">I'm trying to use the zipped i/o functionality introduced in Rivet 2.6.0 / Yoda 1.7.0.<br class="">I can't seem to get it working: is there an example of how to do this somewhere?<br class=""><br class="">I've included a minimal example [1]. Please let me know what I'm doing wrong!<br class="">The files I used in [1] can be found on my public on lxplus: /afs/<a href="http://cern.ch/user/l/lcorpe/public/RivetZippedIO/examples/" rel="noreferrer" target="_blank" class="">cern.ch/user/l/lcorpe/<wbr class="">public/RivetZippedIO/examples/</a><br class=""><br class="">All the best and thanks in advance !<br class=""><br class=""><br class="">Louie<br class=""><br class=""><br class="">[1]<br class="">[lcorpe@lxplus005 scratch]$ gzip -c out1028_DSIDxxx.MEWeight.yoda > examples/out1028_DSIDxxx.<wbr class="">MEWeight.yoda.gz<br class="">[lcorpe@lxplus005 scratch]$ python<br class="">Python 2.7.5 (default, Aug  4 2017, 00:39:18)<br class="">[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux2<br class="">Type "help", "copyright", "credits" or "license" for more information.<br class="">>>> import yoda as y<br class="">>>> a= y.read("examples/out1028_<wbr class="">DSIDxxx.MEWeight.yoda.gz")<br class="">Traceback (most recent call last):<br class="">  File "<stdin>", line 1, in <module><br class="">  File "yoda/include/IO.pyx", line 107, in yoda.core.read (/afs/<a href="http://cern.ch/user/l/lcorpe/scratch/rivet/YODA-1.7.0/pyext/yoda/core.cpp:85809" rel="noreferrer" target="_blank" class="">cern.ch/user/l/lcorpe/<wbr class="">scratch/rivet/YODA-1.7.0/<wbr class="">pyext/yoda/core.cpp:85809</a>)<br class="">UnicodeDecodeError: 'ascii' codec can't decode byte 0x8b in position 1: ordinal not in range(128)<br class="">>>><br class="">______________________________<wbr class="">_________________<br class="">Rivet mailing list<br class=""><a href="mailto:Rivet@projects.hepforge.org" class="">Rivet@projects.hepforge.org</a><br class=""><a href="https://www.hepforge.org/lists/listinfo/rivet" rel="noreferrer" target="_blank" class="">https://www.hepforge.org/<wbr class="">lists/listinfo/rivet</a><br class=""></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>--<span class="Apple-converted-space"> </span><br class=""><div class="gmail_signature" data-smartmail="gmail_signature">Dr Andy Buckley, Lecturer / Royal Society University Research Fellow<br class="">Particle Physics Expt Group, University of Glasgow</div></div></div></blockquote></div><br class=""></div></body></html>