WassimTenachi / PhySO

Physical Symbolic Optimization

Home Page:https://physo.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Double requirement of matplotlib

M-Colley opened this issue · comments

In the requirements.txt, there is matplotlib==3.5.1 and matplotlib

As the code is currently not working with matplotlib 3.7.0 and 3.7.1 due to a bug in that library, that you should be explicit in that file :)

Kind regards

Hi @M-Colley,

Thank you for bringing the unnecessary double requirement to my attention !
Do you mean that you are unable to run physo with matplotlib 3.7.0 / 3.7.1 ?
I just tested it and it works on my machine.

Cheers.
Wassim

I recreated some of your demos in Google Colab and it doesn't work with the pre-installed 3.7.1 of matplotlib (some axes error when running the SR or fit method).

Kind regards

Thank you again for brining that to my attention @M-Colley.
I was able to reproduce the issue on colab only (it works fine on linux and OSX).
I encountered a similar issue with matplotlib 3.5.1.

I was able to fix this and run physo with monitoring plots on google colab by installing latex like this:

!conda install latexcodec
!sudo apt install cm-super dvipng texlive-latex-extra texlive-latex-recommended

Were you able to resolve this issue on your side ?

Hey, yeah I was able to run it. I also had Latex installed using:

!sudo apt-get install texlive-latex-extra texlive-fonts-recommended dvipng cm-super !pip install latex

I did have to downgrade to matplotlib 3.5.1 though to make it work, 3.7.1 did not work :)

One other quick question:

if I have only one dimension as independent variable, which is the correct method to use?

physo.SR
or
physo.fit

Based on the examples, I assume physo.fit?

Kind regards!

Both are OK to use, physo.SR is just a higher level and simpler to use function that itself uses physo.fit that uses default hyperparameters ! :)
If you only have one variable you can just put in just one variable in both cases.

An example of physo.SR: https://github.com/WassimTenachi/PhySO/blob/main/demo/demo_quick_sr.ipynb
An example of physo.fit (in 1D): https://github.com/WassimTenachi/PhySO/blob/main/demo/demo_damped_harmonic_oscillator/demo_damped_harmonic_oscillator.ipynb
An example of physo.fit (in 2D): https://github.com/WassimTenachi/PhySO/blob/main/demo/demo_mechanical_energy/demo_mechanical_energy.ipynb

I did have to downgrade to matplotlib 3.5.1 though to make it work, 3.7.1 did not work :)

Weird I was able to make it work with 3.7.1 (even on colab) on my side...
I am going to leave a version free requirement for safety for now in case 3.5.1 is not available on some systems.

Thank you so much for your responses! That really helps a lot.

Potentially, it would help users also to have the Colab in case you want to share it :)

Again, thank you and kind regards

One more question: why is sympy == 1.10.1 required? Is support for newer versions planned (https://github.com/sympy/sympy/releases/tag/sympy-1.12)?

Potentially, it would help users also to have the Colab in case you want to share it :)

It's a good idea ! I will clean it a bit and share it ! :)

One more question: why is sympy == 1.10.1 required? Is support for newer versions planned (sympy/sympy@sympy-1.12 (release))?

For no good reason, it is just required by safety in case a behavior is changed in the newer versions (I have tested physo with this version extensively) but in principle yes it is compatible with newer versions !

I'm closing this thread but please feel free to ask any other questions or raise issues and I will gladly reopen it !