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

Changing deprecated PyVista function #211

Merged
merged 6 commits into from
Feb 8, 2023

Conversation

clatapie
Copy link
Contributor

@clatapie clatapie commented Feb 8, 2023

Closes #209.

@clatapie clatapie self-assigned this Feb 8, 2023
@clatapie clatapie linked an issue Feb 8, 2023 that may be closed by this pull request
2 tasks
@clatapie
Copy link
Contributor Author

clatapie commented Feb 8, 2023

The rst.py file seems to have more deprecated PyVista functions that initially expected. For example, plotter.camera_position is not documented in the PyVista documentation.
I ping @AlejandroFernandezLuces to get his opinion on it.

Copy link

@AlejandroFernandezLuces AlejandroFernandezLuces left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your changes look fine, but reviewing the whole file I've found some functions that are not using the appropiate methods. I'll point out the methods I find that I think can be substituted by better options

@AlejandroFernandezLuces
Copy link

AlejandroFernandezLuces commented Feb 8, 2023

I think we can change plotter.textActor.SetText for plotter.add_text in this occurrences. If there is a reason why we are using the VTK functionality instead of the add_text wrapper let me know.
https://github.com/pyansys/pymapdl-reader/blob/cdc665de56bedf659911e29874c396e7b3a97cdd/ansys/mapdl/reader/rst.py#L3122-L3128

https://github.com/pyansys/pymapdl-reader/blob/cdc665de56bedf659911e29874c396e7b3a97cdd/ansys/mapdl/reader/rst.py#L3337

@AlejandroFernandezLuces
Copy link

Not deprecated, but I would change the background of the plotter using the theme as you did with the text, just to keep the code consistent. Not mandatory, up to you 😄

https://github.com/pyansys/pymapdl-reader/blob/cdc665de56bedf659911e29874c396e7b3a97cdd/ansys/mapdl/reader/rst.py#L3023-L3024

https://docs.pyvista.org/api/plotting/_autosummary/pyvista.themes.DefaultTheme.html

@AlejandroFernandezLuces
Copy link

The rst.py file seems to have more deprecated PyVista functions that initially expected. For example, plotter.camera_position is not documented in the PyVista documentation. I ping @AlejandroFernandezLuces to get his opinion on it.

camera_position is documented in PyVista docs, maybe you didn't find it because it is in BasePlotter, from which Plotter inherits:
https://docs.pyvista.org/api/plotting/_autosummary/pyvista.BasePlotter.camera_position.html#camera-position

FYI, the planar views and the isometric view are implemented in PyVista, just in case you are modifying manually the camera position for this.

@AlejandroFernandezLuces
Copy link

@AlejandroFernandezLuces
Copy link

@RobPasMue
Copy link
Member

@clatapie clatapie marked this pull request as ready for review February 8, 2023 14:53
Copy link

@AlejandroFernandezLuces AlejandroFernandezLuces left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@akaszynski akaszynski merged commit 3080004 into main Feb 8, 2023
@akaszynski akaszynski deleted the bug/pyvista_function_deprecated branch February 8, 2023 16:11
@germa89
Copy link
Contributor

germa89 commented Feb 9, 2023

Thank you guys... I'm going to do a release then.

@RobPasMue
Copy link
Member

Wait @germa89 - I wanted to do it with @clatapie - that way she'll get acquainted with the process. If it's fine with you.

@germa89
Copy link
Contributor

germa89 commented Feb 9, 2023

I actually thought the same.... but I didn't want to bother you with something I promised I will show her.

Anyways, it is late... @akaszynski already did it..... https://github.com/pyansys/pymapdl-reader/releases/tag/v0.52.9

@RobPasMue
Copy link
Member

Weird... there is no GitHub release...

@germa89
Copy link
Contributor

germa89 commented Feb 9, 2023

Yeah... the CICD failed. I'm rerunning

@RobPasMue
Copy link
Member

Okay, got it. Thanks @germa89!

@germa89
Copy link
Contributor

germa89 commented Feb 9, 2023

My pleasure #WorkingEarly #FromFar hahaha

@germa89
Copy link
Contributor

germa89 commented Feb 9, 2023

@germa89
Copy link
Contributor

germa89 commented Feb 9, 2023

I believe this line:

https://github.com/pyansys/pymapdl-reader/blob/main/setup.py#L105

Should be updated?... Because earlier versions of PyVista won't work with this new release?? @RobPasMue @clatapie @AlejandroFernandezLuces

@AlejandroFernandezLuces
Copy link

I believe this line:

https://github.com/pyansys/pymapdl-reader/blob/main/setup.py#L105

Should be updated?... Because earlier versions of PyVista won't work with this new release?? @RobPasMue @clatapie @AlejandroFernandezLuces

Definetly yes, parse_color was removed in 0.38.0. I would go for 0.38.1 as minimum dependency, as there were some bugs fixed in that version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecated PyVista function (parse_color)
5 participants