Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add testing for Fundamental spaces with full coverage #3048

Merged
merged 5 commits into from
Sep 3, 2022

Conversation

pseudo-rnd-thoughts
Copy link
Contributor

Update all of the fundamental spaces (Box, Discrete, MultiDiscrete, MultiBinary, Text) with full coverage
This is the second part of #2977 split into two

These tests now provide 100% coverage for all of the fundamental spaces

  1. Update Discrete.contains to use np.issubdtype instead of np.typecodes as this assumes to be a undocumented feature in numpy
  2. Fix Discrete.__setstate__ such that the state is set once
  3. Add feature (/ bug fix) to MultiBinary.sample to have both 0, 1 and 2 for necessary 0 or 1 with 2 representing random
  4. Make MultiBinary.contains to be positive (not negative) checks
  5. Bug fix MultiBinary.from_jsonable with use the correct dtype
  6. Fix type hints in MultiDiscrete
  7. Change MultiDiscrete.sample to assume that the nvec is correct over the users mask
  8. Make MultiDiscrete.contains to use positive (not negative) checks
  9. Correctly implement Text.sample with masks
  10. Add Text property changes for private variables: _char_set, _char_list, _char_index
  11. Add util support for Text with the flattened character being the index in the character set.
  12. Remove space-specific tests from test_space in favour of individual testing files.
  13. Add tests/spaces/utils.py where all testing spaces can be added such that new spaces added to TESTING_SPACES can be automatically added to all tests.

Copy link
Contributor

@younik younik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot find any flaws in this big PR, except for the missing tests; thanks for addressing it.

@@ -0,0 +1,3 @@
def test_sample():
# todo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing tests for MultiBinary

@jkterry1 jkterry1 merged commit 8e74fe3 into openai:master Sep 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants