<commit_before><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:py="http://genshi.edgewall.org/"
  xmlns:xi="http://www.w3.org/2001/XInclude"
  py:strip="">


  <table py:def="render_circling_performance(flight)"
    class="table table-condensed">
    <thead>
      <tr>
        <th></th>
        <th>Duration</th>
        <th class='numeric'>&Delta;H</th>
        <th class='numeric'>Avg. vario</th>
        <th class='numeric'>Thermals</th>
      </tr>
    </thead>
    <tbody>
      <tr py:for="ph in flight.circling_performance"
        py:with="phase=phase_formatter(ph)">
        <th>${phase.circling_direction}</th>
        <td>${phase.duration} (${phase.fraction})</td>
        <td class='numeric'>${phase.alt_diff}</td>
        <td class='numeric'>${phase.vario}</td>
        <td class='numeric'>${phase.count}</td>
      </tr>
    </tbody>
  </table>


  <table py:def="render_cruise_performance(flight)"
    class="table table-condensed">
    <thead>
      <tr>
        <th>Duration</th>
        <th>&Delta;H</th>
        <th class='numeric'>Distance</th>
        <th class='numeric'>Avg. vario</th>
        <th class='numeric'>Avg. speed</th>
        <th class='numeric'><abbr title="Glide Rate">GR</abbr></th>
        <th class='numeric'>Glides</th>
      </tr>
    </thead>
    <tbody>
      <tr py:for="ph in flight.cruise_performance"
        py:with="phase=phase_formatter(ph)">
        <td>${phase.duration} (${phase.fraction})</td>
        <td>${phase.alt_diff}</td>
        <td class='numeric'>${phase.distance}</td>
        <td class='numeric'>${phase.vario}</td>
        <td class='numeric'>${phase.speed}</td>
        <td class='numeric'>${phase.glide_rate}</td>
        <td class='numeric'>${phase.count}</td>
      </tr>
    </tbody>
  </table>

  <table py:def="render_phases(flight)" id="phases-table"
    class="table table-condensed table-striped">
    <thead>
      <tr>
        <th class='numeric'>#</th>
        <th>Phase</th>
        <th>Start</th>
        <th>Duration</th>
        <th class='numeric'>&Delta;H</th>
        <th class='numeric'>Distance</th>
        <th class='numeric'>Avg. vario</th>
        <th class='numeric'>Avg. speed</th>
        <th class='numeric'><abbr title="Glide Rate">GR</abbr></th>
      </tr>
    </thead>
    <tbody>
      <tr py:for="pn, ph in enumerate(flight.phases)"
        py:with="phase=phase_formatter(ph)">
        <td class='numeric'>${pn + 1}</td>
        <td>${phase.type}
          <span py:if="phase.is_circling" class='label'>
            ${phase.circling_direction.eval().lower()}
          </span>
        </td>
        <td class='start' data-content='${(ph.start_time - flight.takeoff_time.replace(hour=0, minute=0, second=0, microsecond=0)).total_seconds()}'>${phase.start}</td>
        <td class='duration' data-content='${ph.duration.total_seconds()}'>${phase.duration}</td>
        <td class='numeric'>${phase.alt_diff}</td>
        <td class='numeric'>${phase.distance}</td>
        <td class='numeric'>${phase.vario}</td>
        <td class='numeric'>${phase.speed}</td>
        <td class='numeric'>${phase.glide_rate}</td>
      </tr>
    </tbody>
  </table>

</html>
<commit_msg>phases-table: Only calculate midnight timestamp once<commit_after><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:py="http://genshi.edgewall.org/"
  xmlns:xi="http://www.w3.org/2001/XInclude"
  py:strip="">


  <table py:def="render_circling_performance(flight)"
    class="table table-condensed">
    <thead>
      <tr>
        <th></th>
        <th>Duration</th>
        <th class='numeric'>&Delta;H</th>
        <th class='numeric'>Avg. vario</th>
        <th class='numeric'>Thermals</th>
      </tr>
    </thead>
    <tbody>
      <tr py:for="ph in flight.circling_performance"
        py:with="phase=phase_formatter(ph)">
        <th>${phase.circling_direction}</th>
        <td>${phase.duration} (${phase.fraction})</td>
        <td class='numeric'>${phase.alt_diff}</td>
        <td class='numeric'>${phase.vario}</td>
        <td class='numeric'>${phase.count}</td>
      </tr>
    </tbody>
  </table>


  <table py:def="render_cruise_performance(flight)"
    class="table table-condensed">
    <thead>
      <tr>
        <th>Duration</th>
        <th>&Delta;H</th>
        <th class='numeric'>Distance</th>
        <th class='numeric'>Avg. vario</th>
        <th class='numeric'>Avg. speed</th>
        <th class='numeric'><abbr title="Glide Rate">GR</abbr></th>
        <th class='numeric'>Glides</th>
      </tr>
    </thead>
    <tbody>
      <tr py:for="ph in flight.cruise_performance"
        py:with="phase=phase_formatter(ph)">
        <td>${phase.duration} (${phase.fraction})</td>
        <td>${phase.alt_diff}</td>
        <td class='numeric'>${phase.distance}</td>
        <td class='numeric'>${phase.vario}</td>
        <td class='numeric'>${phase.speed}</td>
        <td class='numeric'>${phase.glide_rate}</td>
        <td class='numeric'>${phase.count}</td>
      </tr>
    </tbody>
  </table>

  <table py:def="render_phases(flight)" id="phases-table"
    class="table table-condensed table-striped">
    <thead>
      <tr>
        <th class='numeric'>#</th>
        <th>Phase</th>
        <th>Start</th>
        <th>Duration</th>
        <th class='numeric'>&Delta;H</th>
        <th class='numeric'>Distance</th>
        <th class='numeric'>Avg. vario</th>
        <th class='numeric'>Avg. speed</th>
        <th class='numeric'><abbr title="Glide Rate">GR</abbr></th>
      </tr>
    </thead>
    <tbody py:with="takeoff_midnight=flight.takeoff_time.replace(hour=0, minute=0, second=0, microsecond=0)">
      <tr py:for="pn, ph in enumerate(flight.phases)"
        py:with="phase=phase_formatter(ph)">
        <td class='numeric'>${pn + 1}</td>
        <td>${phase.type}
          <span py:if="phase.is_circling" class='label'>
            ${phase.circling_direction.eval().lower()}
          </span>
        </td>
        <td class='start' data-content='${(ph.start_time - takeoff_midnight).total_seconds()}'>${phase.start}</td>
        <td class='duration' data-content='${ph.duration.total_seconds()}'>${phase.duration}</td>
        <td class='numeric'>${phase.alt_diff}</td>
        <td class='numeric'>${phase.distance}</td>
        <td class='numeric'>${phase.vario}</td>
        <td class='numeric'>${phase.speed}</td>
        <td class='numeric'>${phase.glide_rate}</td>
      </tr>
    </tbody>
  </table>

</html>

{'fraction_non_alphanumeric': 0.20970382497395446, 'fraction_numerical': 0.006250930197946123, 'mean_word_length': 2.766816143497758, 'pattern_counts': {'":': 0, '<': 249, '<?xml version=': 0, '>': 249, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3860686', 'n_tokens_mistral': 2425, 'n_tokens_neox': 2312, 'n_words': 334}