+
    ^ÃkÅ  ã                   ó
  € R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIH	t	 ]! ]
4      P                  4       P                  ^,          t]R,          t]R,          t]R,          t]! R4      tR tR	 t]R
8X  d
   ]! 4        R# R# )zIFreeze a location-balanced, development-only selection from UDE metadata.N)ÚPath)Úsource_name_flagszresults/r112/species-scaleupz6results/r112/ude-sampling-metadata/exposure-ledger.csvz7results/r112/ude-sampling-metadata/exposure-report.jsonz/tmp/ude-metadata.csvc                 óx   € \         P                  ! \        V 4      P                  4       4      P	                  4       # ©N)ÚhashlibÚsha256r   Ú
read_bytesÚ	hexdigest)Úps   &Úresearch/r112_scaleup_select.pyÚ<lambda>r      s]   € ô  ry÷  r@ò  r@ô  AEð  FGó  AH÷  ASñ  ASó  AUó  rV÷  r`ñ  r`ô  rbó    c                  ó”  € \         R ,          q P                  4       '       d   Q h\        P                  ! \        P                  4       4      qR,          \        \        4      8X  d   VR,          \        \        4      8X  g   Q h\        P                  ! \        P                  4       4       Uu/ uF  q"R,          R8X  g   K  VR,          VbK  	  pp\        P                  ! R 4      p\        P                  RRR	7      ;_uu_ 4       p\        P                  ! V4       EFf  pVP                  VR,          4      pV'       d!   \        VR
,          VR,          4      '       d   KF  \!        VR,          4      \!        VR,          4      ,
          ^,           p\!        VR,          4      \!        VR,          4      ,
          ^,           p\#        Wx4      ^8  g   \%        Wx4      R8”  g   Wx,          R8”  d   KÕ  VR,          VR
,          3q”V	,          VR,          ,          VR,          ,          P'                  RVR,          RVR,          RVR
,          RVR,          RVR,          RVR,          RVR,          RVRVRVR,          /
4       EKi  	  RRR4       . p
VP)                  4        F?  w  r›\+        R VP-                  4        4       4      pV^28¼  g   K.  V
P'                  V	4       KA  	  \/        V
4      ^P8X  g   Q h\0        P2                  ! R4      p. p/ p\5        V
4       EFP  w  pp. p\5        VVV3,          P)                  4       4       F�  w  pp. p\5        VP)                  4       4       F=  w  pp\5        VR R 7      pVP7                  V4       VP9                  VR!,          4       K?  	  VP7                  V4       VP'                  VVR",          34       K�  	  VP7                  V4       . p\/        V4      ^28  da   R#pV FC  w  ppV'       g   K  \/        V4      ^28  g   K"  VP'                  VP;                  4       4       R$pKE  	  V'       d   Ke  \=        R%4      h\/        V4      ^28X  d™   \/        V Uu0 uF  q"R,          kK  	  up4      ^8¼  ds   \%        \        P>                  ! R& V 4       4      P-                  4       4      ^
8:  d:   \%        \        P>                  ! R' V 4       4      P-                  4       4      ^8:  g   Q hVP9                  V4       R
TR(\/        V4      R)\/        V Uu0 uF  pVR,          kK  	  up4      R*\/        V Uu0 uF  pVR,          kK  	  up4      /VV&   EKS  	  \/        V4      \/        V Uu0 uF  q"R,          kK  	  up4      u;8X  d	   R+8X  g   Q h Q hR,R-R.RR\        \        4      R/\        \        4      R0\        \        4      R1\        \@        R2,          4      R3R4R5R6R7VR8V/
pV PC                  \        PD                  ! V^R97      R:,           4       \G        R;\/        V4      R<\/        V
4      R=\/        V Uu0 uF  q"R,          kK  	  up4      R>\/        V Uu0 uF  q"R,          kK  	  up4      R?4	       R# u upi   + '       g   i     EL; iu upi u upi u upi u upi u upi u upi )@zselection.jsonÚledger_sha256Úmetadata_sha256Úexposure_statusÚprior_developmentÚannotation_idc                  ó0   € \         P                  ! R  4      # )c                  ó6   € \         P                  ! \        4      # r   )ÚcollectionsÚdefaultdictÚlist© r   r   r   Ú(main.<locals>.<lambda>.<locals>.<lambda>   s%   € ô  [f÷  [rò  [rô  swô  [xr   )r   r   r   r   r   r   Úmain.<locals>.<lambda>   s%   € ô  |G÷  |Sò  |Sñ  Txô  |yr   z	utf-8-sigÚ )ÚencodingÚnewlineÚgenusÚspeciesÚbbox_x1Úbbox_x0Úbbox_y1Úbbox_y0i   i $ô Úsite_componentÚimage_filenameÚsource_speciesÚsource_genusÚsource_slideÚcutout_filenameÚsource_annotation_shapeÚannotation_shapeÚsource_bbox_width_pxÚsource_bbox_height_pxNc           	   3   óv   "  € T F/  p\        ^
\        R VP                  4        4       4      4      x € K1  	  R# 5i)é
   c              3   óL   "  € T F  p\        ^\        V4      4      x € K  	  R# 5i)é   N)ÚminÚlen)Ú.0Úitemss   & r   Ú	<genexpr>Ú!main.<locals>.<genexpr>.<genexpr>   s   é € ÐI¹°œ#˜a¤ E£
