+
    r)j  c                      R t ^ RIt^ RIHu Ht ^ RIt^ RIt^ RI	t	^ RI
t
^ RIt^ RIt]P                  P                  ]P                  P!                  ]P                  P#                  ]4      R4      4      tRt]P                  P!                  ]RR4      t]R3R lt]P.                  P0                  ]P.                  P3                  ]P                  P5                  ]4      '       * RR	7       ! R
 R4      4       4       tR# )u  
Slow acceptance test: verifies the full train_mlp → validate_strategy pipeline.

Marked @pytest.mark.slow — skipped by default in quick test runs.
Run with: /usr/bin/python3 -m pytest tests/test_acceptance_mlp.py -m slow -s

What it checks:
  1. train_mlp.py --smoke produces a valid weights artifact.
  2. The artifact loads, has the expected structure, and feature_cols match FEATURE_COLS.
  3. validate_strategy.py with the artifact's recommended_thresholds runs successfully
     and returns finite (non-NaN, non-None) metrics.
Nz..z/usr/bin/python3datazCOINBASE_BTCUSD-6H.csvi,  c                 :    \         P                  ! WR R VR7      pV# )T)cwdcapture_outputtexttimeout)
subprocessrun)cmdr   r   results   &&& D/Users/jameslopez/projects/TradingBot25/tests/test_acceptance_mlp.py_runr      s     ^^TgF M    zdata CSV not found)reasonc                   ,   a  ] tR t^!t o R tR tRtV tR# )TestAcceptanceMLPc                   \        VR ,          4      p\        \        RR\        RRV.4      pVP                  p^ qTV8H  qf'       g   \
        P                  ! R7V3R8WE34      RR\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MRR\
        P                  ! V4      R\
        P                  ! V4      /,          p\
        P                  ! R	VP                   R
VP                   24      R,           RV/,          p\        \
        P                  ! V4      4      hR;p;re\         P"                  qDP$                  qf! V4      q'       Eg*   \
        P                  ! R4      R,           RR\        P                  ! 4       9   g!   \
        P                  ! \         4      '       d   \
        P                  ! \         4      MRR\
        P                  ! V4      R\
        P                  ! V4      RR\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MRR\
        P                  ! V	4      /,          p\        \
        P                  ! V4      4      hR;p;ri\'        V4      ;_uu_ 4       p
\(        P*                  ! V
4      pRRR4       XP,                  pRqd! V4      p^qV8H  q'       g   \
        P                  ! R7V3R9W34      RR\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MRR\
        P                  ! V4      R\
        P                  ! V4      R\
        P                  ! V4      R\
        P                  ! V4      /,          pRRV/,          p\        \
        P                  ! V4      4      hR;p;p;p;r. pRpVV9   qUpV'       d   VR,          p\/        V4      p^pVV8  pTpV'       Eg   \
        P                  ! R:V3R;VV34      R\
        P                  ! V4      RR\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MR/,          pRRV/,          qP1                  V4       V'       d   \
        P                  ! R<X3R=XX34      RR\        P                  ! 4       9   g!   \
        P                  ! \.        4      '       d   \
        P                  ! \.        4      MRR\
        P                  ! X4      R\
        P                  ! V4      R\
        P                  ! V4      /,          pRR V/,          pVP1                  V4       \
        P2                  ! V^ 4      / ,          pR!R"V/,          p\        \
        P                  ! V4      4      hR;p;p;p;p;p;p;ppVP,                  pR#qd! V4      p. R>OqV8H  q'       Eg    \
        P                  ! R7V3R9W34      RR\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MRR\
        P                  ! V4      R\
        P                  ! V4      R\
        P                  ! V4      R\
        P                  ! V4      /,          p\
        P                  ! R$VP-                  R#4       24      R%,           RV/,          p\        \
        P                  ! V4      4      hR;p;p;p;rR&pVP,                  pR'p	/ q! W4      pVV9   pV'       Eg
   \
        P                  ! R:V3R?VV34      R(\
        P                  ! V4      RR\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MRR\
        P                  ! V4      R\
        P                  ! V	4      R\
        P                  ! V4      R\
        P                  ! V4      /,          pR)RV/,          p\        \
        P                  ! V4      4      hR;p;p;p;p	;pp\4        P"                  P7                  ^ \8        4       ^ R*IHpHp V! V4      pVR+,          pVV8H  pV'       g   \
        P                  ! R7V3R@VV34      R(\
        P                  ! V4      RR,\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MR,/,          p\
        P                  ! R-4      R.,           RV/,          p\        \
        P                  ! V4      4      hR;ppVR,           EF  w  p p!\@        PB                  p\@        PD                  qU! V 4      q! V4      p"V"'       Eg   \
        P                  ! R/4      R0,           RR1\        P                  ! 4       9   g!   \
        P                  ! \@        4      '       d   \
        P                  ! \@        4      MR1R\
        P                  ! V4      RR1\        P                  ! 4       9   g!   \
        P                  ! \@        4      '       d   \
        P                  ! \@        4      MR1R\
        P                  ! V4      RR2\        P                  ! 4       9   g   \
        P                  ! V 4      '       d   \
        P                  ! V 4      MR2R3\
        P                  ! V4      R4\
        P                  ! V"4      /,          p#\        \
        P                  ! V#4      4      hR;p;p;pp"\@        PB                  p\@        PD                  qU! V!4      q! V4      p"V"'       Eg   \
        P                  ! R54      R0,           RR1\        P                  ! 4       9   g!   \
        P                  ! \@        4      '       d   \
        P                  ! \@        4      MR1R\
        P                  ! V4      RR1\        P                  ! 4       9   g!   \
        P                  ! \@        4      '       d   \
        P                  ! \@        4      MR1R\
        P                  ! V4      RR6\        P                  ! 4       9   g   \
        P                  ! V!4      '       d   \
        P                  ! V!4      MR6R3\
        P                  ! V4      R4\
        P                  ! V"4      /,          p#\        \
        P                  ! V#4      4      hR;p;p;pp"EK  	  R#   + '       g   i     E
L; i)Amlp_weights_TEST_6H.jsontools/train_mlp.py--data--smoke--outpy0r
   py2py5ztrain_mlp --smoke failed:


