Skip to content

Python Stdlib Parity#4

Merged
nshlapo merged 10 commits intomasterfrom
ns/stdlib-python-parity
May 21, 2021
Merged

Python Stdlib Parity#4
nshlapo merged 10 commits intomasterfrom
ns/stdlib-python-parity

Conversation

@nshlapo
Copy link
Copy Markdown
Contributor

@nshlapo nshlapo commented May 20, 2021

  • Bringing the Python standard library to parity with the TypeScript library.
  • Adding tests for all new Python functions
  • Small improvements in code clarity for TypeScript library.
  • Larger rework of the TypeScript neighbors/neighborsInRadius function to use distance functions from spatial/

@nshlapo nshlapo requested review from eadanfahey and ghabs May 20, 2021 19:56
@nshlapo nshlapo changed the title Ns/stdlib python parity Python Stdlib Parity May 20, 2021
Comment thread packages/engine/stdlib/src/py/hstd/init.py
Comment thread packages/engine/stdlib/src/py/hstd/neighbor.py Outdated
Comment thread packages/engine/stdlib/src/py/hstd/neighbor.py Outdated
Comment thread packages/engine/stdlib/src/py/hstd/neighbor.py Outdated
Comment thread packages/engine/stdlib/src/py/hstd/neighbor.py Outdated
Comment thread packages/engine/stdlib/src/py/hstd/test_init.py Outdated
Comment thread packages/engine/stdlib/src/py/hstd/test_init.py Outdated
Comment thread packages/engine/stdlib/src/py/hstd/init.py
Comment thread packages/engine/stdlib/src/py/hstd/neighbor.py Outdated
Comment thread packages/engine/stdlib/src/py/hstd/neighbor.py
Copy link
Copy Markdown
Contributor

@ghabs ghabs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works for me, thanks! LGTM though Eadan's suggestions seem worth implementing.

Comment thread packages/engine/stdlib/src/py/hstd/init.py Outdated
Comment thread packages/engine/stdlib/src/py/hstd/rand.py
@eadanfahey
Copy link
Copy Markdown
Contributor

@nshlapo I left some comments saying that agent["position"] accesses would return an AttributeError. This isn't correct and they're fine as they are. I marked those comments as resolved.

@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented May 21, 2021

This pull request introduces 2 alerts when merging 71f3c68 into eed7ea1 - view on LGTM.com

new alerts:

  • 1 for Unused import
  • 1 for Unused exception object

Comment thread packages/engine/stdlib/src/py/hstd/neighbor.py Outdated
Comment thread packages/engine/stdlib/src/py/hstd/neighbor.py Outdated
@nshlapo nshlapo merged commit bf3dc04 into master May 21, 2021
@nshlapo nshlapo deleted the ns/stdlib-python-parity branch May 21, 2021 15:03
kachkaev pushed a commit that referenced this pull request Jan 17, 2022
kube added a commit that referenced this pull request Apr 14, 2026
… reviews

Decompose the monolithic chart effect into 4 single-responsibility effects:
- Effect 1: create/destroy uPlot on structural changes only
- Effect 2: sync container size via useElementSize hook
- Effect 3: stream data with setData(data, false)
- Effect 4: playhead redraw

Derived state replaces imperative plumbing:
- useElementSize(ref) replaces getBoundingClientRect + inline ResizeObserver
- useStableCallback(onScrub) keeps a stable identity, fixing chart
  recreation on every streaming update (AI review #1)
- Extract attachRulerScrubbing() helper with cached overRect

AI review fixes:
- #1 onScrub instability causing chart recreation — useStableCallback
- #2 missing placeMeta in streaming effect deps
- #3 fill color hex assumption — use color-mix(in srgb) instead
- #4 y-scale [0,0] when all values zero — Math.max(1, max * 1.05)
- #7 playhead line offset not dpr-scaled — tipY - 4 * dpr

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants