sotetsuk / pgx

♟️ Vectorized RL game environments in JAX
http://sotets.uk/pgx/
Apache License 2.0
372 stars 23 forks source link

Add `from_fen/to_fen` to `pgx.experimental.chess` #1167

Closed sotetsuk closed 6 months ago

sotetsuk commented 6 months ago

As there are several requests about from_fen/to_fen features. #1165 #971 I added them to public (but experimental) API. Users can use them so far.

from pgx.experimental.chess import from_fen, to_fen

state = from_fen("k7/8/8/8/2N5/8/P7/7K w - - 0 1")
print(to_fen(state))
codecov[bot] commented 6 months ago

Codecov Report

Attention: 14 lines in your changes are missing coverage. Please review.

Comparison is base (f26e9e3) 88.46% compared to head (ef8d0c3) 88.26%. Report is 1 commits behind head on main.

:exclamation: Current head ef8d0c3 differs from pull request most recent head 66d76bf. Consider uploading reports for the commit 66d76bf to get more accurate results

Files Patch % Lines
pgx/chess.py 7.69% 12 Missing :warning:
pgx/experimental/chess.py 97.91% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1167 +/- ## ========================================== - Coverage 88.46% 88.26% -0.21% ========================================== Files 64 65 +1 Lines 5947 5964 +17 ========================================== + Hits 5261 5264 +3 - Misses 686 700 +14 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.