tic-tac-toe icon indicating copy to clipboard operation
tic-tac-toe copied to clipboard

Fix return types

Open tarobins opened this issue 1 year ago • 5 comments

  1. Fix error such as "Tuple expression not allowed in type annotation Use tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union typePylancereportInvalidTypeForm"

  2. Fix return type of _min and _max on RndMinMaxAgent, both of which return a tuple

tarobins avatar Feb 19 '24 01:02 tarobins

Thanks for your pull request. Happy to merge in principal, but I think some of them are not quite correct at the moment. E.g. I think get_probs() and get_valid_probs() in should return tuple[list[float], list[float]] rather than tuple[float, float] in DirectPolicyAngent, EGreedyNNQPlayer, and ExpDoubleDuelQPlayer. Can you have a look and fix where necessary?

fcarsten avatar Feb 20 '24 23:02 fcarsten

Will do. May take a day or two. I also hope to send you PRs to update the code to use v2 api.

On Tue, Feb 20, 2024 at 3:25 PM Carsten Friedrich @.***> wrote:

Thanks for your pull request. Happy to merge in principal, but I think some of them are not quite correct at the moment. E.g. I think get_probs() and get_valid_probs() in should return tuple[list[float], list[float]] rather than tuple[float, float] in DirectPolicyAngent, EGreedyNNQPlayer, and ExpDoubleDuelQPlayer. Can you have a look and fix where necessary?

— Reply to this email directly, view it on GitHub https://github.com/fcarsten/tic-tac-toe/pull/6#issuecomment-1955327594, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFFHOOTLYZEL2XQRVLOAHTYUUWH5AVCNFSM6AAAAABDOUGABKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJVGMZDONJZGQ . You are receiving this because you authored the thread.Message ID: @.***>

tarobins avatar Feb 21 '24 06:02 tarobins

Fixed, I think

tarobins avatar Feb 22 '24 01:02 tarobins

get_probs() and get_valid_probs() in DeepExpDoubleDuelQPlayer still look incorrect. Rest looks good!

fcarsten avatar Feb 23 '24 22:02 fcarsten

Also wondering if the correct type in get_probs() and get_valid_probs() across all classes is actually tuple[NDArray[float], NDArray[float]] rather than tuple[list[float], list[float]]

fcarsten avatar Feb 23 '24 22:02 fcarsten