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 a type guard for intX #4569

Merged
merged 6 commits into from
Apr 22, 2021
Merged

Add a type guard for intX #4569

merged 6 commits into from
Apr 22, 2021

Conversation

ferrine
Copy link
Member

@ferrine ferrine commented Mar 26, 2021

Note: Questions before we go ahead, the alternative would be leave the function as is and covert parameters in Discrete distributions

@ferrine
Copy link
Member Author

ferrine commented Mar 28, 2021

@lucianopaz pymc3/tests/test_model_helpers.py::TestHelperFunc::test_pandas_to_array this test does not pass. I've changed intX to be tolerant to int dtypes but it complains about new behavior: not downcasting int32 to int16. What is treated as the expected behavior here?

@michaelosthege michaelosthege added this to the vNext (3.11.3) milestone Mar 31, 2021
@ferrine
Copy link
Member Author

ferrine commented Apr 2, 2021

also, @brandonwillard, do we really need downcasting there?

@ferrine ferrine added the v4 label Apr 2, 2021
@brandonwillard brandonwillard changed the title add type guard for inX Add a type guard for intX Apr 2, 2021
@lucianopaz
Copy link
Contributor

Sorry for taking so long @ferrine. I honestly don’t know what’s best here. Given that you’ve changed the intX behaviour it would make sense to also change the test function to adapt to the new behaviour. I imagine that you would have to change the if statement to make it more lenient with ints.

@ferrine
Copy link
Member Author

ferrine commented Apr 9, 2021

I'll fix the test soon as it seems we all agree on the change

@ferrine
Copy link
Member Author

ferrine commented Apr 11, 2021

I've fixed the failings tests, feel free to review and merge

RELEASE-NOTES.md Outdated Show resolved Hide resolved
@ferrine
Copy link
Member Author

ferrine commented Apr 18, 2021

@lucianopaz or @brandonwillard can you please have a look at this?

@michaelosthege
Copy link
Member

@ferrine not converting already int data sounds like a good idea. And your solution is simple yet elegant.
Go ahead and merge unless you changed your mind

@twiecki twiecki merged commit 3447619 into v3 Apr 22, 2021
@twiecki twiecki deleted the v3.fix-4553 branch April 22, 2021 06:55
@ricardoV94
Copy link
Member

What about pushing this to the V4?

@twiecki
Copy link
Member

twiecki commented Apr 22, 2021

Yeah, we should.

@michaelosthege michaelosthege mentioned this pull request Apr 22, 2021
4 tasks
michaelosthege pushed a commit to michaelosthege/pymc that referenced this pull request Nov 20, 2022
* add type guard for inX
* fix test for pandas
* fix posterior test, ints passed for float data

Closes pymc-devs#4279
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants