129 replace psutil - #174
Conversation
There was a problem hiding this comment.
Pull request overview
Removes the psutil dependency by switching test-time CPU thread sizing from psutil.cpu_count(logical=False) to the standard library’s multiprocessing.cpu_count().
Changes:
- Drop
psutilfrom the test dependency set and lockfile. - Update numeric/FFT-related tests to use
multiprocessing.cpu_count()fornum_threads. - Remove
psutilimports across the touched tests.
Reviewed changes
Copilot reviewed 31 out of 32 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Removes the locked psutil package entry and references from test dependency groups. |
| pyproject.toml | Removes psutil from the tests dependency extra/group. |
| tests/test_numeric/test_immersed_boundary_ops/test_virtual_boundary_forcing.py | Replaces psutil.cpu_count(logical=False) with multiprocessing.cpu_count() and drops psutil import. |
| tests/test_numeric/test_eulerian_grid_ops/test_stencil_ops_3d/test_vorticity_stretching_timestep_3d.py | Replaces psutil CPU counting with multiprocessing.cpu_count() and drops psutil import. |
| tests/test_numeric/test_eulerian_grid_ops/test_stencil_ops_3d/test_vorticity_stretching_flux_3d.py | Replaces psutil CPU counting with multiprocessing.cpu_count() and drops psutil import. |
| tests/test_numeric/test_eulerian_grid_ops/test_stencil_ops_3d/test_update_vorticity_from_velocity_forcing_3d.py | Replaces psutil CPU counting with multiprocessing.cpu_count() and drops psutil import. |
| tests/test_numeric/test_eulerian_grid_ops/test_stencil_ops_3d/test_penalise_field_boundary_3d.py | Replaces psutil CPU counting with multiprocessing.cpu_count() and drops psutil import. |
| tests/test_numeric/test_eulerian_grid_ops/test_stencil_ops_3d/test_laplacian_filter_3d.py | Replaces psutil CPU counting with multiprocessing.cpu_count() and drops psutil import. |
| tests/test_numeric/test_eulerian_grid_ops/test_stencil_ops_3d/test_elementwise_ops_3d.py | Replaces psutil CPU counting with multiprocessing.cpu_count() and drops psutil import. |
| tests/test_numeric/test_eulerian_grid_ops/test_stencil_ops_3d/test_divergence_3d.py | Replaces psutil CPU counting with multiprocessing.cpu_count() and drops psutil import. |
| tests/test_numeric/test_eulerian_grid_ops/test_stencil_ops_3d/test_diffusion_timestep_3d.py | Replaces psutil CPU counting with multiprocessing.cpu_count() and drops psutil import. |
| tests/test_numeric/test_eulerian_grid_ops/test_stencil_ops_3d/test_diffusion_flux_3d.py | Replaces psutil CPU counting with multiprocessing.cpu_count() and drops psutil import. |
| tests/test_numeric/test_eulerian_grid_ops/test_stencil_ops_3d/test_curl_3d.py | Replaces psutil CPU counting with multiprocessing.cpu_count() and drops psutil import. |
| tests/test_numeric/test_eulerian_grid_ops/test_stencil_ops_3d/test_char_func_from_level_set_3d.py | Replaces psutil CPU counting with multiprocessing.cpu_count() and drops psutil import. |
| tests/test_numeric/test_eulerian_grid_ops/test_stencil_ops_3d/test_brinkmann_penalise_3d.py | Replaces psutil CPU counting with multiprocessing.cpu_count() and drops psutil import. |
| tests/test_numeric/test_eulerian_grid_ops/test_stencil_ops_3d/test_advection_timestep_3d.py | Replaces psutil CPU counting with multiprocessing.cpu_count() and drops psutil import. |
| tests/test_numeric/test_eulerian_grid_ops/test_stencil_ops_3d/test_advection_flux_3d.py | Replaces psutil CPU counting with multiprocessing.cpu_count() and drops psutil import. |
| tests/test_numeric/test_eulerian_grid_ops/test_stencil_ops_2d/test_update_vorticity_from_velocity_forcing_2d.py | Replaces psutil CPU counting with multiprocessing.cpu_count() and drops psutil import. |
| tests/test_numeric/test_eulerian_grid_ops/test_stencil_ops_2d/test_penalise_field_boundary_2d.py | Replaces psutil CPU counting with multiprocessing.cpu_count() and drops psutil import. |
| tests/test_numeric/test_eulerian_grid_ops/test_stencil_ops_2d/test_outplane_field_curl_2d.py | Replaces psutil CPU counting with multiprocessing.cpu_count() and drops psutil import. |
| tests/test_numeric/test_eulerian_grid_ops/test_stencil_ops_2d/test_inplane_field_curl_2d.py | Replaces psutil CPU counting with multiprocessing.cpu_count() and drops psutil import. |
| tests/test_numeric/test_eulerian_grid_ops/test_stencil_ops_2d/test_elementwise_ops_2d.py | Replaces psutil CPU counting with multiprocessing.cpu_count() and drops psutil import. |
| tests/test_numeric/test_eulerian_grid_ops/test_stencil_ops_2d/test_diffusion_timestep_2d.py | Replaces psutil CPU counting with multiprocessing.cpu_count() and drops psutil import. |
| tests/test_numeric/test_eulerian_grid_ops/test_stencil_ops_2d/test_diffusion_flux_2d.py | Replaces psutil CPU counting with multiprocessing.cpu_count() and drops psutil import. |
| tests/test_numeric/test_eulerian_grid_ops/test_stencil_ops_2d/test_char_func_from_level_set_2d.py | Replaces psutil CPU counting with multiprocessing.cpu_count() and drops psutil import. |
| tests/test_numeric/test_eulerian_grid_ops/test_stencil_ops_2d/test_brinkmann_penalise_2d.py | Replaces psutil CPU counting with multiprocessing.cpu_count() and drops psutil import. |
| tests/test_numeric/test_eulerian_grid_ops/test_stencil_ops_2d/test_advection_timestep_2d.py | Replaces psutil CPU counting with multiprocessing.cpu_count() and drops psutil import. |
| tests/test_numeric/test_eulerian_grid_ops/test_stencil_ops_2d/test_advection_flux_2d.py | Replaces psutil CPU counting with multiprocessing.cpu_count() and drops psutil import. |
| tests/test_numeric/test_eulerian_grid_ops/test_poisson_solver_3d/test_unbounded_poisson_solver_3d.py | Replaces psutil CPU counting with multiprocessing.cpu_count() and drops psutil import. |
| tests/test_numeric/test_eulerian_grid_ops/test_poisson_solver_3d/test_fft_kernel_3d.py | Replaces psutil CPU counting with multiprocessing.cpu_count() and drops psutil import. |
| tests/test_numeric/test_eulerian_grid_ops/test_poisson_solver_2d/test_unbounded_poisson_solver_2d.py | Replaces psutil CPU counting with multiprocessing.cpu_count() and drops psutil import. |
| tests/test_numeric/test_eulerian_grid_ops/test_poisson_solver_2d/test_fft_kernel_2d.py | Replaces psutil CPU counting with multiprocessing.cpu_count() and drops psutil import. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… with fallback of using 1 process
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 32 out of 33 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…' to avoid type problems
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 32 out of 33 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…umber of threads available to the process
Replace
psutil.cpu_count(logical=False)with a pytest fixture which invokesos.cpu_count()and fall back to 1. This allows us to removepsutilfrom the dependency list.One caveat here is that the
logical=Falseflag allowspsutilto return the physical core count, whileos.cpu_countand may include hyperthreads. However, this is not a big issue because most uses case have users prescribe a thread count. Furthermore,psutilis so far only used in test cases. Therefore we can safely make this change.