Commit Graph

7 Commits

Author SHA1 Message Date
Edward Rusu
d1f35fe587 Box Boundedness determined using get_inf instead of np.inf (#2630)
* Box Boundedness determined using get_inf instead of np.inf

* Store original array entries for determining boundedness

* Capture the boundedness before casting away the np.inf

* Removed requirement that integer spaces be bounded above and below

* np full casts away the inf, so using dtype float for boundedness evaluation

* Removed commented code

* But the type ignore hint back in

* Spacing change from black code formatter
2022-03-02 10:51:06 -05:00
JYX
15b5c6c29f Fix RandomNumberGenerator pickling (#2639)
* Fix RandomNumberGenerator pickling

* Add test for RNG pickling fix

* Fix Python 3.7 compatibility about tuple unpacking

See: https://bugs.python.org/issue32117

* Fix formatting issue

* Add test for space pickling
2022-03-02 10:38:26 -05:00
Ilya Kamen
e9df493243 Py36+ code style in tests (#2547) 2022-01-11 12:12:05 -05:00
Jet
3746741708 Potential fix for integer overflow in box spaces (#2517)
* fix box infinite bounds

* Revert "fix box infinite bounds"

This reverts commit 8e27a01fda839f522fc5a0855350e5a543359c47.

* fix box space infinite bounds

* experiencing unit test failures with master build on windows, shifting to Linux to test

* box space infinite bounds fixed, all unit test pass, though the solution is still less elegant than I'd like

* bracket fix

* black formatting

* remove redundant casting to np.array for array spaces

* previous changes unintentionally changed the sampling method for float dtype infinite, this commit fixes that. Float infinite bounds are sampled either using shifted exponential or normal depending on circumstance, but int infinite bounds are always sampled uniformly.

* added more tests as per #2517, made some error messages more descriptive, changed logic for calculating inf for ints

* accidentally commented out something I shouldn't have commented out

* moved get_inf and get_precision to non-static functions

* Move get_precision and get_inf outside of class

* Don't edit code within github's editor lol:wq

* black
2022-01-10 23:45:41 -05:00
Ariel Kwiatkowski
c364506710 Seeding update (#2422)
* Ditch most of the seeding.py and replace np_random with the numpy default_rng. Let's see if tests pass

* Updated a bunch of RNG calls from the RandomState API to Generator API

* black; didn't expect that, did ya?

* Undo a typo

* blaaack

* More typo fixes

* Fixed setting/getting state in multidiscrete spaces

* Fix typo, fix a test to work with the new sampling

* Correctly (?) pass the randomly generated seed if np_random is called with None as seed

* Convert the Discrete sample to a python int (as opposed to np.int64)

* Remove some redundant imports

* First version of the compatibility layer for old-style RNG. Mainly to trigger tests.

* Removed redundant f-strings

* Style fixes, removing unused imports

* Try to make tests pass by removing atari from the dockerfile

* Try to make tests pass by removing atari from the setup

* Try to make tests pass by removing atari from the setup

* Try to make tests pass by removing atari from the setup

* First attempt at deprecating `env.seed` and supporting `env.reset(seed=seed)` instead. Tests should hopefully pass but throw up a million warnings.

* black; didn't expect that, didya?

* Rename the reset parameter in VecEnvs back to `seed`

* Updated tests to use the new seeding method

* Removed a bunch of old `seed` calls.

Fixed a bug in AsyncVectorEnv

* Stop Discrete envs from doing part of the setup (and using the randomness) in init (as opposed to reset)

* Add explicit seed to wrappers reset

* Remove an accidental return

* Re-add some legacy functions with a warning.

* Use deprecation instead of regular warnings for the newly deprecated methods/functions
2021-12-08 16:14:15 -05:00
Ishan Manchanda
103b7633f5 Readded overwritten changes for offset functionality for Discrete spaces (#2470)
Co-authored-by: J K Terry <justinkterry@gmail.com>
2021-10-30 12:12:01 -04:00
Ariel Kwiatkowski
947b857bd4 Test refactoring (#2427)
* Move tests to root with automatic PyCharm import refactoring. This will likely fail some tests

* Changed entry point for a registration test env.

* Move a stray lunar_lander test to tests/envs/...

* black

* Change the version from which importlib_metadata is replaced with importlib.metadata. Also requiring installing importlib_metadata for python 3.8 now.

???????????

* Undo last commit
2021-09-28 19:53:30 -04:00