Ë
    /©ðix  ã                   óª   — d dl Z d dlZd dlZd dlmZ  e«        d dlmZ d dlmZm	Z	 d dl
mZmZ d dlmZ d dlmZ d dlmZmZ d	„ Zed
k(  r e«        yy)é    N)Úload_dotenv)ÚSession)ÚSessionLocalÚengine)ÚPlantÚVarietyType)ÚGraftCombination)ÚSoilProfile)Úgenerate_graft_combinationsÚNOWc                  óº  — t        «       } 	 | j                  t        «      j                  t        j                  t
        j                  k(  «      j                  «       }| j                  t        «      j                  t        j                  t
        j                  k(  «      j                  «       }|r|st        d«       	 | j                  «        y t        d«       t        dt        |«      › d�«       t        dt        |«      › d�«       t        d«       t        d«       | j                  t        «      j                  «        | j                  «        t        d«       ||z   D �ch c]  }t        |j                   «      ’Œ }}	 t#        ||«      }d	}|D �]<  }t        |j%                  d
d«      «      }t        |j%                  dd«      «      }	||vs|	|vrŒC| j'                  t        t)        j*                  «       t)        j,                  |«      t)        j,                  |	«      t/        |j%                  dd«      «      t/        |j%                  dd«      «      t/        |j%                  dd«      «      |j%                  d«      xs i t        |j%                  dd«      «      t        |j%                  dd«      «      t0        t0        ¬«      «       |dz  }�Œ? | j                  «        t        d|› d�«       t        d«       | j                  «        y c c}w # t2        $ r(}
| j5                  «        t        d|
› �«       Y d }
~
ŒBd }
~
ww xY w# | j                  «        w xY w)NzCError: No plants found in database. Please run the full seed first.zResuming Graft Generation:z
 - Loaded z scions from databasez rootstocks from databasez(----------------------------------------z"Clearing old graft combinations...zA[5/5] Generating and saving graft combinations (Small Batches)...r   Úrootstock_idÚ Úscion_idÚcompatibility_scoregš™™™™™é?Úvigor_boostgš™™™™™ñ?Úyield_modifierÚstress_tolerance_overrideÚnotesÚsource_reference)Úidr   r   r   r   r   r   r   r   Ú
created_atÚ
updated_até   z
Success! Saved u    graft combinations âœ“z)Database enrichment is now 100% complete.u   
Graft generation failed â€” )r   Úqueryr   ÚfilterÚvariety_typer   ÚscionÚallÚ	rootstockÚprintÚcloseÚlenr	   ÚdeleteÚcommitÚstrr   r   ÚgetÚaddÚuuidÚuuid4ÚUUIDÚfloatr   Ú	ExceptionÚrollback)ÚdbÚscionsÚ
rootstocksÚpÚplant_id_setÚgraft_dictsÚinserted_graftsÚgÚrs_idÚsc_idÚes              úL/var/www/acinvestment.org/public_html/aci/backend/app/seeds/resume_grafts.pyÚresume_graftsr;      sµ  € Ü	‹€Bð9à—‘œ%“×'Ñ'¬×(:Ñ(:¼k×>OÑ>OÑ(OÓP×TÑTÓVˆØ—X‘Xœe“_×+Ñ+¬E×,>Ñ,>Ä+×BWÑBWÑ,WÓX×\Ñ\Ó^ˆ
á™ZÜÐWÔXØðd 	�‰�
ôa 	Ð*Ô,Ü�
œ3˜v›;˜-Ð'<Ð=Ô>Ü�
œ3˜z›?Ð+Ð+DÐEÔFÜˆhŒô 	Ð2Ô3Ø
�‰Ô!Ó"×)Ñ)Ô+Ø
�	‰	Œô 	ÐQÔRØ+1°JÑ+>Ö? aœ˜AŸD™D�	Ð?ˆÐ?ð	8Ü5°f¸jÓIˆKØˆOØ ó %�Ü˜AŸE™E .°"Ó5Ó6�Ü˜AŸE™E *¨bÓ1Ó2�à Ñ,°¸\Ñ0IØà—‘Ô'Ü—z‘z“|Ü!%§¡¨5Ó!1Ü!ŸY™Y uÓ-Ü(-¨a¯e©eÐ4IÈ3Ó.OÓ(PÜ % a§e¡e¨M¸3Ó&?Ó @Ü#(¨¯©Ð/?ÀÓ)EÓ#FØ./¯e©eÐ4OÓ.PÒ.VÐTVÜ˜aŸe™e G¨RÓ0Ó1Ü%(¨¯©Ð/AÀ2Ó)FÓ%GÜ"Ü"ôô ð   1Ñ$’ð)%ð, �I‰IŒKÜÐ% oÐ%6Ð6MÐNÔOÜÐ=Ô>ð 	�‰�
ùòI @øô> ò 	8Ø�K‰KŒMÜÐ2°1°#Ð6×7Ñ7ûð	8ûð
 	�‰�
úsJ   ŒB1M ÃBM Å%LÆM ÆE:L ÌM Ì	MÌM Ì;M Í MÍM ÍMÚ__main__)ÚsysÚosr)   Údotenvr   Úsqlalchemy.ormr   Úapp.databaser   r   Úapp.models.plantr   r   Úapp.models.graft_combinationr	   Úapp.models.soil_profiler
   Úapp.seeds.enrichr   r   r;   Ú__name__© ó    r:   ú<module>rI      sB   ðÛ 
Û 	Û Ý Ù „Ý "ß -ß /Ý 9Ý /ß =ò;ðz ˆzÒÙ…Oð rH   