>assert %(py7)spy7NzArtifact not writtenzd
>assert %(py7)s
{%(py7)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.path
}.exists
}(%(py5)s)
}ospy4outversionpayloadpy6py9zassert %(py11)spy11layerspy3z%(py7)slenpy13py16z%(py18)spy18zassert %(py21)spy21archz%Smoke arch should be [49,8,4,1], got z
>assert %(py11)srecommended_thresholdstrainingpy1zassert %(py13)s)FEATURE_COLSload_mlp_artifactfeature_colsr0   zArtifact feature_cols mismatch
>assert %(py5)szW contains non-finite valuesz
>assert %(py10)s
{%(py10)s = %(py2)s
{%(py2)s = %(py0)s.all
}(%(py8)s
{%(py8)s = %(py5)s
{%(py5)s = %(py3)s.isfinite
}(%(py6)s)
})
}npWpy8py10zb contains non-finite valuesb==z2%(py2)s
{%(py2)s = %(py0)s.returncode
} == %(py5)s)zI%(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.get
}(%(py4)s)
} == %(py9)sin)z%(py3)s in %(py5)s)>=)z4%(py13)s
{%(py13)s = %(py9)s(%(py11)s)
} >= %(py16)s)1            )zT%(py1)s in %(py11)s
{%(py11)s = %(py5)s
{%(py5)s = %(py3)s.get
}(%(py7)s, %(py9)s)
})z%(py1)s == %(py3)s)#strr   PYTHONDATA_6H
returncode
@pytest_ar_call_reprcompare@py_builtinslocals_should_repr_global_name	_saferepr_format_assertmsgstdoutstderrAssertionError_format_explanationr   pathexistsopenjsonloadgetr'   append_format_boolopsysinsertREPOstrategies.strategy_mlp_scoresr0   r1   r4   allisfinite)$selftmp_pathr   r
   @py_assert1@py_assert4@py_assert3@py_format6@py_format8@py_assert6fr!   @py_assert5@py_assert8@py_assert7@py_format10@py_format12@py_assert2@py_assert0@py_assert10@py_assert12@py_assert15@py_assert14@py_format17@py_format19@py_format20@py_format22@py_format14r0   r1   art@py_format4r5   r8   @py_assert9@py_format11s$   &&                                  r   (test_smoke_train_produces_valid_artifact:TestAcceptanceMLP.test_smoke_train_produces_valid_artifact$   s   (778v3)WcC D   	
A 	
A% 	
 	
 	
  	
 	
	6	
 	
 	
v 	
 	
 			
v 	
 	
 			
  	
 	
 			
A 	
 	
 	
 	
)&--6==/J	
 	
 	
 	
 	
 	
 ww:~~:~c":"::$::::::::r::::r:::w:::~::::::c::::c:::"::::::#YY!iilG  {{*9*{9%*******%******w****w***{***9***%***********BxBx7"BB78+<Bs+<'=BB'='BBBBBx7BBBxBBBBBB7BBBB7BBBBBBBBB'=BBBBBBsBBBBsBBB+<BBB'=BBBBBBBBBBBBBBBBBBB{{ 	
