WillianFuks / tfcausalimpact

Python Causal Impact Implementation Based on Google's R Package. Built using TensorFlow Probability.
Apache License 2.0
593 stars 70 forks source link

Add support python311 #80

Closed williamjamir closed 7 months ago

williamjamir commented 8 months ago

Close https://github.com/WillianFuks/tfcausalimpact/issues/79

Add support for Python 3.11, TensorFlow has added support for on v2.12

williamjamir commented 8 months ago

It looks like the PR checks are not being executed =/

Perhaps it's something that you need to activate or something like that?

WillianFuks commented 8 months ago

It looks like the PR checks are not being executed =/

Perhaps it's something that you need to activate or something like that?

I still need to approve those to run on upstream. Still, they are running in your repo. But there's this weird error 255 which so far I couldn't figure out what it is. When I have more time I'll take a look at it.

williamjamir commented 8 months ago

It looks like the PR checks are not being executed =/ Perhaps it's something that you need to activate or something like that?

I still need to approve those to run on upstream. Still, they are running in your repo. But there's this weird error 255 which so far I couldn't figure out what it is. When I have more time I'll take a look at it.

I found the issue, some tests were using an import pandas.util.testing that was deprecated since 1.0, and with version 2.0 it was removed. Also assert_almost_equal is not available anymore.

So, it's safe to use that import with the current pandas version pinned on the requirements.txt and the numpy equivalent of assert_almost_equal

I just don't know why pandas 2 was installed just now, and not on others runs 🤷

image
williamjamir commented 8 months ago

I'm not sure what this new error is about; locally, the dtype matches only on CI it is changed to int32. Also, I added check_dype=False, but the test still fails about dtype

image
WillianFuks commented 8 months ago

That's some good news. On the bad side it will require a more thorough investigation of what's happening. Hopefully I'll be able to also look into that on this weekend.

WillianFuks commented 8 months ago

Hi @williamjamir ,

I just fixed the windows issue on your branch, could you please confirm if everything is working as expected? As soon as you reply back with a positive I'll merge this patch already.

Thanks for this contribution!

williamjamir commented 8 months ago

Thanks for the fix!

Confirmed! Just tested locally on Mac M2 with Python 3.11, and your patch works flawlessly.

Ready for the merge 🚀