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

reqs: Fix for matplotlib >=3.6.3 #2047

Merged
merged 1 commit into from
May 4, 2023
Merged

Conversation

georgebisbas
Copy link
Contributor

@georgebisbas georgebisbas commented Jan 13, 2023

Temporary fix to avoid breaking since this update...

TypeError                                 Traceback (most recent call last)
Cell In[15], line 15
     12 init_smooth(field=u.data[0], dx=grid.spacing[0], dy=grid.spacing[1])
     13 init_smooth(field=u.data[1], dx=grid.spacing[0], dy=grid.spacing[1])
---> 15 plot_field(u.data[0])

File ~/Desktop/Work/devito/examples/cfd/tools.py:38, in plot_field(field, xmin, xmax, ymin, ymax, zmin, zmax, view, linewidth)
     36 y_coord = np.linspace(ymin, ymax, field.shape[1])
     37 fig = pyplot.figure(figsize=(11, 7), dpi=100)
---> 38 ax = fig.gca(projection='3d')
     39 X, Y = np.meshgrid(x_coord, y_coord, indexing='ij')
     40 ax.plot_surface(X, Y, field[:], cmap=cm.viridis, rstride=1, cstride=1,
     41                 linewidth=linewidth, antialiased=False)

TypeError: FigureBase.gca() got an unexpected keyword argument 'projection'

@mloubout
Copy link
Contributor

What is breaking? So that we know if someone comes up with the same issue.

@codecov
Copy link

codecov bot commented Jan 13, 2023

Codecov Report

Merging #2047 (1e4d200) into master (bcc6b4b) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #2047   +/-   ##
=======================================
  Coverage   87.73%   87.73%           
=======================================
  Files         221      221           
  Lines       39135    39135           
  Branches     5094     5094           
=======================================
  Hits        34334    34334           
  Misses       4238     4238           
  Partials      563      563           

@georgebisbas
Copy link
Contributor Author

What is breaking? So that we know if someone comes up with the same issue.

updated, it is a plotting issue, as used in a few notebooks

@mloubout mloubout added the dependencies Pull requests that update a dependency file label Jan 17, 2023
@FabioLuporini
Copy link
Contributor

why is it breaking?

@georgebisbas
Copy link
Contributor Author

georgebisbas commented Jan 23, 2023

So, current CI, does not update matplotlib.
But users who will install latest matplotlib (3.6.3, rolling from 11th of January) will experience this end-of-life deprecation coming from every tutorial that uses plot_field

https://forum.devtalk.com/t/programming-machine-learning-some-plot-files-are-throwing-error/83609

This:
https://matplotlib.org/3.6.3/api/prev_api_changes/api_changes_3.4.0.html#deprecations

@georgebisbas georgebisbas changed the title reqs: restrict matplotlib <3.6.3 [RFC] reqs: restrict matplotlib <3.6.3 Jan 23, 2023
@@ -86,7 +86,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -e .
pip install matplotlib blosc
pip install --upgrade matplotlib blosc
Copy link
Contributor

Choose a reason for hiding this comment

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

this should just be pip install -e .[extras]

@georgebisbas georgebisbas changed the title [RFC] reqs: restrict matplotlib <3.6.3 reqs: restrict matplotlib <3.6.3 Feb 21, 2023
@georgebisbas georgebisbas changed the title reqs: restrict matplotlib <3.6.3 reqs: Fix for matplotlib >=3.6.3 Mar 8, 2023
Copy link
Contributor

@FabioLuporini FabioLuporini left a comment

Choose a reason for hiding this comment

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

Restricting matplotlib doesn't sound like a good idea

Another story the fact that matplotlib shouldn't even be a strict dependency

@georgebisbas georgebisbas force-pushed the restrict_matplotlib branch 2 times, most recently from 40ed9a9 to c343b59 Compare March 24, 2023 17:57
@mloubout
Copy link
Contributor

mloubout commented Apr 3, 2023

Does it work with earlier versions as well?

@georgebisbas georgebisbas force-pushed the restrict_matplotlib branch from e43806b to 1e4d200 Compare May 2, 2023 15:23
@FabioLuporini FabioLuporini merged commit 5ed93c1 into master May 4, 2023
@FabioLuporini FabioLuporini deleted the restrict_matplotlib branch May 4, 2023 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants