Skip to content

Add more NPY002 violations#9862

Merged
charliermarsh merged 1 commit into
astral-sh:mainfrom
jack-mcivor:add-more-npy002-violations
Feb 7, 2024
Merged

Add more NPY002 violations#9862
charliermarsh merged 1 commit into
astral-sh:mainfrom
jack-mcivor:add-more-npy002-violations

Conversation

@jack-mcivor
Copy link
Copy Markdown
Contributor

Fixes #9861

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 6, 2024

ruff-ecosystem results

Linter (stable)

ℹ️ ecosystem check detected linter changes. (+63 -0 violations, +0 -0 fixes in 1 projects; 42 projects unchanged)

bokeh/bokeh (+63 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --no-preview --select ALL

+ docs/bokeh/source/docs/first_steps/examples/first_steps_5_vectorize_color_and_size.py:7:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ docs/bokeh/source/docs/first_steps/examples/first_steps_5_vectorize_color_and_size.py:8:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/advanced/integration/d3-voronoi.py:10:6: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/advanced/integration/d3-voronoi.py:11:6: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/basic/annotations/band.py:18:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/basic/axes/bounds.py:11:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/basic/axes/bounds.py:12:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/basic/axes/bounds.py:13:9: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/basic/data/ajax_source.py:47:22: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/basic/data/ajax_source.py:53:28: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/basic/data/color_mappers.py:17:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/basic/data/server_sent_events_source.py:56:35: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/basic/scatters/color_scatter.py:15:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/basic/scatters/color_scatter.py:16:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/basic/scatters/color_scatter.py:17:9: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/basic/scatters/image_url.py:16:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/basic/scatters/image_url.py:17:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/basic/scatters/markers.py:26:15: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/basic/scatters/markers.py:26:30: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/interaction/js_callbacks/customjs_for_range_update.py:10:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/interaction/js_callbacks/customjs_for_range_update.py:11:9: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/interaction/js_callbacks/customjs_for_range_update.py:9:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/interaction/js_callbacks/js_on_event.py:41:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/interaction/js_callbacks/js_on_event.py:42:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/interaction/js_callbacks/js_on_event.py:43:9: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/interaction/tools/persistent_selections.py:7:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/interaction/tools/persistent_selections.py:8:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/interaction/tools/persistent_selections.py:9:9: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/interaction/tools/tap_inspect_keymod.py:8:9: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/interaction/tools/tool_overlays.py:6:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/interaction/tools/tool_overlays.py:7:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/models/toolbars.py:16:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/models/toolbars.py:17:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/models/toolbars.py:18:9: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/models/toolbars2.py:15:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/models/toolbars2.py:16:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/models/toolbars2.py:17:9: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/models/transform_jitter.py:17:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/output/apis/autoload_static_flask.py:14:9: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/output/apis/autoload_static_flask.py:15:9: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/output/apis/autoload_static_flask.py:16:13: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/output/apis/server_session/bokeh_app.py:7:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/output/apis/server_session/bokeh_app.py:8:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/output/apis/server_session/bokeh_app.py:9:9: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/output/jupyter/ipywidgets/ipyvolume_camera.py:10:11: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/output/jupyter/ipywidgets/ipyvolume_camera.py:19:15: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/output/webgl/marker_compare.py:16:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/output/webgl/marker_compare.py:17:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/plotting/dynamic_color_mapping.py:13:9: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/plotting/dynamic_color_mapping.py:14:9: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
... 13 additional changes omitted for project

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
NPY002 63 63 0 0 0

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+63 -0 violations, +0 -0 fixes in 1 projects; 42 projects unchanged)

bokeh/bokeh (+63 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL

+ docs/bokeh/source/docs/first_steps/examples/first_steps_5_vectorize_color_and_size.py:7:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ docs/bokeh/source/docs/first_steps/examples/first_steps_5_vectorize_color_and_size.py:8:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/advanced/integration/d3-voronoi.py:10:6: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/advanced/integration/d3-voronoi.py:11:6: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/basic/annotations/band.py:18:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/basic/axes/bounds.py:11:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/basic/axes/bounds.py:12:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/basic/axes/bounds.py:13:9: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/basic/data/ajax_source.py:47:22: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/basic/data/ajax_source.py:53:28: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/basic/data/color_mappers.py:17:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/basic/data/server_sent_events_source.py:56:35: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/basic/scatters/color_scatter.py:15:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/basic/scatters/color_scatter.py:16:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/basic/scatters/color_scatter.py:17:9: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/basic/scatters/image_url.py:16:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/basic/scatters/image_url.py:17:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/basic/scatters/markers.py:26:15: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/basic/scatters/markers.py:26:30: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/interaction/js_callbacks/customjs_for_range_update.py:10:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/interaction/js_callbacks/customjs_for_range_update.py:11:9: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/interaction/js_callbacks/customjs_for_range_update.py:9:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/interaction/js_callbacks/js_on_event.py:41:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/interaction/js_callbacks/js_on_event.py:42:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/interaction/js_callbacks/js_on_event.py:43:9: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/interaction/tools/persistent_selections.py:7:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/interaction/tools/persistent_selections.py:8:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/interaction/tools/persistent_selections.py:9:9: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/interaction/tools/tap_inspect_keymod.py:8:9: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/interaction/tools/tool_overlays.py:6:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/interaction/tools/tool_overlays.py:7:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/models/toolbars.py:16:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/models/toolbars.py:17:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/models/toolbars.py:18:9: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/models/toolbars2.py:15:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/models/toolbars2.py:16:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/models/toolbars2.py:17:9: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/models/transform_jitter.py:17:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/output/apis/autoload_static_flask.py:14:9: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/output/apis/autoload_static_flask.py:15:9: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/output/apis/autoload_static_flask.py:16:13: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/output/apis/server_session/bokeh_app.py:7:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/output/apis/server_session/bokeh_app.py:8:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/output/apis/server_session/bokeh_app.py:9:9: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/output/jupyter/ipywidgets/ipyvolume_camera.py:10:11: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/output/jupyter/ipywidgets/ipyvolume_camera.py:19:15: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/output/webgl/marker_compare.py:16:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/output/webgl/marker_compare.py:17:5: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/plotting/dynamic_color_mapping.py:13:9: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
+ examples/plotting/dynamic_color_mapping.py:14:9: NPY002 Replace legacy `np.random.random` call with `np.random.Generator`
... 13 additional changes omitted for project

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
NPY002 63 63 0 0 0

@charliermarsh charliermarsh self-requested a review February 7, 2024 14:51
@charliermarsh charliermarsh added the rule Implementing or modifying a lint rule label Feb 7, 2024
@charliermarsh charliermarsh merged commit aa38307 into astral-sh:main Feb 7, 2024
nkxxll pushed a commit to nkxxll/ruff that referenced this pull request Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NPY002 legacy np.random.{method_name} call not triggering on np.random.random()

2 participants