Add testing for Fundamental spaces with full coverage #3048
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Update all of the fundamental spaces (
Box
,Discrete
,MultiDiscrete
,MultiBinary
,Text
) with full coverageThis is the second part of #2977 split into two
These tests now provide 100% coverage for all of the fundamental spaces
Discrete.contains
to usenp.issubdtype
instead ofnp.typecodes
as this assumes to be a undocumented feature in numpyDiscrete.__setstate__
such that the state is set onceMultiBinary.sample
to have both 0, 1 and 2 for necessary 0 or 1 with 2 representing randomMultiBinary.contains
to be positive (not negative) checksMultiBinary.from_jsonable
with use the correct dtypeMultiDiscrete
MultiDiscrete.sample
to assume that thenvec
is correct over the users maskMultiDiscrete.contains
to use positive (not negative) checksText.sample
with masksText
property changes for private variables:_char_set
,_char_list
,_char_index
Text
with the flattened character being the index in the character set.test_space
in favour of individual testing files.tests/spaces/utils.py
where all testing spaces can be added such that new spaces added toTESTING_SPACES
can be automatically added to all tests.