Skip to content

Add a type guard for intX #4569

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

Merged
merged 6 commits into from
Apr 22, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix test for pandas
  • Loading branch information
ferrine committed Apr 11, 2021
commit e61ad341199f340f4ddc719012c8a6aa16a442fc
5 changes: 3 additions & 2 deletions pymc3/tests/test_model_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def test_pandas_to_array(self, input_dtype):
assert isinstance(theano_output, theano.graph.basic.Variable)
npt.assert_allclose(theano_output.eval(), theano_graph_input.eval())
intX = pm.theanof._conversion_map[theano.config.floatX]
if dense_input.dtype == intX or dense_input.dtype == theano.config.floatX:
if "int" in str(dense_input.dtype) or dense_input.dtype == theano.config.floatX:
assert theano_output.owner is None # func should not have added new nodes
assert theano_output.name == input_name
else:
Expand All @@ -92,7 +92,8 @@ def test_pandas_to_array(self, input_dtype):
if "float" in input_dtype:
assert theano_output.dtype == theano.config.floatX
else:
assert theano_output.dtype == intX
# only cast floats, leave ints as is
assert theano_output.dtype == input_dtype

# Check function behavior with generator data
generator_output = func(square_generator)
Expand Down