Skip to content

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

Open
vcnainala wants to merge 2 commits into
developmentfrom
fix/spectra-info-array-to-string
Open

fix(nmr): handle nested arrays when extracting spectra metadata#1530
vcnainala wants to merge 2 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.32%. Comparing base (7480827) to head (222c902).

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.34%   80.32%   -0.03%     
- Complexity          4416     4437      +21     
=================================================
  Files                289      289              
  Lines              16241    16284      +43     
=================================================
+ Hits               13049    13080      +31     
- Misses              3192     3204      +12     
Flag Coverage Δ
unittests 80.32% <75.92%> (-0.03%) ⬇️

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.

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