<commit_before><?xml version="1.0" encoding="UTF-8"?>
<aggregators xmlns="http://www.ekylibre.org/XML/2013/aggregators">
  <aggregator name="phytosanitary_register" version="0.0" category="land_parcel_management">
    <parameters>
      <parameter name="campaigns" type="record-list" of="campaign" default="current"/>
    </parameters>
    <section name="campaigns">
      <variable name="company" value="Entity.of_company"/>
      <property name="entity_name" value="company.full_name"/>
      <property name="address" value="company.default_mail_address.coordinate"/>
      <sections for="campaign" in="campaigns">
        <property name="id" of="campaign" level="api"/>
        <title name="name" of="campaign"/>
        <property name="harvest_year" of="campaign"/>
        <!-- looking for all CultivableZone -->
        <sections for="zone" in="CultivableZone.all.reorder(:work_number)" of-type="record">
          <title name="name" of="zone"/>
          <variable name="targets" value="Product.of_variety(:plant, :land_parcel).shape_intersecting(zone.shape)"/>
          <property name="work_number" of="zone"/>
          <property name="uuid" of="zone"/>
          <property name="islet_number" if="CapIslet.of_campaign(campaign).shape_intersecting(zone.shape)" value="CapIslet.of_campaign(campaign).shape_intersecting(zone.shape).pluck(:islet_number).to_sentence"/>
          <property name="net_surface_area" value="zone.net_surface_area(:hectare).round(3).l" type="measure"/>
          <property name="net_surface_area_in_hectare" value="net_surface_area.to_d(:hectare)" of="zone" type="measure" level="api"/>
          <property name="id" of="zone" level="api"/>
          <property name="shape_svg" value="zone.shape.to_svg(srid: 2154)" type="svg" level="api"/>
          <!-- looking for all Production in current cultivable_zone and campaign ## add real.where(state: 'done') when ready-->
          <sections for="intervention" in="Intervention.of_civil_year(campaign.harvest_year).of_category(:crop_protection).with_targets(targets).reorder(:started_at)" of-type="record">
            <title name="name" of="intervention"/>
            <property name="id" of="intervention" level="api"/>
            <property name="url" value="&quot;#{Preference[:host]}/backend/interventions/#{intervention.id}&quot;" level="api"/>
            <property name="started_at" of="intervention" type="datetime"/>
            <property name="stopped_at" of="intervention" type="datetime"/>
            <property name="working_duration" value="intervention.working_duration.in(:second).in(:hour).round(2).l" type="measure"/>
            <property name="working_area" if="intervention.targets.of_actors(targets).any?" value="intervention.targets.of_actors(targets).first.working_zone.intersection(zone.shape).area.convert(:hectare).round(2).l" type="measure"/>
            <variable name="doer" value="intervention.doers.first"/>
            <property name="doer_name" if="doer and doer.product" value="doer.product.name"/>
            <section name="issue" of="intervention.issue">
              <property name="id" level="api"/><commit_msg>Adds a new test to fix phytosanitary_register aggregator<commit_after><?xml version="1.0" encoding="UTF-8"?>
<aggregators xmlns="http://www.ekylibre.org/XML/2013/aggregators">
  <aggregator name="phytosanitary_register" version="0.0" category="land_parcel_management">
    <parameters>
      <parameter name="campaigns" type="record-list" of="campaign" default="current"/>
    </parameters>
    <section name="campaigns">
      <variable name="company" value="Entity.of_company"/>
      <property name="entity_name" value="company.full_name"/>
      <property name="address" value="company.default_mail_address.coordinate"/>
      <sections for="campaign" in="campaigns">
        <property name="id" of="campaign" level="api"/>
        <title name="name" of="campaign"/>
        <property name="harvest_year" of="campaign"/>
        <!-- looking for all CultivableZone -->
        <sections for="zone" in="CultivableZone.all.reorder(:work_number)" of-type="record">
          <title name="name" of="zone"/>
          <variable name="targets" value="Product.of_variety(:plant, :land_parcel).shape_intersecting(zone.shape)"/>
          <property name="work_number" of="zone"/>
          <property name="uuid" of="zone"/>
          <property name="islet_number" if="CapIslet.of_campaign(campaign).shape_intersecting(zone.shape)" value="CapIslet.of_campaign(campaign).shape_intersecting(zone.shape).pluck(:islet_number).to_sentence"/>
          <property name="net_surface_area" value="zone.net_surface_area(:hectare).round(3).l" type="measure"/>
          <property name="net_surface_area_in_hectare" value="net_surface_area.to_d(:hectare)" of="zone" type="measure" level="api"/>
          <property name="id" of="zone" level="api"/>
          <property name="shape_svg" value="zone.shape.to_svg(srid: 2154)" type="svg" level="api"/>
          <!-- looking for all Production in current cultivable_zone and campaign ## add real.where(state: 'done') when ready-->
          <sections for="intervention" in="Intervention.of_civil_year(campaign.harvest_year).of_category(:crop_protection).with_targets(targets).reorder(:started_at)" of-type="record">
            <title name="name" of="intervention"/>
            <property name="id" of="intervention" level="api"/>
            <property name="url" value="&quot;#{Preference[:host]}/backend/interventions/#{intervention.id}&quot;" level="api"/>
            <property name="started_at" of="intervention" type="datetime"/>
            <property name="stopped_at" of="intervention" type="datetime"/>
            <property name="working_duration" value="intervention.working_duration.in(:second).in(:hour).round(2).l" type="measure"/>
            <property name="working_area" if="intervention.targets.of_actors(targets).first and intervention.targets.of_actors(targets).first.working_zone" value="intervention.targets.of_actors(targets).first.working_zone.intersection(zone.shape).area.convert(:hectare).round(2).l" type="measure"/>
            <variable name="doer" value="intervention.doers.first"/>
            <property name="doer_name" if="doer and doer.product" value="doer.product.name"/>
            <section name="issue" of="intervention.issue">
              <property name="id" level="api"/>
{'fraction_non_alphanumeric': 0.1685217118670638, 'fraction_numerical': 0.005016460260228876, 'mean_word_length': 4.415959252971137, 'pattern_counts': {'":': 0, '<': 79, '<?xml version=': 2, '>': 79, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 4}, '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': '7548904', 'n_tokens_mistral': 1943, 'n_tokens_neox': 1836, 'n_words': 300}