6 	
{6" 	
m 	
m3 	
 	
 	
" 	
 	
	6	
 	
 	
w 	
 	
 			
w 	
 	
 			
{ 	
 	
 			
6 	
 	
 			
" 	
 	
 			
m 	
 	
 	
 	
3GKK4G3HI	
 	
 	
 	
 	
 	
 	
 (F7;;FzF2F;z+FF'+FFFFFF'+FFFF'FFFFFF7FFFF7FFF;FFFzFFF2FFF+FFFFFFFFFF4 R$>"T"l2TTTT"lTTT"TTTTTTlTTTTlTTTT4TTTTTTTTMMDAq66I"++I+a.I6.)I))II+IIIIIIII2IIII2III6IIIIII"IIII"III+IIIIIIaIIIIaIII.III)IIIIIII66I"++I+a.I6.)I))II+IIIIIIII2IIII2III6IIIIII"IIII"III+IIIIIIaIIIIaIII.III)IIIIIII " YYs   1u  u1	c                *
  a \        VR ,          4      p\        \        RR\        RRV.4      pVP                  p^ qTV8H  qf'       g   \
        P                  ! R1V3R2WE34      RR\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MRR\
        P                  ! V4      R\
        P                  ! V4      /,          p\
        P                  ! R	VP                   24      R
,           RV/,          p\        \
        P                  ! V4      4      hR;p;re\        V4      ;_uu_ 4       p	\         P"                  ! V	4      p
RRR4       X
R,          R,          pRVRVP%                  RR4      RVP%                  RR4      RVP%                  RR4      RVP%                  RR4      RVP%                  RR4      RVP%                  RR4      R^ RR3RR/
p\        VR,          4      p\        VR4      ;_uu_ 4       p	\         P&                  ! W4       RRR4       \        \        RR\        RR R!V.^xR"7      pVP                  p^ qTV8H  qf'       g   \
        P                  ! R1V3R2WE34      RR#\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MR#R\
        P                  ! V4      R\
        P                  ! V4      /,          p\
        P                  ! R$VP(                   R%VP                   24      R
,           RV/,          p\        \
        P                  ! V4      4      hR;p;reVP(                  pR&pVV9   pV'       g   \
        P                  ! R4V3R5VV34      R'\
        P                  ! V4      R(R)\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MR)/,          p\
        P                  ! R*VR+,           24      R,,           RV/,          p\        \
        P                  ! V4      4      hR;ppVP+                  4        Fu  oR-SP-                  4       9   g   K  \.        ;QJ d    V3R. lR6 4       F  '       g   K   R/M	  RM! V3R. lR6 4       4      '       g   K\  \0        P2                  ! R0S 24       Kw  	  R#   + '       g   i     EL; i  + '       g   i     EL; i)7r   r   r   r   r   r   train_resultr   r   ztrain_mlp failed:
r   r   Nr.   r-   mlp_weights_file!i_long_entry_activation_thresholdg         i_long_exit_activation_threshold-i_long_exit_activation_confirmation_thresholdi_use_long_exit_confirmationg      ?i_use_long_entry_confirmationFi_trailing_stop_thresholdi_regime_windowi_regime_entry_min_scorei_mvrv_suppress_bearztest_params.jsonwzstrategies/validate_strategy.pyz--strategy_filezstrategy_mlp_scores.pyz--params_file)r   validate_resultzvalidate_strategy failed:
r   zTotal Tradesr/   r&   out_textz!Expected metrics in output, got:
:Ni  Nr3   nanc              3   ,   <"   T F	  qS9   x  K  	  R # 5i)N ).0kwlines   & r   	<genexpr>NTestAcceptanceMLP.test_validate_strategy_runs_with_artifact.<locals>.<genexpr>i   s     ,^B]B4ZB]s   TzNaN found in metric line: r9   r;   g     @r<   )z%(py1)s in %(py3)s)CalmarSharpezP&L)rC   r   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rO   rP   rQ   rT   rU   rV   rW   dumprN   
splitlinesloweranypytestfail)r`   ra   r   r   rb   rc   rd   re   rf   rh   r!   recparamsparams_filer   r   ro   rn   rz   r   s   &&                 @r   )test_validate_strategy_runs_with_artifact;TestAcceptanceMLP.test_validate_strategy_runs_with_artifact?   sV   (778V%9%w	7CI J&& 	
! 	
!+ 	
 	
 	
& 	
 	
	6	
 	
 	
| 	
 	
 			
| 	
 	
 			
& 	
 	
 			
! 	
 	
 	
 	
!,"5"5!67	
 	
 	
 	
 	
 	
 #YY!iilG j!":;/9\^a1b.8Z\_0`;SWWEtvy=z*CGG4RTW,X+SWW5TV[-\'1Lc)Rq&"E
 (%778+s##qIIf  $ 5g7[	 

  )) 	
Q 	
Q. 	
 	
 	
) 	
 	
	6	
 	
 	
 	
 	
 			
 	
 	
 			
) 	
 	
 			
Q 	
 	
 	
 	
)/*@*@)AODZDZC[\	
 	
 	
 	
 	
 	
 #)) 	
~) 	
 	
 	
~ 	
 	
 			
~ 	
 	
	6	
 	
 	
 	
 	
 			
 	
 	
 	
 	
0%0AB	
 	
 	
 	
 	
 	
 '')D

$,^B],^,^B],^)^)^8?@ *C YY  $##s   S-T-S>	T	r   N)__name__
__module____qualname____firstlineno__r}   r   __static_attributes____classdictcell__)__classdict__s   @r   r   r   !   s     J6+A +Ar   r   )__doc__builtinsrI   _pytest.assertion.rewrite	assertionrewriterG   rU   r   r   rZ   numpyr4   r   rR   abspathjoindirname__file__r\   rD   rE   r   markslowskipifrS   r   r   r   r   <module>r      s      	  
  	wwrww||BGGOOH$=tDE	
'',,tV%=
>   w//8LMGA GA N GAr   