cnr-isti-vclab / PyMeshLab

The open source mesh processing python library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update documentation & incompatible changes

ashawkey opened this issue · comments

commented

Hi,
it seems there are some incompatible changes in the latest 2023.2 version (e.g., 'pymeshlab' has no attribute 'Percentage'), but the latest documentation is not updated to reflect these.

+1 here. @alemuntoni, Please bring back AbsoluteValue and PercentageValue for backward compatibility although deprecated. Many functions are no longer working without them now.

The latest 2023.2 version seems to have replaced AbsoluteValue and Percentage with PureValue and PercentageValue, respectively.

>>> import pymeshlab
>>> pymeshlab.print_pymeshlab_version()
PyMeshLab 2023.12 based on MeshLab 2023.12d
>>>
>>> hasattr(pymeshlab, "AbsoluteValue")
False
>>> hasattr(pymeshlab, "Percentage")
False
>>> hasattr(pymeshlab, "PureValue")
True
>>> hasattr(pymeshlab, "PercentageValue")
True

However, many functions even inside PyMeshLab still depend on them and thus no longer work. For example, targetlen argument of meshing_isotropic_explicit_remeshing() function (doc) still requires AbsoluteValue, which no longer exists in the latest 2023.2 version, instead of the new PureValue.

pymeshlab.pmeshlab.PyMeshLabException: Parameter targetlen: must be a pymeshlab.Percentage object or apymeshlab.AbsoluteValue object. Other type values are not accepted.

Reference:
https://github.com/cnr-isti-vclab/PyMeshLab/blob/5fd236cf0cce6ce1e3afc91224b8fd806a415267/docs/tutorials/apply_filter_parameters_percentage.rst#id3

Sorry about that. Unfortunately read the docs needs to manually trigger the build, and I forgot to do that. I'll do it right now

I just updated the docs and everything should be consistent now.

@Kazuki-Yoda I cannot restore the old class names, sorry. There is no easy way to add a class-alias with a deprecation message with pybind11. If you are going to upgrade to 2023.12, just rename AbsoluteValue to PureValue and Percentage to PercentageValue in your scripts.
Anyway, old names were just wrong (absolute value has a completely different meaning w.r.t. the way that the class is used in pymeshlab), and they should not be used anymore.

-- Edit --
Some classes are still missing in the docs. Working on it.

-- Edit 2 --
Now all the classes are listed in the docs and everything is consistent. :)

commented

Thanks for fixing this!

@alemuntoni Thank you very much for dealing with this issue very swiftly!!

If you are going to upgrade to 2023.12, just rename AbsoluteValue to PureValue and Percentage to PercentageValue in your scripts.

Although I can fix my scripts, I can't touch the algorithms implemented in PyMeshLab itself such as the pymeshlab.meshing_isotropic_explicit_remeshing() filter function, as I already mentioned in my earlier post.

Is there any other workaround for using those filter functions that still rely on the deprecated AbsoluteValue? Thanks again for your great work and library!!