<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Dear Michele,</p>
    <p>thanks a lot. This helped. However I think I found a bug in this
      function. The sort in the end of the function is non-functional as
      there is no sort in the class MCScalarData (totally understandable
      why). I assume the python interpreter will work with a default for
      the comparison rather than raise an error. In the case of EXMC the
      error of all the x-values are 0, such that the sort function shows
      undefined behavior.<br>
    </p>
    <p>To circumvent the problem I propose to change the following line
      in the ResultsToXY function<br>
    </p>
    <p>    order = np.argsort(res.x, kind = 'mergesort')</p>
    <p>To:<br>
    </p>
    <p>    order = np.argsort([x.mean for x in res.x], kind =
      'mergesort')</p>
    <p>This would fix the bug locally (to give the expected result),
      without changing the rest of the code basis. Is it possible to
      incorporate this change in the code basis?</p>
    <p>Best,</p>
    <p>Dominik<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 29.03.2017 07:45, Michele Dolfi
      wrote:<br>
    </div>
    <blockquote
      cite="mid:0BA2DAD6-6D69-4132-8A5D-ECE6E5F55FEA@phys.ethz.ch"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      There a function for this, but it is note used a lot.
      <div class=""><br class="">
      </div>
      <div class="">Here the doc string:</div>
      <div class=""><br class="">
        <font class="" face="Courier">def
          ResultsToXY(sets,x,y,foreach=[]):<br class="">
              """ combines observable x and y to build a list of DataSet
          with y vs x<br class="">
           <br class="">
              this function is used to collect data from a hierarchy of
          DataSet objects, to prepare plots or evaluation.<br class="">
              the inner-most list has to contain one DataSet with
          props['observable'] = x and one props['observable'] = y,<br
            class="">
              this will be the pair x-y used in the collection.<br
            class="">
          <br class="">
              The parameters are:<br class="">
                sets:    hierarchy of datasets where the inner-most list
          must contain to pair x-y<br class="">
                x:       the name of the observable to be used as
          x-value of the collected results <br class="">
                y:       the name of the observable to be used as
          y-value of the collected results <br class="">
                foreach: an optional list of properties used for
          grouping the results. A separate DataSet object is created for
          each unique set of values of the specified parameers.<br
            class="">
          <br class="">
              The function returns a list of DataSet objects.<br
            class="">
              """<br class="">
        </font><br class="">
      </div>
      <div class=""><br class="">
      </div>
      <div class="">Best,</div>
      <div class="">Michele<br class="">
        <div class=""><br class="">
        </div>
        <div class=""><br class="">
          <div>
            <blockquote type="cite" class="">
              <div class="">On 28 Mar 2017, at 15:23, Dominik
                Schildknecht <<a moz-do-not-send="true"
                  href="mailto:dominik.schildknecht@psi.ch" class="">dominik.schildknecht@psi.ch</a>>
                wrote:</div>
              <br class="Apple-interchange-newline">
              <div class="">
                <div class="">Dear all,<br class="">
                  I wanted to know if it's already implemented to plot
                  two observables<br class="">
                  against each other with the combination of
                  pyalps.collectXY and<br class="">
                  pyalps.plot.plot.<br class="">
                  As an example I would like to be able to plot energy
                  vs. magnetization<br class="">
                  in an example like MC-07. This mainly arises as a
                  question if I want to<br class="">
                  use the exchange Monte Carlo formalism (thanks for
                  that, it seems to<br class="">
                  work great with very little modification to my code).
                  There the<br class="">
                  optimized temperature set is saved as an observable.
                  If I still want to<br class="">
                  be able to plot M vs. T I would need the ability to
                  plot two observables<br class="">
                  against each other. However it crashes in
                  alps/lib/pyalps/tools.py in<br class="">
                  the function collectXY at the line<br class="">
                     xvalue = np.array([data.props[x] for i in
                  range(len(data.y))])<br class="">
                  Is what I intend to do possible with collectXY?<br
                    class="">
                  Best,<br class="">
                  Dominik<br class="">
                  <br class="">
                  -- <br class="">
                  Paul Scherrer Institut<br class="">
                  Dominik Schildknecht<br class="">
                  PhD Student<br class="">
                  WHGA/129<br class="">
                  CH-5232 Villigen-PSI<br class="">
                  Phone: +41 56 310 55 68<br class="">
                  <br class="">
                  <br class="">
                  <br class="">
                  ----<br class="">
                  Comp-phys-alps-users Mailing List for the ALPS Project<br
                    class="">
                  <a moz-do-not-send="true"
                    href="http://alps.comp-phys.org/" class="">http://alps.comp-phys.org/</a><br
                    class="">
                  <br class="">
                  List info:
                  <a class="moz-txt-link-freetext" href="https://lists.phys.ethz.ch//listinfo/comp-phys-alps-users">https://lists.phys.ethz.ch//listinfo/comp-phys-alps-users</a><br
                    class="">
                  Archive:
                  <a class="moz-txt-link-freetext" href="https://lists.phys.ethz.ch//pipermail/comp-phys-alps-users">https://lists.phys.ethz.ch//pipermail/comp-phys-alps-users</a><br
                    class="">
                  <br class="">
                  Unsubscribe by writing a mail to
                  <a class="moz-txt-link-abbreviated" href="mailto:comp-phys-alps-users-leave@lists.phys.ethz.ch">comp-phys-alps-users-leave@lists.phys.ethz.ch</a>.<br
                    class="">
                  <br class="">
                </div>
              </div>
            </blockquote>
          </div>
          <br class="">
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">

----
Comp-phys-alps-users Mailing List for the ALPS Project
<a class="moz-txt-link-freetext" href="http://alps.comp-phys.org/">http://alps.comp-phys.org/</a>

List info: <a class="moz-txt-link-freetext" href="https://lists.phys.ethz.ch//listinfo/comp-phys-alps-users">https://lists.phys.ethz.ch//listinfo/comp-phys-alps-users</a>
Archive: <a class="moz-txt-link-freetext" href="https://lists.phys.ethz.ch//pipermail/comp-phys-alps-users">https://lists.phys.ethz.ch//pipermail/comp-phys-alps-users</a>

Unsubscribe by writing a mail to <a class="moz-txt-link-abbreviated" href="mailto:comp-phys-alps-users-leave@lists.phys.ethz.ch">comp-phys-alps-users-leave@lists.phys.ethz.ch</a>.</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Paul Scherrer Institut
Dominik Schildknecht
PhD Student
WHGA/129
CH-5232 Villigen-PSI
Phone: +41 56 310 55 68
</pre>
  </body>
</html>