Selected changesmerged Nov 24, 2026
fix: Apply Plotly relayouts and restyles sent before renderTypeScript · 173 + / 8 −
Introduces 3 new declarations in panel/models/plotly.ts.
Adds new framework internals rather than adjusting what was there. Tests changed with it, with code of their own.
panel/models/plotly.ts ↗ · 3 files
@@ -79,6 +79,99 @@ const decodeUndefined = (obj: any): any => { return obj } +type PlotlyUpdate = {[key: string]: unknown}++/**+ * A relayout, or a restyle of a single trace, sent before the plot rendered.+ * Applied in order once plotted, they leave the plot as it would be had they+ * been applied as they arrived.+ */+type PendingUpdate = {kind: "relayout", data: PlotlyUpdate} | {kind: "restyle", trace: number, data: PlotlyUpdate}++const is_descendant = (key: string, of: string): boolean => {+ return key.startsWith(`${of}.`) || key.startsWith(`${of}[`)+}++const parent_path = (key: string): string => {+ const index = Math.max(key.lastIndexOf("."), key.lastIndexOf("["))+ return index < 0 ? "" : key.slice(0, index)+}++/**+ * The array an item-level key such as `annotations[0]` writes to. Plotly+ * treats such a write as an insert (or, with null, a removal) that shifts+ * the items after it, so it is never superseded and orders later writes.+ */+const item_array = (key: string): string | null => {+ return key.endsWith("]") ? key.slice(0, key.lastIndexOf("[")) : null+}++const within = (key: string, path: string): boolean => key == path || is_descendant(key, path)++/**
make `ReturnsVisitor` more accurate Rust · 56 + / 27 −
Introduces 3 new declarations in compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs.
Adds new language design rather than adjusting what was there. Tests changed with it, with code of their own.
compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs ↗ · 3 files
@@ -6915,51 +6915,80 @@ impl<'v> Visitor<'v> for SelfVisitor<'v> { #[derive(Default)] pub struct ReturnsVisitor<'v> { pub returns: Vec<&'v hir::Expr<'v>>,- in_block_tail: bool,+ /// The set of items in tail position that can be targeted with a break (loops and blocks).+ /// A break to such an item is a return.+ break_targets_in_tail_position: FxHashSet<HirId>, } impl<'v> Visitor<'v> for ReturnsVisitor<'v> { fn visit_expr(&mut self, ex: &'v hir::Expr<'v>) {- // Visit every expression to detect `return` paths, either through the function's tail- // expression or `return` statements. We walk all nodes to find `return` statements, but- // we only care about tail expressions when `in_block_tail` is `true`, which means that- // they're in the return path of the function body. match ex.kind {- hir::ExprKind::Ret(Some(ex)) => {- self.returns.push(ex);+ hir::ExprKind::Ret(Some(val)) => self.returns.push(val),+ hir::ExprKind::Break(dest, Some(val)) if let Ok(id) = dest.target_id => {+ // If this is a break to a block/loop in tail position, this is a return.+ if self.break_targets_in_tail_position.contains(&id) {+ self.returns.push(val)+ }+ }+ hir::ExprKind::Become(_) => {+ // A become is like a return, but for diagnostics it is not useful to treat it as+ // one. Often suggestions will break the tail call. }- hir::ExprKind::Block(block, _) if self.in_block_tail => {- self.in_block_tail = false;+ _ => {}+ }
TST: fix incorrect memory growth testPython · 23 + / 12 −
Introduces 4 new declarations in numpy/testing/_private/utils.py.
Adds new core implementation rather than adjusting what was there. Tests changed with it, with code of their own.
numpy/testing/_private/utils.py ↗ · 3 files
@@ -3079,30 +3079,41 @@ def growth(): tracemalloc.stop() -def assert_memory_growth_below(func, limit, repeat=10):+def assert_memory_growth_below(func, limit, repeat=10, make_args=None): """Fail if more than ``limit`` bytes are still allocated after calling ``func()`` ``repeat`` times. ``func`` is called once before the measurement starts. It runs in a- new subprocess, so it must be a module-level function.+ new subprocess, so it must be a module-level function. If ``make_args``+ is given, it must be a module-level function too. It is called once in+ the subprocess before the measurement starts and returns a tuple of+ arguments that is passed to every call of ``func``. """ import pytest # not available on PyPy pytest.importorskip("tracemalloc")- location = (func.__module__,- getattr(sys.modules[func.__module__], "__file__", None),- func.__qualname__)+ locations = [+ None if f is None else (+ f.__module__,+ getattr(sys.modules[f.__module__], "__file__", None),+ f.__qualname__)+ for f in (func, make_args)] run_function_with_args_in_subprocess(- _assert_memory_growth_below, location, limit, repeat)+ _assert_memory_growth_below, *locations, limit, repeat)
[Ledgers] Decode Ledger totals on the clientJavaScript · 505 + / 23 −
Introduces 20 new declarations in packages/react-client/src/ReactFlightClient.js.
Adds new language design rather than adjusting what was there. Tests changed with it, with code of their own.
packages/react-client/src/ReactFlightClient.js ↗ · 18 files
@@ -4040,6 +4098,199 @@ function resolveHint<Code: HintCode>( dispatchHint(code, hintModel); } +// Ledger rows form a graph alongside the model. We can decode them without+// initializing model chunks, preserving the laziness of the main response.+// Once the stream closes, each total is computed from this graph on demand.++// The shared record plus the chunk the total resolves through.+type LedgerTotalRecord = {+ chunk: SomeChunk<mixed>,+ type: Ledger<empty>,+ roots: Array<UnitRecord>,+ graph: LedgerGraph,+};++type ResponseLedgers = {+ totals: Map<number, LedgerTotalRecord>,+ types: Map<number, Ledger<empty>>,+ units: Map<number, UnitRecord>,+};++function getResponseLedgers(response: Response): ResponseLedgers {+ let ledgers = response._ledgers;+ if (ledgers === null) {+ response._ledgers = ledgers = {+ totals: new Map(),+ types: new Map(),+ units: new Map(),+ };+ }+ return ledgers;+}+
[TTS] Add Python 3 type hints and module docstring to helpers.pyPython · 85 + / 55 −
Introduces 22 new declarations in nemo/collections/tts/parts/utils/helpers.py.
Adds new language design rather than adjusting what was there. Read the linked PR for the surrounding test context.
nemo/collections/tts/parts/utils/helpers.py ↗ · 1 files
@@ -281,17 +293,17 @@ def griffin_lim(magnitudes, n_iters=50, n_fft=1024): @rank_zero_only def log_audio_to_tb(- swriter,- spect,- name,- step,- griffin_lim_mag_scale=1024,- griffin_lim_power=1.2,- sr=22050,- n_fft=1024,- n_mels=80,- fmax=8000,-):+ swriter: Any,+ spect: torch.Tensor,+ name: str,+ step: int,+ griffin_lim_mag_scale: int = 1024,+ griffin_lim_power: float = 1.2,+ sr: int = 22050,+ n_fft: int = 1024,+ n_mels: int = 80,+ fmax: int = 8000,+) -> None: filterbank = librosa.filters.mel(sr=sr, n_fft=n_fft, n_mels=n_mels, fmax=fmax) log_mel = spect.data.cpu().numpy().T mel = np.exp(log_mel)