×+Ð+»ùs   ‚"$N)r3   ÚsumÚvalues)r5   Úslidess   & r   r7   Úmain.<locals>.<genexpr>   s-   é € ÐiÑYhÈvŒs�2”cÑI¸¿¹¼ÓIÓI×JÐJÓYhùs   ‚79i[)5c                 ó   € V R ,          # )r   r   )Úxs   &r   r   r      s	   €  a¨Ö&8r   )Úkey:Nr2   N:Nr0   NFTzPrecomputed capacity mismatchc              3   ó2   "  € T F  qR ,          x € K  	  R# 5i)r%   Nr   ©r5   r>   s   & r   r7   r<   !   s*   é € ð  gLñ  EKð  @AÐiy×gzÒgzó  EKùó   ‚c              3   ó2   "  € T F  qR ,          x € K  	  R# 5i)r)   Nr   rA   s   & r   r7   r<   !   s6   é € ð  vYñ  RXð  MNð  yG÷  wHò  wHó  RXùrB   ÚcropsÚsite_componentsÚslide_filenamesi   Úformatzr112-scaleup-selection-v1ÚseedÚexposure_report_sha256Úude_metadata_sha256Úliteral_name_guard_sha256z'diatom_pilot/ude_development_archive.pyÚ	selectionaö  From site-component prior_development metadata only, keep source species strings with no simple morphotype/alternate/genus-mismatch syntax and with room for 50 crops under a max of 10 per conservative location component and max 3 per original slide. Exclude invalid/extreme bounding box dimensions. Select all 80 eligible source labels, round-robin across randomized components to 50 per label. Decisions use metadata, not pixel or model outcomes. This simple string filter does not reconcile taxonomy.Úscopea�  Development source candidates only. Published source names were assigned/reviewed by the UDE team, not independently adjudicated here. Source crop boxes are rough and can contain unlabelled organisms; no biological instance masks are provided. Any old test-candidate components, unknown locations and candidate unseen locations are excluded. This is not a validated training set or independent test.Úper_nameÚrecords)ÚindentÚ
ÚFrozenz	crop IDs;zsource-name strings;zgenera;zlocation components)$ÚOÚexistsÚjsonÚloadsÚEÚ	read_textÚshaÚLÚMÚcsvÚ
DictReaderÚopenr   r   Úgetr   Úintr3   ÚmaxÚappendr6   r9   r:   r4   ÚrandomÚRandomÚsortedÚshuffleÚextendÚpopÚRuntimeErrorÚCounterÚRÚ
write_textÚdumpsÚprint)ÚoutputÚexposureÚrÚledgerÚpoolÚfÚsourceÚwÚhr?   ÚeligibleÚgroupsÚcapacityÚrngÚrowsÚcountsr    r   Ú	locationsÚgroupr;   ÚchoicesÚslider6   ÚorderedÚchosenÚprogressr>   Úresults                                r   Úmainr†      s_	  € Ü	Ð
Õ€§m¡m§o¢oÐ5Ð"5¼t¿zºzÌ!Ï+É+Ë-Ó?X°hÐixÕ`yÔ{~ô  @Aó  |Bô  aBð  GOð  Paõ  Gbô  dgô  hió  djô  Gjð  Zjð  ajô  QT÷  Q_ò  Q_ô  `a÷  `fñ  `fó  `hô  Qió  rWñ  Qið  LMð  o@õ  mAð  CVñ  mVô  sGð  stð  uDõ  sEð  FGò  sGñ  Qið  kqð  rWô  ]h÷  ]tò  ]tñ  uyó  ]zð  X\Ü‡f�f�k¨"€f×-Ô-°Ü�>Š>˜!×€aØ
�*‰*�Q�Õ'Ó
(€6ß
Ô% f¨W¥o°f¸YÕ6G×HÒHÉÜˆˆ9�Ó”s˜1˜Y�<Ó(Õ(¨Õ*€1¬S°°9µÓ->¼sÀ1ÀYÅ<Ó?PÕ-PÐQRÕ-R¨1Ü	ˆ!ƒhˆr„k”S˜“X˜d”] a¥c¨*¤n±XØˆyÕ˜& �/Ð*€3°­9°VÐ<LÕ5MÕ+NÈvÐVfÕOgÕ+h×+oÑ+oð  rAð  BHð  IXõ  BYð  Zjð  kqð  r{õ  k|ð  }Kð  LRð  SZõ  L[ð  \lð  msð  tDõ  mEð  FTð  U[ð  \lõ  Umð  nð  @Fð  GXõ  @Yð  Zsð  tzð  {Mõ  tNð  Oeð  fgð  hð  @Að  BSð  TZð  [lõ  Tmð  qn÷  ,oñ ÷ .ð €Ø—:‘:–<�Z€SÜÑiÐY_×YfÑYfÔYhÓiÓi€(Øˆr†\�(—/‘/ #Ö&ñ  ô 	ˆH‹�rÔÐÐœfŸmšm¨HÓ5˜#¸2°dÀR¸fÜ˜X×&�]€WˆUØ€)Ü˜T 7¨5 /Õ2×8Ñ8Ó:Ö;�l€eˆFØ€7Ü˜VŸ\™\›^Ö,�{€uˆUÜ�5Ñ8Ô9€G¸#¿+¹+ÀgÔ:NÈwÏ~É~Ð^eÐfhÕ^iÖOjñ -à‡;�;ˆwÔ˜	×(Ñ(¨%°¸µÐ)=Ö>ñ	 <ð
 ‡+�+ˆiÔ ˜ÜˆF‹�BŒØ€8Û!�}€uˆWß�w”3�v“;˜r–> &§-¡-°·±³Ô">Èºxñ "ç
‰(œÐ&EÓFÐFÜ	ˆV‹�bŒœS¹vÓ!F¹v¸!Ð$4×"5Ð"5¹vÑ!FÓGÈÔJÌsÔS^×SfÒSfñ  gLñ  EKó  gLó  TL÷  TSñ  TSó  TUó  PVð  XZô  PZô  _bô  cn÷  cvò  cvñ  vYñ  RXó  vYó  cY÷  c`ñ  c`ó  cbó  _cð  efô  _fð  fð  
fð  gk÷  grñ  grð  syô  gzð  LSð  TYð  Zaô  beð  fló  bmð  nô  @Cñ  bhó  Diñ  bhð  ]^ð  EFð  GW÷  EXð  EXñ  bhñ  Dió  @jð  k|ô  }@ñ  ]có  Adñ  ]cð  XYð  BCð  DR÷  BSð  BSñ  ]cñ  Adó  }eð  Kfð  {Að  BIô  {Jñ 'ô 	ˆD‹	”3±DÓ9±D¨q˜/×*Ð*±DÑ9Ó:Ö@¸DÔ@Ð@Ñ@Ð@Ð@ÈÐRmÐntÐu}ð  Nô  ORô  STó  OUð  Vnô  orô  stó  ouð  vKô  LOô  PQó  LRð  Snô  orô  stð  u^õ  s^ó  o_ð  `kð  ldð  elð  m~ð  Ið  JPð  QZð  [_ð  I`Àð  ag÷  arñ  arô  sw÷  s}ò  s}ð  ~Dð  LMô  sNð  OSõ  sSô  aTô  UZð  [cô  dgð  hló  dmð  nyô  z}ð  ~Fó  zGð  H^ô  _bñ  Có  cDñ  Cð  z{ð  ft÷  duð  duñ  Cñ  cDó  _Eð  FOô  PSñ  rvó  Twñ  rvð  mnð  Wg÷  Uhð  Uhñ  rvñ  Twó  Pxð  yNö  UOùò7 rWß-×-Ð-üò2 "Gùò  Diùò  AdùÚ9ùò  cDùò  Tws=   Â.ZÃZÄFZÑ6Z,
Ô/Z1ÕZ6ÖZ;
Ù[ Ù4[ÚZ)	Ú__main__)Ú__doc__r   r\   r   rU   rc   Úpathlibr   Ú$diatom_pilot.ude_development_archiver   Ú__file__ÚresolveÚparentsrk   rS   rZ   rW   r[   rY   r†   Ú__name__r   r   r   Ú<module>r�      s­   ðÙ Oß *× *Ó *Ý Ý BÙ€xƒ.×ÑÓ×"Ñ" 1Õ%€¨Ð*HÕ(H aÈ1ð  NFõ  LFÈð  IJð  KDõ  IDð  GHñ  GKð  Lcó  Gdð  EFñ  ibð  ehòOð: ˆZÔ™žÑr   