Skip to content

Fix/user reported issues -> 2.6.2#23

Open
I194 wants to merge 14 commits intodevfrom
fix/user-reported-issues
Open

Fix/user reported issues -> 2.6.2#23
I194 wants to merge 14 commits intodevfrom
fix/user-reported-issues

Conversation

@I194
Copy link
Copy Markdown
Owner

@I194 I194 commented Mar 28, 2026

Summary

A batch of bug fixes addressing issues reported by users, focused on data parsing robustness, display correctness, and editor usability.

Bug fixes

  • PCA MAD calculation: replaced || 0 fallback with an isFinite guard — fixes MAD incorrectly showing 0.0 for highly collinear data
  • Magnetization graph x-axis: read demagType from the first non-NRM step instead of steps[0], fixing "mT" shown instead of "°C" for thermal demagnetization
  • Magnetization graph empty data: guarded against -Infinity display when dataset is empty
  • Metadata editor float artifacts: switched to string-based state to prevent IEEE 754 issues (e.g. 22.599999999999994 instead of 22.6)
  • Metadata editor NaN: fixed field getting stuck when typing a decimal separator (. or ,) as the first character
  • Interpretation labels: stripped file extension from component names (e.g. 300b instead of 300b.pmd)
  • SQUID parser: files with a header but no measurement data are now rejected with a clear error instead of crashing
  • File import errors: error reason is now included in the skipped-file alert message

Chore

  • Version bump to 2.6.2 with changelog entry
  • Added .claude/issues/ to .gitignore

I194 added 10 commits March 29, 2026 08:43
NRM step always has undefined demagType, causing the magnetization graph
to show "mT" instead of "°C" for thermal demagnetization data.
…nd NaN

Display values using toPrecision(12) to eliminate IEEE 754 artifacts
(e.g., 38.599999999999994 → 38.6). Keep raw string in state during
editing so intermediate values like "." or "," don't produce NaN.
Parse to number only on apply, with comma-to-dot replacement for
Russian locale support.
Labels like "406c.squid" now become "406c". The parentFile field
retains the full filename with extension for traceability.
Users now see why a file was skipped (e.g., "no data lines"), not just
the filename.
The || 0 fallback used JavaScript falsy coercion which masks NaN as
zero without distinction. isFinite() explicitly catches NaN and
Infinity while preserving legitimate zero values.
Files with only a header line were silently accepted with 0 steps,
bypassing the alert mechanism. Now throws before returning empty steps.
Math.max() on empty array returns -Infinity, displayed as
"Mmax = -INFINITY A/m". Now defaults to 0 when no steps are present.
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pmtools Ready Ready Preview, Comment Apr 2, 2026 1:01am

Off-by-one indexing in sortEigenvectors() used [1,2,3] instead of
[0,1,2] to find the middle eigenvalue index. When numeric.eig returned
eigenvalues with the middle one at index 0, the filter produced index 3
(out of bounds) → undefined → NaN → MAD=0 via isFinite guard.

Also removed no-op vectors.push(...vectors) in PCA0 path — TMatrix
normalizes by array length, so doubling had no mathematical effect.
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