Skip to content

Fixes for Python particle API - #252

Open
tychedelia wants to merge 1 commit into
vector-map-broadcastfrom
python-particle-api
Open

tychedelia wants to merge 1 commit into
vector-map-broadcastfrom
python-particle-api

Conversation

@tychedelia

@tychedelia tychedelia commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Makes the Python particle API read more like numpy and match Processing.

  • Positional operands. p.apply(COMBINE, "velocity", "force", op="add"), like np.add(a, b, out=...). out= and options stay keywords. The old a=/b= keywords now error.
  • Attributes are created on first write. No more declaring custom attributes up front. GENERATE has nothing to infer a size from, so it needs components=.
  • create_particles(1000) / create_particles(shape), matching Java's createParticles(int) / createParticles(PShape). attributes= is still there if you want to pre-declare.
  p = create_particles(1000)
  p.apply(REDUCE, "velocity", out="speed", op=LENGTH)
  p.apply(COMBINE, "velocity", "speed", op=MUL)

All the examples are updated to the new forms.

@tychedelia
tychedelia added this pull request to stack #256 September 29, 2026 04:50
@tychedelia
tychedelia removed this pull request from stack #256 September 29, 2026 05:06
@tychedelia
tychedelia added this pull request to stack #258 September 29, 2026 05:06
@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Visual regression: no changes across 43 cases

baseline f4e69a80d4 · adapter llvmpipe (LLVM 20.1.2, 256 bits) (Vulkan, Mesa 25.2.8-0ubuntu0.24.04.2 (LLVM 20.1.2))

Open the visual report · workflow run

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant