Skip to content

fix(nmr): handle nested arrays when extracting spectra metadata - #1530

Merged
NishaSharma14 merged 3 commits into
developmentfrom
fix/spectra-info-array-to-string
Sep 1, 2026
Merged

fix(nmr): handle nested arrays when extracting spectra metadata#1530
NishaSharma14 merged 3 commits into
developmentfrom
fix/spectra-info-array-to-string

Conversation

@vcnainala

Copy link
Copy Markdown
Member

Summary

  • Stop nmrxiv:extract-dataset-spectra-info from failing with Array to string conversion on NMRium payloads that store 2D frequencies, filters, meta, or probe fields as arrays.
  • Flatten nested scalars for search text and take the first usable value for dedicated columns (nucleus, frequency, probe name, etc.).
  • Cover the nested-array case in DatasetSpectraInfoExtractorTest.

Test plan

  • php artisan test tests/Unit/Support/DatasetSpectraInfoExtractorTest.php
  • Re-run php artisan nmrxiv:extract-dataset-spectra-info and confirm previously failing dataset IDs extract without errors
  • Rebuild stats with php artisan nmrxiv:index-spectra-metadata-stats

NMRium info for 2D spectra often stores frequencies, filters, and probe
fields as arrays, which caused Array to string conversion during bulk extract.
@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.92593% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.26%. Comparing base (284af39) to head (451569b).
⚠️ Report is 1 commits behind head on development.

Files with missing lines Patch % Lines
app/Support/Nmr/DatasetSpectraInfoExtractor.php 75.92% 13 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                @@
##             development    #1530      +/-   ##
=================================================
- Coverage          80.26%   80.26%   -0.01%     
- Complexity          4460     4481      +21     
=================================================
  Files                293      293              
  Lines              16381    16424      +43     
=================================================
+ Hits               13149    13182      +33     
- Misses              3232     3242      +10     
Flag Coverage Δ
unittests 80.26% <75.92%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@NishaSharma14
NishaSharma14 merged commit 877798c into development Sep 1, 2026
5 checks passed
@NishaSharma14
NishaSharma14 deleted the fix/spectra-info-array-to-string branch September 1, 2026 12:59
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.

2 participants