You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[rdjson] reported by reviewdog 🐶f-string without any placeholdersRaw Output:message:"f-string without any placeholders" location:{path:"/home/runner/work/matplotlib/matplotlib/check_version.py" range:{start:{line:4 column:7} end:{line:4 column:38}}} source:{name:"ruff" url:"https://docs.astral.sh/ruff"} code:{value:"F541" url:"https://docs.astral.sh/ruff/rules/f-string-missing-placeholders"} suggestions:{range:{start:{line:4 column:7} end:{line:4 column:38}} text:"\"--- Python Version Check ---\""}
print(f"Executable: {sys.executable}")
print(f"Version: {sys.version}")
print(f"Current Directory: {os.getcwd()}")
Check failure on line 7 in check_version.py
View workflow job for this annotation
GitHub Actions/ ruff
[rdjson] reported by reviewdog 🐶No newline at end of fileRaw Output:message:"No newline at end of file" location:{path:"/home/runner/work/matplotlib/matplotlib/check_version.py" range:{start:{line:7 column:44} end:{line:7 column:44}}} source:{name:"ruff" url:"https://docs.astral.sh/ruff"} code:{value:"W292" url:"https://docs.astral.sh/ruff/rules/missing-newline-at-end-of-file"} suggestions:{range:{start:{line:7 column:44} end:{line:7 column:44}} text:"\n"}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
import numpy as np # Ensure numpy is imported for np.isclose
Check failure on line 4 in lib/matplotlib/projections/polar.py
View workflow job for this annotation
GitHub Actions/ ruff
[rdjson] reported by reviewdog 🐶Insert at least two spaces before an inline commentRaw Output:message:"Insert at least two spaces before an inline comment" location:{path:"/home/runner/work/matplotlib/matplotlib/lib/matplotlib/projections/polar.py" range:{start:{line:4 column:19} end:{line:4 column:20}}} source:{name:"ruff" url:"https://docs.astral.sh/ruff"} code:{value:"E261" url:"https://docs.astral.sh/ruff/rules/too-few-spaces-before-inline-comment"} suggestions:{range:{start:{line:4 column:19} end:{line:4 column:20}} text:" "}
import numpy as np
Check failure on line 6 in lib/matplotlib/projections/polar.py
View workflow job for this annotation
GitHub Actions/ ruff
[rdjson] reported by reviewdog 🐶Redefinition of unused `np` from line 4Raw Output:message:"Redefinition of unused `np` from line 4" location:{path:"/home/runner/work/matplotlib/matplotlib/lib/matplotlib/projections/polar.py" range:{start:{line:6 column:17} end:{line:6 column:19}}} source:{name:"ruff" url:"https://docs.astral.sh/ruff"} code:{value:"F811" url:"https://docs.astral.sh/ruff/rules/redefined-while-unused"} suggestions:{range:{start:{line:6 column:1} end:{line:7 column:1}}}
import matplotlib as mpl
from matplotlib import _api, cbook
Expand All
@@ -13,9 +15,9 @@
import matplotlib.ticker as mticker
import matplotlib.transforms as mtransforms
from matplotlib.spines import Spine
from matplotlib.ticker import FixedLocator, AutoLocator
class PolarTransform(mtransforms.Transform):
Check failure on line 20 in lib/matplotlib/projections/polar.py
View workflow job for this annotation
GitHub Actions/ ruff
[rdjson] reported by reviewdog 🐶Expected 2 blank lines, found 1Raw Output:message:"Expected 2 blank lines, found 1" location:{path:"/home/runner/work/matplotlib/matplotlib/lib/matplotlib/projections/polar.py" range:{start:{line:20 column:1} end:{line:20 column:6}}} source:{name:"ruff" url:"https://docs.astral.sh/ruff"} code:{value:"E302" url:"https://docs.astral.sh/ruff/rules/blank-lines-top-level"} suggestions:{range:{start:{line:19 column:1} end:{line:20 column:1}} text:"\n\n"}
if np.isclose(yscale, 0): # Use isclose for float comparison
Check failure on line 172 in lib/matplotlib/projections/polar.py
View workflow job for this annotation
GitHub Actions/ ruff
[rdjson] reported by reviewdog 🐶Insert at least two spaces before an inline commentRaw Output:message:"Insert at least two spaces before an inline comment" location:{path:"/home/runner/work/matplotlib/matplotlib/lib/matplotlib/projections/polar.py" range:{start:{line:172 column:38} end:{line:172 column:39}}} source:{name:"ruff" url:"https://docs.astral.sh/ruff"} code:{value:"E261" url:"https://docs.astral.sh/ruff/rules/too-few-spaces-before-inline-comment"} suggestions:{range:{start:{line:172 column:38} end:{line:172 column:39}} text:" "}
# This case might occur if rmin and rmax are identical,
# or if limits somehow make yscale effectively zero.
# Avoid division by zero or extreme scaling.
# Defaulting to 1 is a fallback; ideally, yscale reflects a valid data range.
Check failure on line 176 in lib/matplotlib/projections/polar.py
View workflow job for this annotation
GitHub Actions/ ruff
[rdjson] reported by reviewdog 🐶Line too long (93 > 88)Raw Output:message:"Line too long (93 > 88)" location:{path:"/home/runner/work/matplotlib/matplotlib/lib/matplotlib/projections/polar.py" range:{start:{line:176 column:89} end:{line:176 column:94}}} source:{name:"ruff" url:"https://docs.astral.sh/ruff"} code:{value:"E501" url:"https://docs.astral.sh/ruff/rules/line-too-long"}
yscale = 1
Check warning on line 177 in lib/matplotlib/projections/polar.py
View check run for this annotation
Codecov/ codecov/patch
lib/matplotlib/projections/polar.py#L177
Added line #L177 was not covered by tests
affine = mtransforms.Affine2D() \
.scale(0.5 / yscale) \
.translate(0.5, 0.5)
Expand DownExpand Up
@@ -818,6 +826,12 @@
self.yaxis = RadialAxis(self, clear=False)
self.spines['polar'].register_axis(self.yaxis)
# PATCH START
locator = self.xaxis.get_major_locator()
if isinstance(locator, FixedLocator) and len(locator.locs) == 0:
self.xaxis.set_major_locator(AutoLocator())
Check warning on line 832 in lib/matplotlib/projections/polar.py
View check run for this annotation
Codecov/ codecov/patch
lib/matplotlib/projections/polar.py#L832
Added line #L832 was not covered by tests
# PATCH END
def _set_lim_and_transforms(self):
# A view limit where the minimum radius can be locked if the user
# specifies an alternate origin.
Expand DownExpand Up
@@ -1250,8 +1264,36 @@
def set_rscale(self, *args, **kwargs):
return Axes.set_yscale(self, *args, **kwargs)
# Override set_yticks to ensure our specialized rticks logic is called
# The first arg is 'ticks'. If called from set_yticks, this is correct.
# If called as ax.set_rticks(radii_list), args[0] is radii_list.
# We need to pass all args and kwargs to Axes.set_yticks.
# The actual setting of yticks (which triggers autoscale) happens here:
result = Axes.set_yticks(self, *args, **kwargs)
# If autoscaling (due to clearing ticks) resulted in rmin > intended origin, clamp rmin.
Check failure on line 1280 in lib/matplotlib/projections/polar.py
View workflow job for this annotation
GitHub Actions/ ruff
[rdjson] reported by reviewdog 🐶Line too long (96 > 88)Raw Output:message:"Line too long (96 > 88)" location:{path:"/home/runner/work/matplotlib/matplotlib/lib/matplotlib/projections/polar.py" range:{start:{line:1280 column:89} end:{line:1280 column:97}}} source:{name:"ruff" url:"https://docs.astral.sh/ruff"} code:{value:"E501" url:"https://docs.astral.sh/ruff/rules/line-too-long"}
# The intended r_origin is 0, unless explicitly set by user via set_rorigin().
# self._originViewLim.locked_y0 stores the value from set_rorigin().
intended_rorigin = self._originViewLim.locked_y0
if intended_rorigin is None:
intended_rorigin = 0.0 # Default r-origin for polar plots
if self.viewLim.y0 > intended_rorigin and not self.yaxis_inverted():
self.viewLim.y0 = intended_rorigin
elif self.viewLim.y1 < intended_rorigin and self.yaxis_inverted():
# Handle inverted r-axis case
self.viewLim.y1 = intended_rorigin
Check warning on line 1291 in lib/matplotlib/projections/polar.py
View check run for this annotation
Codecov/ codecov/patch
lib/matplotlib/projections/polar.py#L1291
Added line #L1291 was not covered by tests
# Ensure _originViewLim (which is a LockableBbox(viewLim)) is also updated if not locked.
# This should happen automatically if locked_y0 is None.
# If locked_y0 is not None, viewLim.y0 should already match intended_rorigin due to LockableBbox behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Check warning on line 172 in lib/matplotlib/projections/polar.pyi
View workflow job for this annotation
GitHub Actions/ mypy
[mypy] reported by reviewdog 🐶 Superclass:Raw Output:lib/matplotlib/projections/polar.pyi:172: note: Superclass:
Check failure on line 172 in lib/matplotlib/projections/polar.pyi
View workflow job for this annotation
GitHub Actions/ mypy
[mypy] reported by reviewdog 🐶Signature of "set_yticks" incompatible with supertype "_AxesBase" [override]Raw Output:lib/matplotlib/projections/polar.pyi:172: error: Signature of "set_yticks" incompatible with supertype "_AxesBase" [override]
The reason will be displayed to describe this comment to others.Learn more.
Sorry I did not follow the mypy syntax here for the python function it would be def set_yticks( self, ticks: Sequence[float], labels: Sequence[str] | None = ..., *, minor: bool = ... ) -> list[float]: ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.