Skip to content

Add support for JCAMP-DX files in NMR block #1205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 21, 2025
Merged

Conversation

ml-evs
Copy link
Member

@ml-evs ml-evs commented May 20, 2025

This PR enables JCAMP-DX (.jdx, .dx) files to be read by the NMR block. It also updates the documentation for the NMR block slightly, and refactors the block into combined functions for loading either Bruker/JCAMP data.

Related to #610 -- we could easily add support for NMR given nmrglue's existing functionality for JCAMP-DX, but a general JCAMP block might be too complicated.

@ml-evs ml-evs requested a review from jdbocarsly as a code owner May 20, 2025 13:04
@ml-evs ml-evs added the enhancement New feature or request label May 20, 2025
@ml-evs ml-evs requested a review from BenjaminCharmes as a code owner May 20, 2025 13:04
@ml-evs ml-evs added the datablock An issue pertaining to a specific datablock label May 20, 2025
@ml-evs ml-evs force-pushed the ml-evs/add-nmr-jcamp-support branch 2 times, most recently from 83f29b0 to 1ff5913 Compare May 20, 2025 13:11
Copy link

cypress bot commented May 20, 2025

datalab    Run #3378

Run Properties:  status check passed Passed #3378  •  git commit 8834263a1d ℹ️: Merge 2eca7f3e104698090ad5f5dc12fa480b8fc57374 into 65140ccd2a9dba334fae9a6deb5b...
Project datalab
Branch Review ml-evs/add-nmr-jcamp-support
Run status status check passed Passed #3378
Run duration 07m 30s
Commit git commit 8834263a1d ℹ️: Merge 2eca7f3e104698090ad5f5dc12fa480b8fc57374 into 65140ccd2a9dba334fae9a6deb5b...
Committer Matthew Evans
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 504
View all changes introduced in this branch ↗︎

@ml-evs ml-evs force-pushed the ml-evs/add-nmr-jcamp-support branch 2 times, most recently from 704cc91 to b71be8f Compare May 20, 2025 16:33
@ml-evs ml-evs added this to the v0.6.x milestone May 20, 2025
Copy link

codecov bot commented May 20, 2025

Codecov Report

❌ Patch coverage is 71.91011% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.91%. Comparing base (65140cc) to head (2eca7f3).
⚠️ Report is 69 commits behind head on main.

Files with missing lines Patch % Lines
pydatalab/src/pydatalab/apps/nmr/blocks.py 68.83% 24 Missing ⚠️
pydatalab/src/pydatalab/apps/nmr/utils.py 91.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1205      +/-   ##
==========================================
+ Coverage   70.90%   70.91%   +0.01%     
==========================================
  Files          66       66              
  Lines        4358     4429      +71     
==========================================
+ Hits         3090     3141      +51     
- Misses       1268     1288      +20     
Files with missing lines Coverage Δ
pydatalab/src/pydatalab/apps/nmr/utils.py 44.68% <91.66%> (+6.87%) ⬆️
pydatalab/src/pydatalab/apps/nmr/blocks.py 78.41% <68.83%> (-7.84%) ⬇️
🚀 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.

@ml-evs ml-evs force-pushed the ml-evs/add-nmr-jcamp-support branch from b71be8f to 07d5e9d Compare May 20, 2025 21:30
@ml-evs ml-evs force-pushed the ml-evs/add-nmr-jcamp-support branch from 07d5e9d to 2eca7f3 Compare May 21, 2025 01:30
Copy link
Contributor

@BenjaminCharmes BenjaminCharmes left a comment

Choose a reason for hiding this comment

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

Everything working well!

Two small comments:

  1. Always seeing "NMRBlock raised warning: JCAMP-DX key without value: $RELAX" when using JCAMP-DC example_data

  2. There is some measurement details missing when using JCAMP-DC Files

@ml-evs
Copy link
Member Author

ml-evs commented May 21, 2025

Everything working well!

Thanks!

  1. Always seeing "NMRBlock raised warning: JCAMP-DX key without value: $RELAX" when using JCAMP-DC example_data

Yeah, this is an nmrglue warning, I think it's probably something slightly off specification with the example data.

  1. There is some measurement details missing when using JCAMP-DC Files

Yup, I've extracted all the things that are required to be in the file, but we could also try to reverse engineer some of the custom extension keys $xyz that e.g. bruker save into these files.

@ml-evs ml-evs merged commit 158022a into main May 21, 2025
17 checks passed
@ml-evs ml-evs deleted the ml-evs/add-nmr-jcamp-support branch May 21, 2025 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datablock An issue pertaining to a specific datablock enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants