Commit Graph

10 Commits

Author SHA1 Message Date
Ilya Kamen
ad79b0ad0f typing in gym.spaces (#2541)
* typing in spaces.Box and spaces.Discrete

* adds typing to dict and tuple spaces

* Typecheck all spaces

* Explicit regex to include all files under space folder

* Style: use native types and __future__ annotations

* Allow only specific strings for Box.is_bounded args

* Add typing to changes from #2517

* Remove Literal as it's not supported by py3.7

* Use more recent version of pyright

* Avoid name clash for type checker

* Revert "Avoid name clash for type checker"

This reverts commit 1aaf3e0e0328171623a17a997b65fe734bc0afb1.

* Ignore the error. It's reported as probable bug at https://github.com/microsoft/pyright/issues/2852

* rebase and add typing for `_short_repr`
2022-01-24 17:22:11 -05:00
Xuehai Pan
18c8b988d4 Type cast in spaces families (#2491)
* Type cast for `spaces.Dict`

* Type cast for `spaces.Tuple`

* Type cast for `spaces.Discrete`

* Type cast for `spaces.MultiDiscrete`

* Type cast for `spaces.MultiBinary`
2021-12-16 00:45:37 -05:00
Elijah K
8e5ae02ab1 Py36+ syntax in gym/spaces: derived by running pyupgrade --py36-plus gym/spaces/**.py and flynt gym --ll 120 (#2466)
Co-authored-by: Ilya Kamen <ilya.kamenshchikov@bosch.com>
2021-11-14 08:50:23 -05:00
RaghuSpaceRajan
c571b0d853 Make Tuple and Dicts be seedable with lists and dicts of seeds + make the seed in default initialization controllable (#1774)
* Make the seed in default initialization controllable

Since seed() is being called in default initialization of Space, it should be controllable for reproducibility.

* Updated derived classes of Space to have their seeds controllable at initialization.

* Allow Tuple's spaces to each have their own seed

* Added dict based seeding for Dict space; test cases for Tuple and Dict seeding

* Update discrete.py

* Update test_spaces.py

* Add seed to __init__()

* blacked

* Fix black

* Fix failing tests
2021-09-13 14:08:01 -04:00
Xuehai Pan
bb8e8063e9 Fix seed method for spaces.Tuple and spaces.Dict (#2365)
* Fix seed method for Tuple and Dict

* Improve stochasticity

* Update test cases for seed method

* Update test cases for seed method

Update test cases for seed method

Update test cases for seed method
2021-09-02 10:15:34 -04:00
J K Terry
78d2b512d8 redo black (#2272) 2021-07-29 15:39:42 -04:00
Justin Terry
e9d2c41f2b redo black 2021-07-29 12:42:48 -04:00
Christian Clauss
bb81e141ea Blacken the codebase (#2265) 2021-07-28 20:26:34 -04:00
pzhokhov
9a7f10ece1 fix accidental seed function overriding in Space (#1506)
* fix accidental seed function overriding in Space

* default seed to None in spaces
2019-05-24 18:16:07 -07:00
Xingdong Zuo
f408e2284c Rename tuple_space.py to tuple.py 2019-03-25 00:56:57 +01:00