File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
1313LinearAlgebra = " 37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1414Logging = " 56ddb016-857b-54e1-b83d-db4d58db5568"
1515Pkg = " 44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
16+ PythonCall = " 6099a3de-0909-46bc-b1f4-468b9a2dfc0d"
1617Random = " 9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1718Serialization = " 9e88b42a-f829-5b0c-bbe9-9e923198166b"
1819StaticArrays = " 90137ffa-7385-5640-81b9-e52037218182"
@@ -35,6 +36,7 @@ Documenter = "1.8"
3536Interpolations = " 0.15, 0.16"
3637LinearAlgebra = " 1"
3738Logging = " 1"
39+ PythonCall = " 0.9"
3840Random = " 1.10.0"
3941Serialization = " 1"
4042StaticArrays = " 1"
Original file line number Diff line number Diff line change 1616backend = if " plot-controlplots" in ARGS
1717 using ControlPlots
1818 import ControlPlots: plt
19+ using PythonCall: pyconvert
1920 " ControlPlots"
2021else
2122 using CairoMakie
@@ -293,15 +294,19 @@ end
293294
294295 # CP-specific tests (DPI, matplotlib internals)
295296 if backend == " ControlPlots"
297+ # `get_dpi()` returns a Python float; convert to a Julia Float64 so the
298+ # comparisons below evaluate to a Julia `Bool` rather than a `Py` object.
299+ get_dpi (fig) = pyconvert (Float64, fig. get_dpi ())
300+
296301 fig_dpi = plt. figure ()
297- default_dpi = fig_dpi . get_dpi ()
302+ default_dpi = get_dpi (fig_dpi )
298303 @test default_dpi != 173
299304
300305 show_plot (fig_dpi; dpi= 173 )
301- @test fig_dpi . get_dpi () == 173
306+ @test get_dpi (fig_dpi ) == 173
302307
303308 show_plot (fig_dpi)
304- @test fig_dpi . get_dpi () == 130
309+ @test get_dpi (fig_dpi ) == 130
305310 plt. close (fig_dpi)
306311 end
307312
You can’t perform that action at this time.
0 commit comments