internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: mit-ll-responsible-ai/hydra-zen

Issue:
`make_config` is too aggressive with type-widening
https://github.com/mit-ll-responsible-ai/hydra-zen/blob/00c50b770af2644551c30b821ff61f740fd4399a/src/hydra_zen/structured_configs/_implementations.py#L2405-L2409

needs identical fix from: https://github.com/mit-ll-responsible-ai/hydra-zen/pull/185


Discussion:

Resolving patch:
diff --git a/src/hydra_zen/structured_configs/_implementations.py b/src/hydra_zen/structured_configs/_implementations.py
--- a/src/hydra_zen/structured_configs/_implementations.py
+++ b/src/hydra_zen/structured_configs/_implementations.py
@@ -2402,10 +2402,12 @@ def make_config(
             (
                 str(f.name),
                 (
-                    f.hint
                     # f.default: Field
                     # f.default.default: Any
-                    if not is_builds(f.default.default) or hydra_recursive is False  # type: ignore
+                    f.hint
+                    if hydra_recursive is False
+                    or not is_builds(f.default.default)  # type: ignore
+                    or is_builds(f.hint)
                     else Any
                 ),
                 f.default,


Test patch:
diff --git a/tests/test_make_config.py b/tests/test_make_config.py
--- a/tests/test_make_config.py
+++ b/tests/test_make_config.py
@@ -1,9 +1,11 @@
+# Copyright (c) 2022 Massachusetts Institute of Technology
+# SPDX-License-Identifier: MIT
 import inspect
 import string
 from dataclasses import FrozenInstanceError
 from enum import Enum
 from itertools import chain
-from typing import Callable, Tuple, Union
+from typing import Any, Callable, Tuple, Union, get_type_hints
 
 import hypothesis.strategies as st
 import pytest
@@ -113,6 +115,7 @@ class A:
 @example(int)
 @example(str)
 @example(bool)
+@example(builds(int))
 @example(Tuple[int, str, bool])
 @example(Callable[[int], int])
 @example(Union[Callable, int])
@@ -291,3 +294,12 @@ def test_hydra_options(hydra_convert, hydra_recursive):
         assert c_yaml == "{}\n"  # yaml for empty config
     else:
         assert b_yaml.splitlines()[1:] == c_yaml.splitlines()
+
+
+def test_make_config_annotation_widening_behavior():
+    BuildsInt = builds(int)
+    Conf1 = make_config(a=ZenField(hint=BuildsInt, default=BuildsInt()))
+    assert get_type_hints(Conf1)["a"] is BuildsInt
+
+    Conf2 = make_config(b=ZenField(hint=int, default=BuildsInt()))
+    assert get_type_hints(Conf2)["b"] is Any
Repository: mit-ll-responsible-ai/hydra-zen

Issue:
Building an inherited classmethod yields method from parent
```python
class A:
    @classmethod
    def foo(cls):
        return cls.bar()
    @classmethod
    def bar(self):
        raise NotImplementedError()
        
class B(A):
    @classmethod
    def bar(self):
        return 1
```
```python    
>>> cfg = builds(B.foo, zen_partial=True)    
>>> instantiate(cfg)
functools.partial(<bound method A.foo of <class '__main__.A'>>)

>>> cfg._target_
__main__.A.foo
```


Discussion:

Resolving patch:
diff --git a/src/hydra_zen/structured_configs/_utils.py b/src/hydra_zen/structured_configs/_utils.py
--- a/src/hydra_zen/structured_configs/_utils.py
+++ b/src/hydra_zen/structured_configs/_utils.py
@@ -260,7 +260,12 @@ def get_obj_path(obj: Any) -> str:
     if not is_classmethod(obj):
         return f"{module}.{name}"
     else:
-        return f"{module}.{qualname}"
+        # __qualname__ reflects name of class that originaly defines classmethod.
+        # Does not point to child in case of inheritance.
+        #
+        # obj.__self__ -> parent object
+        # obj.__name__ -> name of classmethod
+        return f"{get_obj_path(obj.__self__)}.{obj.__name__}"
 
 
 NoneType = type(None)


Test patch:
diff --git a/tests/test_signature_parsing.py b/tests/test_signature_parsing.py
--- a/tests/test_signature_parsing.py
+++ b/tests/test_signature_parsing.py
@@ -582,3 +582,32 @@ def test_inheritance_populates_init_field():
 
     # x is 'filled' via inheritance
     Conf2()
+
+
+class A265:
+    @classmethod
+    def foo(cls):
+        return cls.bar()
+
+    @classmethod
+    def bar(cls):
+        raise NotImplementedError()
+
+
+class B265(A265):
+    @classmethod
+    def bar(cls):
+        return 1
+
+
+class C265(B265):
+    @classmethod
+    def bar(cls):
+        return "hello"
+
+
+@pytest.mark.parametrize("Cls", [B265, C265])
+def test_builds_of_inherited_classmethod(Cls):
+    # https://github.com/mit-ll-responsible-ai/hydra-zen/issues/265
+
+    assert instantiate(builds(Cls.foo)) == Cls.foo()
Repository: mit-ll-responsible-ai/hydra-zen

Issue:
Fixing type annotations associated with task functions
Need to document use of type-alias:

![image](https://user-images.githubusercontent.com/29104956/173416515-de44812b-2f1f-4577-8506-199cc1b0efdd.png)

Need to broaden type annotations in `launch`

![image](https://user-images.githubusercontent.com/29104956/173416671-91047bee-3f22-4f41-bb4c-6639747f8d8d.png)



Discussion:

Resolving patch:
diff --git a/src/hydra_zen/_launch.py b/src/hydra_zen/_launch.py
--- a/src/hydra_zen/_launch.py
+++ b/src/hydra_zen/_launch.py
@@ -15,7 +15,7 @@
 
 from hydra_zen._compatibility import HYDRA_VERSION
 from hydra_zen._hydra_overloads import instantiate
-from hydra_zen.typing._implementations import DataClass
+from hydra_zen.typing._implementations import DataClass, InstOrType
 
 
 class _NotSet:  # pragma: no cover
@@ -56,8 +56,8 @@ def _store_config(
 
 
 def launch(
-    config: Union[DataClass, Type[DataClass], Mapping[str, Any]],
-    task_function: Callable[[DictConfig], Any],
+    config: Union[InstOrType[DataClass], Mapping[str, Any]],
+    task_function: Callable[[Any], Any],
     overrides: Optional[List[str]] = None,
     multirun: bool = False,
     version_base: Optional[Union[str, Type[_NotSet]]] = _NotSet,


Test patch:
Repository: mit-ll-responsible-ai/hydra-zen

Issue:
Add auto-config support for `torch.optim._RequiredParameter`
See: https://github.com/mit-ll-responsible-ai/hydra-zen/issues/257#issuecomment-1287420672


Discussion:

Resolving patch:
diff --git a/src/hydra_zen/structured_configs/_implementations.py b/src/hydra_zen/structured_configs/_implementations.py
--- a/src/hydra_zen/structured_configs/_implementations.py
+++ b/src/hydra_zen/structured_configs/_implementations.py
@@ -538,6 +538,19 @@ def _is_jax_compiled_func(value: Any) -> bool:  # pragma: no cover
         return False
 
 
+def _is_torch_optim_required(value: Any) -> bool:  # pragma: no cover
+    torch_optim_optimizer = sys.modules.get("torch.optim.optimizer")
+
+    if torch_optim_optimizer is None:
+        return False
+
+    try:
+        required = getattr(torch_optim_optimizer, "required")
+        return value is required
+    except AttributeError:
+        return False
+
+
 def _check_for_dynamically_defined_dataclass_type(target_path: str, value: Any) -> None:
     if target_path.startswith("types."):
         raise HydraZenUnsupportedPrimitiveError(
@@ -703,6 +716,10 @@ def sanitized_default_value(
         else:  # pragma: no cover
             del _v
 
+    # support for torch objects
+    if _is_torch_optim_required(value):  # pragma: no cover
+        return MISSING
+
     # `value` could no be converted to Hydra-compatible representation.
     # Raise error
     if field_name:


Test patch:
diff --git a/tests/test_third_party/test_against_torch.py b/tests/test_third_party/test_against_torch.py
--- a/tests/test_third_party/test_against_torch.py
+++ b/tests/test_third_party/test_against_torch.py
@@ -10,7 +10,7 @@
 import torch as tr
 from hypothesis import assume, given
 from omegaconf import OmegaConf
-from torch.optim import Adam, AdamW
+from torch.optim import SGD, Adam, AdamW
 from torch.utils.data import DataLoader, Dataset
 
 from hydra_zen import builds, hydrated_dataclass, instantiate, just, to_yaml
@@ -145,3 +145,10 @@ def test_dataloader_sig_doesnt_have_self():
     assert "self" not in {f.name for f in _fields}
     assert len(_fields) > 2
     assert list(instantiate(Conf)) == [tr.tensor(float(i)) for i in range(5)]
+
+
+def test_auto_config_support_for_optim_required():
+    Opt = instantiate(
+        builds(SGD, populate_full_signature=True, zen_partial=True)(lr=1.0)
+    )
+    assert isinstance(Opt(tr.nn.Linear(1, 1).parameters()), SGD)
Repository: mit-ll-responsible-ai/hydra-zen

Issue:
`zen_wrapper` should support partial'd wrappers
This should work:

```python
builds(something, zen_wrappers=partial(my_wrapper, param=100))
```

Currently, one would have to write:

```python
builds(something, zen_wrappers=builds(my_wrapper, param=100, zen_partial=True))
```

we just need to check if a wrapper is an instance of `partial` and auto-apply `hydra_zen.just` if so.


Discussion:

Resolving patch:
diff --git a/src/hydra_zen/structured_configs/_implementations.py b/src/hydra_zen/structured_configs/_implementations.py
--- a/src/hydra_zen/structured_configs/_implementations.py
+++ b/src/hydra_zen/structured_configs/_implementations.py
@@ -1501,6 +1501,9 @@ def builds(target, populate_full_signature=False, **kw):
                 continue
             # We are intentionally keeping each condition branched
             # so that test-coverage will be checked for each one
+            if isinstance(wrapper, functools.partial):
+                wrapper = ZEN_VALUE_CONVERSION[functools.partial](wrapper)
+
             if is_builds(wrapper):
                 # If Hydra's locate function starts supporting importing literals
                 # – or if we decide to ship our own locate function –


Test patch:
diff --git a/tests/test_zen_processing/test_zen_wrappers.py b/tests/test_zen_processing/test_zen_wrappers.py
--- a/tests/test_zen_processing/test_zen_wrappers.py
+++ b/tests/test_zen_processing/test_zen_wrappers.py
@@ -2,6 +2,7 @@
 # SPDX-License-Identifier: MIT
 import string
 import warnings
+from functools import partial
 from typing import Any, Callable, Dict, List, TypeVar, Union
 
 import hypothesis.strategies as st
@@ -299,3 +300,19 @@ def test_bad_relative_interp_warns(wrappers, expected_match):
 def test_interp_doesnt_warn(wrappers):
     with warnings.catch_warnings():
         builds(dict, zen_wrappers=wrappers, zen_meta=dict(s=1))
+
+
+def pmy_wrapper(func, repeat):
+    def w(*a, **k):
+        return [func(*a, **k)] * repeat
+
+    return w
+
+
+def ptarget():
+    return "moo"
+
+
+def test_partial_zen_wrapper():
+    out = instantiate(builds(ptarget, zen_wrappers=partial(pmy_wrapper, repeat=3)))
+    assert out == ["moo"] * 3
Repository: mit-ll-responsible-ai/hydra-zen

Issue:
Don't make any configs frozen by default
Apparently this causes config merge issues: https://github.com/mit-ll-responsible-ai/hydra-zen/discussions/438


Discussion:

Resolving patch:
diff --git a/src/hydra_zen/structured_configs/_implementations.py b/src/hydra_zen/structured_configs/_implementations.py
--- a/src/hydra_zen/structured_configs/_implementations.py
+++ b/src/hydra_zen/structured_configs/_implementations.py
@@ -485,7 +485,7 @@ def wrapper(decorated_obj: Any) -> Any:
     return wrapper
 
 
-@dataclass(frozen=True)
+@dataclass(unsafe_hash=True)
 class Just:
     """Just[T] is a config that returns T when instantiated."""
 


Test patch:
diff --git a/tests/test_launch/test_merge_compat.py b/tests/test_launch/test_merge_compat.py
new file mode 100644
--- /dev/null
+++ b/tests/test_launch/test_merge_compat.py
@@ -0,0 +1,52 @@
+# Copyright (c) 2023 Massachusetts Institute of Technology
+# SPDX-License-Identifier: MIT
+
+import pytest
+from omegaconf import DictConfig
+
+from hydra_zen import ZenStore, builds, launch, make_config, to_yaml, zen
+
+
+def relu():
+    ...
+
+
+def selu():
+    ...
+
+
+class Model:
+    def __init__(self, activation_fn=relu):
+        ...
+
+
+def app(zen_cfg: DictConfig, model: Model) -> None:
+    print(to_yaml(zen_cfg, resolve=True))
+
+
+@pytest.mark.usefixtures("cleandir")
+@pytest.mark.usefixtures("clean_store")
+def test_merge_prevented_by_frozen_regression():
+    # https://github.com/mit-ll-responsible-ai/hydra-zen/issues/449
+
+    store = ZenStore()
+    Config = builds(
+        app,
+        populate_full_signature=True,
+        hydra_defaults=[
+            "_self_",
+            {"model": "Model"},
+            {"experiment": "selu"},
+        ],
+    )
+
+    experiment_store = store(group="experiment", package="_global_")
+    experiment_store(
+        make_config(
+            hydra_defaults=["_self_"], model=dict(activation_fn=selu), bases=(Config,)
+        ),
+        name="selu",
+    )
+    store(Model, group="model")
+    store.add_to_hydra_store()
+    launch(Config, zen(app), version_base="1.2")
Repository: mit-ll-responsible-ai/hydra-zen

Issue:
pyright compat
Closes #610


Discussion:

Resolving patch:
diff --git a/src/hydra_zen/typing/_implementations.py b/src/hydra_zen/typing/_implementations.py
--- a/src/hydra_zen/typing/_implementations.py
+++ b/src/hydra_zen/typing/_implementations.py
@@ -439,7 +439,7 @@ class _Py312Dataclass(_Py311Dataclass, total=False):
 
 
 class StrictDataclassOptions(_StrictDataclassOptions):
-    cls_name: Required[str]
+    cls_name: Required[str]  # type: ignore
 
 
 class DataclassOptions(_Py312Dataclass, total=False):
diff --git a/src/hydra_zen/wrapper/_implementations.py b/src/hydra_zen/wrapper/_implementations.py
--- a/src/hydra_zen/wrapper/_implementations.py
+++ b/src/hydra_zen/wrapper/_implementations.py
@@ -79,7 +79,7 @@
 _UNSPECIFIED_: Any = object()
 
 
-_SUPPORTED_INSTANTIATION_TYPES: Tuple[Any, ...] = (dict, DictConfig, list, ListConfig)  # type: ignore
+_SUPPORTED_INSTANTIATION_TYPES: Tuple[Any, ...] = (dict, DictConfig, list, ListConfig)
 
 ConfigLike: TypeAlias = Union[
     DataClass_,


Test patch:
Repository: sotetsuk/pgx

Issue:
pgx v 0.0.9 でimages フォルダがダウンロードされない.



Discussion:
pgx v0.0.9をcolab上でpipインストールして, suzume_jongのvisualizerを使おうとすると, images folderがないためにエラーが出る. pgxがインストールされているfolderを調べると確かにimages folderが存在しない.

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -10,6 +10,8 @@
     author_email="sotetsu.koyamada@gmail.com",
     keywords="",
     packages=find_packages(),
+    package_data={'': ['LICENSE', '*.svg']},
+    include_package_data=True,
     install_requires=["jax", "flax", "svgwrite"],
     classifiers=[
         "Programming Language :: Python :: 3.8",


Test patch:
Repository: sotetsuk/pgx

Issue:
[TicTacToe] confirm visualization (order of X and O)
The first turn is X


Discussion:

Resolving patch:
diff --git a/pgx/dwg/backgammon.py b/pgx/dwg/backgammon.py
--- a/pgx/dwg/backgammon.py
+++ b/pgx/dwg/backgammon.py
@@ -151,9 +151,9 @@ def _make_backgammon_dwg(dwg, state: BackgammonState, config):
     )
     board_g.add(
         dwg.text(
-            text=f"× {board[26]}",  # 26:黒
+            text=f"×{board[26]}",  # 26:黒
             insert=(
-                14.8 * GRID_SIZE,
+                14.6 * GRID_SIZE,
                 1.4 * GRID_SIZE,
             ),
             fill=color_set.grid_color,
@@ -183,9 +183,9 @@ def _make_backgammon_dwg(dwg, state: BackgammonState, config):
     )
     board_g.add(
         dwg.text(
-            text=f"× {-board[27]}",  # 27:白
+            text=f"×{-board[27]}",  # 27:白
             insert=(
-                14.8 * GRID_SIZE,
+                14.6 * GRID_SIZE,
                 13.4 * GRID_SIZE,
             ),
             fill=color_set.grid_color,
diff --git a/pgx/dwg/tictactoe.py b/pgx/dwg/tictactoe.py
--- a/pgx/dwg/tictactoe.py
+++ b/pgx/dwg/tictactoe.py
@@ -81,19 +81,6 @@ def _make_tictactoe_dwg(dwg, state: TictactoeState, config):
         x = i % BOARD_WIDTH
         y = i // BOARD_HEIGHT
         if mark == 0:  # 先手
-            board_g.add(
-                dwg.circle(
-                    center=(
-                        (x + 0.5) * GRID_SIZE,
-                        (y + 0.5) * GRID_SIZE,
-                    ),
-                    r=0.4 * GRID_SIZE,
-                    stroke=color_set.grid_color,
-                    stroke_width=0.05 * GRID_SIZE,
-                    fill="none",
-                )
-            )
-        elif mark == 1:  # 後手
             board_g.add(
                 dwg.line(
                     start=(
@@ -122,4 +109,17 @@ def _make_tictactoe_dwg(dwg, state: TictactoeState, config):
                     stroke_width=0.05 * GRID_SIZE,
                 )
             )
+        elif mark == 1:  # 後手
+            board_g.add(
+                dwg.circle(
+                    center=(
+                        (x + 0.5) * GRID_SIZE,
+                        (y + 0.5) * GRID_SIZE,
+                    ),
+                    r=0.4 * GRID_SIZE,
+                    stroke=color_set.grid_color,
+                    stroke_width=0.05 * GRID_SIZE,
+                    fill="none",
+                )
+            )
     return board_g


Test patch:
Repository: sotetsuk/pgx

Issue:
[Hex] Bug in step
@sotetsuk 
 Error message
 
```
  File "/Users/nishimorihajimeichirou/mcts-gpu/jax-planning/venv/lib/python3.10/site-packages/pgx/hex.py", line 71, in _step
    return partial(step, size=self.size)(state, action)
  File "/Users/nishimorihajimeichirou/mcts-gpu/jax-planning/venv/lib/python3.10/site-packages/pgx/hex.py", line 111, in step
    board = jax.lax.fori_loop(0, 6, merge, board)
  File "/Users/nishimorihajimeichirou/mcts-gpu/jax-planning/venv/lib/python3.10/site-packages/pgx/hex.py", line 105, in merge
    return jax.lax.cond(
TypeError: true_fun and false_fun output must have identical types, got
DIFFERENT ShapedArray(int32[121]) vs. ShapedArray(int16[121]).
```
dtypeが揃っていないっぽいですね.


Discussion:

Resolving patch:
diff --git a/pgx/core.py b/pgx/core.py
--- a/pgx/core.py
+++ b/pgx/core.py
@@ -31,6 +31,7 @@
 # (2) it is tedious to remember or rewrite version numbers, and
 # (3) we do not want to slow down development for fear of inconveniencing users.
 EnvId = Literal[
+    "hex",
     "tic_tac_toe",
     "go-19x19",
     "shogi",
@@ -235,6 +236,10 @@ def make(env_id: EnvId):
         from pgx.minatar.asterix import MinAtarAsterix
 
         return MinAtarAsterix()
+    elif env_id == "hex":
+        from pgx.hex import Hex
+
+        return Hex()
     else:
         available_envs = "\n".join(get_args(EnvId))
         raise ValueError(
diff --git a/pgx/hex.py b/pgx/hex.py
--- a/pgx/hex.py
+++ b/pgx/hex.py
@@ -45,7 +45,7 @@ class State(pgx.State):
     #  .
     #  [110, 111, 112, ...,  119, 120]]
     board: jnp.ndarray = -jnp.zeros(
-        11 * 11, jnp.int16
+        11 * 11, jnp.int32
     )  # <0(oppo), 0(empty), 0<(self)
 
 


Test patch:
diff --git a/tests/test_env.py b/tests/test_env.py
--- a/tests/test_env.py
+++ b/tests/test_env.py
@@ -24,7 +24,7 @@ def test_jit():
 
         state = init(keys)
         assert state.current_player.shape == (N,)
-        assert (state.observation).sum() != 0
+        # assert (state.observation).sum() != 0
 
         action = act_randomly(key, state)
Repository: sotetsuk/pgx

Issue:
[Visualizer] Bug in hex visualizer
<img width="900" alt="スクリーンショット 2023-03-17 午後4 36 37" src="https://user-images.githubusercontent.com/55940613/225842247-10cd159c-4086-4dfe-9526-6c3997b1344d.png">

tictactoe, go5x5ではエラーなくvisualizationできています.


Discussion:
```py
import pgx
import jax as jx
from pgx.hex import Hex
from pgx.visualizer import Visualizer
v = Visualizer()
env = Hex()
batch_size=19

batched_init = jx.jit(jx.vmap(env.init))
batched_step = jx.jit(jx.vmap(env.step, in_axes=(0,0)))
batch_observe = jx.jit(jx.vmap(env.observe))
rng = jx.random.PRNGKey(0)
rng, subkey = jx.random.split(rng)
subkeys = jx.random.split(subkey, batch_size)


state = batched_init(subkeys)
v.save_svg(state)
```
これでbugが再現できます

Resolving patch:
diff --git a/pgx/_visualizer.py b/pgx/_visualizer.py
--- a/pgx/_visualizer.py
+++ b/pgx/_visualizer.py
@@ -356,8 +356,12 @@ def _set_config_by_state(self, _state):  # noqa: C901
                 )
         elif isinstance(_state, HexState):
             self.config["GRID_SIZE"] = 30
-            self.config["BOARD_WIDTH"] = int(_state.size * 1.3)
-            self.config["BOARD_HEIGHT"] = int(_state.size * 0.8)
+            try:
+                self.config["BOARD_WIDTH"] = int(_state.size[0] * 1.3)
+                self.config["BOARD_HEIGHT"] = int(_state.size[0] * 0.8)
+            except IndexError:
+                self.config["BOARD_WIDTH"] = int(_state.size * 1.3)
+                self.config["BOARD_HEIGHT"] = int(_state.size * 0.8)
             self._make_dwg_group = _make_hex_dwg
             if (
                 self.config["COLOR_THEME"] is None
@@ -516,6 +520,10 @@ def _get_nth_state(self, _states, _i):
                 chain_id_board=_states.chain_id_board[_i],
                 turn=_states.turn[_i],
             )
+        elif isinstance(_states, HexState):
+            return HexState(
+                board=_states.board[_i],
+            )
         elif isinstance(_states, OthelloState):
             return OthelloState(
                 board=_states.board[_i],


Test patch:
Repository: sotetsuk/pgx

Issue:
[Visualizer, Hex] Flipping white and black in turn
![hex000](https://user-images.githubusercontent.com/55940613/226086441-fab97f82-f49f-416b-82ef-ec0e43f0fa63.svg)
![hex001](https://user-images.githubusercontent.com/55940613/226086442-ffcef05d-e36e-4fc9-bb24-5a572d50a6bc.svg)
![hex002](https://user-images.githubusercontent.com/55940613/226086443-701c03bc-caf9-4a8f-8f25-6c00c0d61245.svg)
![hex003](https://user-images.githubusercontent.com/55940613/226086444-c6a6a2fe-3a7c-4215-8816-9bded4dbf44f.svg)
![hex004](https://user-images.githubusercontent.com/55940613/226086445-3211c1b5-24c3-46dd-a093-a77dc2061fe1.svg)
このように白と黒がターンが変わるごとに反転しています. (バッチ数10で可視化したもので, みにくくなっています. すみません.)


Discussion:

Resolving patch:
diff --git a/pgx/_visualizer.py b/pgx/_visualizer.py
--- a/pgx/_visualizer.py
+++ b/pgx/_visualizer.py
@@ -529,6 +529,8 @@ def _get_nth_state(self, _states, _i):
             )
         elif isinstance(_states, HexState):
             return HexState(
+                size=_states.size[_i],
+                turn=_states.turn[_i],
                 board=_states.board[_i],
             )
         elif isinstance(_states, OthelloState):


Test patch:
Repository: sotetsuk/pgx

Issue:
[Docs] Add PyPI description
Currently, it's empty.


Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -1,10 +1,14 @@
 from setuptools import find_packages, setup
+from pathlib import Path
+
+long_description = (Path(__file__).parent / "README.md").read_text()
 
 setup(
     name="pgx",
     version="0.4.0",
-    long_description_content_type="text/markdown",
-    description="",
+    description="GPU/TPU-accelerated parallel game simulators for reinforcement learning (RL)",
+    long_description=long_description,
+    long_description_content_type='text/markdown',
     url="",
     author="Sotetsu KOYAMADA",
     author_email="sotetsu.koyamada@gmail.com",


Test patch: