Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ repos:
- id: mixed-line-ending

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.14.10'
rev: 'v0.15.12'
hooks:
- id: ruff
args: ['--fix']

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 25.12.0
rev: 26.3.1
hooks:
- id: black

Expand Down
18 changes: 6 additions & 12 deletions carbonplan_benchmarks/playwright/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,9 @@ async def run(
await variable_dropdown.select_option(variable)

await asyncio.gather(
page.evaluate(
"""
page.evaluate("""
() => (window.performance.mark("benchmark-initial-load:start"))
"""
),
"""),
page.focus('.mapboxgl-canvas'),
page.click('.mapboxgl-canvas'),
)
Expand All @@ -133,21 +131,17 @@ async def run(
label = f'benchmark-{action}-level-{level}'
if action == 'zoom_in':
await asyncio.gather(
page.evaluate(
f"""
page.evaluate(f"""
() => (window.performance.mark("{start_mark}"))
"""
),
"""),
page.keyboard.press('='),
)

elif action == 'zoom_out':
await asyncio.gather(
page.evaluate(
f"""
page.evaluate(f"""
() => (window.performance.mark("{start_mark}"))
"""
),
"""),
page.keyboard.press('-'),
)

Expand Down
6 changes: 2 additions & 4 deletions carbonplan_benchmarks/tests/test_gpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ def test_gpu_hardware_acceleration():
page.goto('https://webglreport.com')

# Now check GPU capabilities using JavaScript
gpu_info = page.evaluate(
"""() => {
gpu_info = page.evaluate("""() => {
const canvas = document.createElement('canvas');
const gl = canvas.getContext('webgl2') || canvas.getContext('webgl');
const debugInfo = gl.getExtension('WEBGL_debug_renderer_info');
Expand All @@ -32,8 +31,7 @@ def test_gpu_hardware_acceleration():
renderer: gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL),
webglVersion: gl.getParameter(gl.VERSION)
}
}"""
)
}""")

print('GPU Info:', gpu_info)

Expand Down
Loading