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

Refactor Tests #1

Open
vdutor opened this issue Mar 26, 2021 · 2 comments
Open

Refactor Tests #1

vdutor opened this issue Mar 26, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@vdutor
Copy link
Member

vdutor commented Mar 26, 2021

The unit and integration tests are growing, and we are reusing a lot of the same code, in particular to:

  • generate data
  • run training
  • compile models

We should have some common functions and fixtures which will both increase readability of code, reduce duplication and make most of pytest caching.

As part of this, could we introduce an assert_shapes() utility function instead of the kinda confusing assert np.all(tf.shape(tensor) == tensor_shape)?

@vdutor vdutor added the enhancement New feature or request label Mar 26, 2021
@st--
Copy link
Member

st-- commented Apr 12, 2021

Minor clean-up that can happen alongside: np.testing.assert_almost_equal, np.testing.assert_array_almost_equal and np.testing.assert_approx_equal are used in gpflux but deprecated by numpy. We should move to np.testing.assert_allclose or one of the ULP tests.

@st--
Copy link
Member

st-- commented Apr 12, 2021

Also, we might want to consider moving shape comments into code-asserts of tensor shapes within the actual code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants