Closed Louis-Pujol closed 7 months ago
Hi, this is a foward compatibility warning. You don't have to worry about these being raised from inside Φ-Flow. If you want to get rid of them, you can move to 3.0 with
pip install --upgrade git+https://github.com/tum-pbs/PhiFlow@3.0
As this issue will be fixed with 3.0 anyway, I don't think it's worth fixing now.
Hi, thanks for your answer, I'll use 3.0, didn't now it was already available.
It's not officially released yet and some things still change, but it's stable.
Hello !
I have a little issue with the code:
It raises some warnings about instance checks inside
plot
:This situation seems a bit awkward to me, instance checks are discouraged but the suggested alternatives internally use instance checks and the warnings are still raised.
The warnings come from the lines: https://github.com/tum-pbs/PhiFlow/blob/b753266c5bdc165a96d62f6b52f5069170ae81da/phi/field/_field.py#L142 https://github.com/tum-pbs/PhiFlow/blob/b753266c5bdc165a96d62f6b52f5069170ae81da/phi/field/_field.py#L148 https://github.com/tum-pbs/PhiFlow/blob/b753266c5bdc165a96d62f6b52f5069170ae81da/phi/field/_field.py#L154
A solution should be to run these lines inside a context manager when warnings are ignored. I was about to open a PR to suggest this change, however as the behavior seems to change in version 3.0, this solution could be quickly obsolete.
Tell me if you think that it should be interesting to add a fix with a context manager to avoid warnings in this context, if so I can open a PR.