<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Dear Jonathan,<br>
      <br>
      Sorry about the delay, but I've started looking into this now.
      Regarding 1 it is probably that zlib was not found when compiling
      TNG and was thus disabled. Later versions (GROMACS master or TNG
      library 1.8) compile zlib if it was not found. Earlier versions
      should have had a fallback when zlib is not available, but with
      later versions I hope it should just work.<br>
      <br>
      2. Frame sets assume that the time between frames are constant
      within the frame set. So, I'm afraid that your solution with one
      frame per frame set is the only solution right now. It could be
      worth looking into how this can be improved and I'm happy to hear
      suggestions.<br>
      <br>
      Using picoseconds as time unit was an early mistake and using
      seconds in the utility functions was a way to try to hide that
      from most users. However, it probably made it worse this way since
      it's not consistent. It would have been better to stick to seconds
      everywhere. However, I'm reluctant to change the API at this
      moment. That could be discussed for a later major version, but it
      could cause problems.<br>
      <br>
      Cheers,<br>
      <br>
      Magnus<br>
      <br>
      On 2017-07-08 17:18, Jonathan Barnoud wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:4c2ad6c6-1342-dad1-51b8-cfde098d6cc6@barnoud.net">
      <meta http-equiv="content-type" content="text/html; charset=utf-8">
      Dear all,<br>
      <br>
      With other developers of MDAnalysis, we are working on a python
      wrapper for the TNG library. While it is aimed at being used in
      MDAnalysis, this wrapper is written to be used standalone. More
      details can be found at <a class="moz-txt-link-rfc2396E"
        href="http://www.mdanalysis.org/pytng/" moz-do-not-send="true">&lt;http://www.mdanalysis.org/pytng/&gt;</a>.<br>
      <br>
      I am working on the writing of a basic TNG file. I want to be able
      to write particle positions  and a box shape for each frame. Each
      frame can have an arbitrary time attached to it. I did manage to
      do this in this pull request: <a class="moz-txt-link-rfc2396E"
        href="https://github.com/MDAnalysis/pytng/pull/18"
        moz-do-not-send="true">&lt;https://github.com/MDAnalysis/pytng/pull/18&gt;</a>,
      and in this minimal example jupyter notebook:
      <a class="moz-txt-link-rfc2396E"
        href="https://gist.github.com/jbarnoud/b8f750f116b76aba1b205babc001b569"
        moz-do-not-send="true">&lt;https://gist.github.com/jbarnoud/b8f750f116b76aba1b205babc001b569&gt;</a>.
      Both cases are written in cython rather than C, but they call the
      same functions from the tng_io library that a C program would.<br>
      <br>
      There are a few things I am not completely sure about, though.<br>
      <br>
      1. When I write the box shape with `tng_util_box_shape_write` or
      `tng_util_box_shape_with_time_write`, I do not manage to read it
      back with gromacs. Both 'gmx check' and 'gmx dump' fail to read
      the box with the following message:<br>
      <br>
          TNG library: Cannot uncompress data block.
      /home/jon/src/gromacs-2016.3/src/external/tng_io/src/lib/tng_io.c:5298<br>
      <br>
      I did solve the problem by using `tng_util_generic_write` (or its
      `with_time` equivalent) and by setting the compression to
      `TNG_UNCOMPRESSED`.<br>
      <br>
      Does gromacs support the TNG_GZIP_COMPRESSION that is the default
      for the high level `tng_util_box_shape_write` function? If so,
      what should I do to have it working?<br>
      <br>
      2. I write an arbitrary time with each frame. The time is
      arbitrary in the sense that I do not know before hand what is the
      time that the user of the library will provide for the frame, and
      that the time difference between two consecutive frames do not
      have to be constant (nor even positive). I managed this by setting
      the number of frames per frame set to 1, and to set the time per
      frame to 0.<br>
      <br>
      Is it possible to have the arbitrary time with more than one frame
      per frame set? I did get some results by setting the time per
      frame for each frame using the time difference with the previous
      frame, but I got some strange behaviors when the difference was 0;
      and `<span class="n">tng_time_per_frame_set</span><span class="p">`
        refuses negative values.<br>
        <br>
        Also, I noticed that all the `tng_util_*_with_time_write`
        functions expect the time to be expressed in seconds, while
        `tng_time_per_frame_set` expects picoseconds. Is there a reason
        for this discrepancy?<br>
        <br>
        Thank you for any insight you may provide,<br>
        Jonathan Barnoud<br>
      </span>
      <pre><code></code></pre>
      <code><br>
      </code> <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>