Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
d90931e
Function rename for NumPy >2.0
JLVarjo Nov 13, 2024
d18cfb7
More numpy 2.0 compatibility changes with pylint
JLVarjo Nov 13, 2024
e3d8c73
One more numpy 2.0 fix...
JLVarjo Nov 13, 2024
9344fe1
...and more NumPy 2.0 fixes
JLVarjo Nov 27, 2024
5d46465
Added dtype=None to np.genfromtxt calls
JLVarjo Jan 22, 2025
9b66323
Merge branch 'master' of https://github.com/jjhelmus/nmrglue
JLVarjo Apr 3, 2025
439b0e6
Fix deprecated scipy calls
marhecker Jun 26, 2025
6ccb7a7
try prefered encoding first but also other
angela-plri Jul 3, 2025
ee637dc
Merge commit 'da64362ac813a00dc2f9ed706915ab991db5fd5d'
JLVarjo Jul 14, 2025
c47f249
Fix new Numpy deprecation (binary mode of np.fromstring)
JLVarjo Jul 14, 2025
725a1a1
bugfix: Fix zero-shift bug in `proc_base.ls`
jiwooseo98 Sep 19, 2025
e4800e7
Merge pull request #242 from jiwooseo98/fix_zero_left_shift
kaustubhmote Sep 20, 2025
a62e8aa
Merge pull request #238 from marhecker/scipy-fix
kaustubhmote Sep 20, 2025
1f575ed
Merge pull request #239 from angela-maennel/try_second_encoding
kaustubhmote Sep 20, 2025
4d3599b
write() was ignoring overwrite flag for proc* files
Nov 29, 2025
833e14a
fix unpacking in jeol
jjhelmus Dec 23, 2025
41d764f
enable ci workflow on PRs
jjhelmus Dec 23, 2025
028a786
do not fail fast
jjhelmus Dec 23, 2025
c062d5b
Merge pull request #247 from jjhelmus/ci_on_pr
jjhelmus Dec 23, 2025
90f82f9
Merge pull request #246 from jjhelmus/hotfix_jeol
jjhelmus Dec 23, 2025
5685a3e
Merge pull request #224 from JLVarjo/master
jjhelmus Dec 23, 2025
780b974
Merge pull request #245 from jjhelmus/bruker_write_override
jjhelmus Dec 23, 2025
2d0c507
fixed deprecated fromstring call
kaustubhmote Dec 25, 2025
b640875
Merge pull request #248 from kaustubhmote/tecmag_deprecation_fix
kaustubhmote Dec 30, 2025
295c953
better parsing of topspin version
kaustubhmote Apr 25, 2025
fe210ee
correctly use DTYPA for determining the data shape
kaustubhmote Apr 24, 2025
363724c
data reshaping now handles NUS datasets correctly
kaustubhmote Dec 30, 2025
6571048
added a function to update the unit conversion object
kaustubhmote Dec 31, 2025
986e985
added a test for update_uc
kaustubhmote Dec 31, 2025
8e21c02
Ignore BOM signature when parsing jdx files
sdollinger Jan 19, 2026
2500a5f
Merge pull request #251 from sdollinger/master
kaustubhmote Jan 23, 2026
9246bfc
Merge pull request #249 from kaustubhmote/bruker_read_data_bugfix
kaustubhmote Feb 9, 2026
0bbdcc6
Merge pull request #250 from kaustubhmote/update_uc
kaustubhmote Feb 9, 2026
ab04a8a
handles partially acquired datasets in bruker
kaustubhmote Feb 9, 2026
5b2e8ce
Merge pull request #252 from kaustubhmote/read_partial_data_bugfix
kaustubhmote Feb 9, 2026
fad974a
Add guess_tables() to tecmag for reading sequence tables from PSEQ
May 29, 2026
2163d94
Move guess_table tests to the main test file
Jun 19, 2026
50a191e
Use temp path and skip test if data dir is not available
Jun 19, 2026
5a6c58e
Merge pull request #257 from dpizetta/add-guess-tables-tecmag
kaustubhmote Jun 22, 2026
f4a2c1f
REL: 0.12
jjhelmus Aug 16, 2026
7af35af
start v0.13-dev
jjhelmus Aug 16, 2026
65e83e4
drop support for Python 3.8,9 add 3.13,14
jjhelmus Aug 16, 2026
fbac8a1
Merge pull request #266 from jjhelmus/update_support_vers
jjhelmus Aug 16, 2026
e6e47f4
Document GM Gaussian constant
fernandezc Sep 21, 2026
3505954
Fix Bruker magnitude quadrature metadata
fernandezc Sep 21, 2026
06b7815
Merge pull request #274 from fernandezc/fix/bruker-magnitude-quadrature
kaustubhmote Sep 22, 2026
5e2f095
Merge pull request #273 from fernandezc/docs/explain-gm-gaussian-cons…
kaustubhmote Sep 22, 2026
1a1d2dc
Replace removed pinv2 in linear prediction
fernandezc Sep 30, 2026
61a45e6
Add optional bounds parameters to autophase
dpizetta Jun 19, 2026
c5aa626
Address review: stricter autophase tests, accept fmin kwargs with bounds
dpizetta Oct 7, 2026
b0514c4
Validate autops bounds shape and fix documented return type
dpizetta Oct 7, 2026
9c6803d
Document single-phase bounds and the p0 limit caveat in autops
dpizetta Oct 7, 2026
2743c01
Replace autops bounds with p1_bounds and leave p0 unbounded
dpizetta Oct 7, 2026
b7f5bcd
Merge pull request #258 from dpizetta/add-bounds-to-autops
kaustubhmote Oct 7, 2026
255855d
Merge pull request #279 from fernandezc/fix/proc-lp-pinv
kaustubhmote Oct 8, 2026
7851bef
FIX: update FDSPECNUM properly when using pipe_proc.ext on 2D data set
reneeotten Oct 7, 2026
b72a959
FIX: correct type, define y_max instead of y_min
reneeotten Oct 8, 2026
812bfa0
Merge pull request #289 from reneeotten/fix_pipe_proc.ext
kaustubhmote Oct 8, 2026
cd0c2c9
Fixes to JCAMP-DX FID handling (#231)
JLVarjo Oct 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
name: nmrglue tests

on: [push]
on:
push:
branches: master
pull_request:
branches: master

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
fail-fast: false

steps:
- uses: actions/checkout@v3
Expand Down
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
0.12 (Unreleased)
0.13 (Unreleased)
=================


0.12 (2026-08-16)
=================
* Bruker to csdm conversion returns the correct dimension units (#227)
* When reading bruker files both utf-8 and cp1252 encodings are tried (#239)
* Correctly read Bruker data in floating point format (#249)
* Support reading partially acquired Bruker data (#252)
* Add support for reading JEOL jdf format (#228)
* Add support for reading RS2D/QUAD format (#230)
* Add the update_uc function to update a unit_conversion object (#250)
* Add a guess_tables function for use when reading Tecmat sequence tables (#257)
* The read function in nmrml can optionally return processed data (#232)
* Add support for Numpy 2.0+ (#224, #248)
* Various minor fixes (#233, #236, #242, #238, #246, #245, #251)


0.11 (2024-10-29)
=================

Expand Down
4 changes: 2 additions & 2 deletions examples/fitting_data/t1_measurements/extract_trajs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import numpy as np

# read in the integration limits and list of spectra
peak_list = np.recfromtxt("boxes.in", encoding="UTF-8")
spectra_list = np.recfromtxt("spectra.in", encoding="UTF-8")
peak_list = np.genfromtxt("boxes.in", dtype=None, encoding="UTF-8")
spectra_list = np.genfromtxt("spectra.in", dtype=None, encoding="UTF-8")

# prepare the trajs records array
num_spec = spectra_list.size
Expand Down
8 changes: 6 additions & 2 deletions examples/fitting_data/t1_measurements/fit_exp_leastsq.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@

# read in the trajectories and times
trajs = np.load("traj.npy")
t1 = np.recfromtxt("time.dat")
t1 = np.genfromtxt("time.dat", dtype=None)

# fitting function and residual calculation


def fit_func(p, x):
A, R2 = p
# bound A between 0.98 and 1.02 (although fits do not reflect this)
Expand All @@ -20,11 +22,13 @@ def fit_func(p, x):

return A * np.exp(-1.0 * np.array(x) * R2 / 1.0e6)


def residuals(p, y, x):
err = y - fit_func(p, x)
return err

p0 = [1.0, 0.05] # initial guess

p0 = [1.0, 0.05] # initial guess

fits = {}
# loop over the peak trajectories
Expand Down
5 changes: 4 additions & 1 deletion examples/fitting_data/t1_measurements/pt.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import numpy as np

# the same fit_func as in fit_exp_leastsq.py


def fit_func(p, x):

A, R2 = p
Expand All @@ -18,10 +20,11 @@ def fit_func(p, x):

return A * np.exp(-1.0 * np.array(x) * R2 / 1.0e6)


# read in the trajectories, fitting results, and times
fits = pickle.load(open("fits.pickle", "rb"))
trajs = np.load("traj.npy")
times = np.recfromtxt("time.dat")
times = np.genfromtxt("time.dat", dtype=None)

sim_times = np.linspace(times[0], times[-1], 2000)

Expand Down
4 changes: 2 additions & 2 deletions examples/integration/integrate_1d/integrate_1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
length = data.shape[0]

# read in the integration limits
peak_list = np.recfromtxt("limits.in")
peak_list = np.genfromtxt("limits.in", dtype=None)

# determine the ppm scale
uc = ng.pipe.make_uc(dic, data)
Expand Down Expand Up @@ -40,7 +40,7 @@
ax.plot(peak_scale, peak.cumsum() / 100. + peak.max(), 'g-')
ax.plot(peak_scale, [0] * len(peak_scale), 'r-')
ax.text(peak_scale[0], 0.5 * peak.sum() / 100. + peak.max(), name,
fontsize=8)
fontsize=8)

# write out the integration info
tup = (name, peak_scale[0], peak_scale[-1], peak.sum())
Expand Down
6 changes: 3 additions & 3 deletions examples/integration/integrate_2d/integrate_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
dic, data = ng.pipe.read("nmrpipe_2d/test.ft2")

# read in the integration limits
peak_list = np.recfromtxt("limits.in")
peak_list = np.genfromtxt("limits.in", dtype=None)

# prepare the output file
f = open("volumes.out",'w')
f = open("volumes.out", 'w')
f.write("# Name\tVolume\n")

# loop over the integration limits
Expand All @@ -23,7 +23,7 @@
y0, y1 = y1, y0

vol = data[y0:y1 + 1, x0:x1 + 1].sum()
f.write("%s\t%.3f\n"%(name, vol))
f.write("%s\t%.3f\n" % (name, vol))

# close the output file
f.close()
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import numpy as np

# read the integration limits and list of spectra
peak_list = np.recfromtxt("boxes.in", names=True)
spectra_list = np.recfromtxt("spectra.in")
peak_list = np.genfromtxt("boxes.in", dtype=None, names=True)
spectra_list = np.genfromtxt("spectra.in", dtype=None)

# create an array to hold the trajectories
trajectories = np.empty((peak_list.size, spectra_list.size), dtype='float')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
cl = 30000 * 1.20 ** np.arange(20)

# read in the box limits and list of spectra
peak_list = np.recfromtxt("boxes.in", names=True)
spectra_list = np.recfromtxt("spectra.in")
peak_list = np.genfromtxt("boxes.in", dtype=None, names=True)
spectra_list = np.genfromtxt("spectra.in", dtype=None)

# loop over the spectra
for spec_number, spectra in enumerate(spectra_list):
Expand All @@ -30,16 +30,16 @@
y0, y1 = y1, y0

# slice the data around the peak
slice = data[y0 - ypad:y1 + 1 + ypad, x0 - xpad:x1 + 1 + xpad]
slice_ = data[y0 - ypad:y1 + 1 + ypad, x0 - xpad:x1 + 1 + xpad]

# create the figure
fig = plt.figure()
ax = fig.add_subplot(111)

# plot the contours
print "Plotting:", peak, spec_number
print("Plotting:", peak, spec_number)
extent = (x0 - xpad + 1, x1 + xpad - 1, y0 - ypad + 1, y1 + ypad - 1)
ax.contour(slice, cl, cmap=cmap, extent=extent)
ax.contour(slice_, cl, cmap=cmap, extent=extent)

# draw a box around the peak
ax.plot([x0, x1, x1, x0, x0], [y0, y0, y1, y1, y0], 'k--')
Expand All @@ -51,6 +51,6 @@
[y0 + 1, y0 + 1, y1 - 1, y1 - 1, y0 + 1], 'k--', alpha=0.35)

# set the title, save the figure
ax.set_title('Peak: %s Spectrum: %i'%(peak, spec_number))
fig.savefig('peak_%s_spectrum_%i'%(peak, spec_number))
del(fig)
ax.set_title('Peak: %s Spectrum: %i' % (peak, spec_number))
fig.savefig('peak_%s_spectrum_%i' % (peak, spec_number))
del fig
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@
import matplotlib.pyplot as plt

# exponential function used to fit the data
def fit_func(p,x):


def fit_func(p, x):
A, R2 = p
return A * np.exp(-1.0 * np.array(x) * R2 / 1.0e6)

fitting_results = np.recfromtxt('fits.txt')

fitting_results = np.genfromtxt('fits.txt', dtype=None)
experimental_relaxation_times = np.loadtxt("relaxation_times.in")
simulated_relaxation_times = np.linspace(0,4000000,2000)
simulated_relaxation_times = np.linspace(0, 4000000, 2000)

# loop over the fitting results
for peak, A, R2, ier in fitting_results:

print "Plotting:", peak
print("Plotting:", peak)

# load the experimental and simulated relaxation trajectories
experimental_trajectory = np.loadtxt(peak + '.dat')
Expand Down
4 changes: 2 additions & 2 deletions examples/plotting/plot_2d/plot_assignments.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
dic, data = ng.pipe.read("nmrpipe_2d/test.ft2")

# read in the integration limits
peak_list = np.recfromtxt("limits.in")
peak_list = np.genfromtxt("limits.in", dtype=None)

# create the figure
fig = plt.figure()
ax = fig.add_subplot(111)

# plot the contours
ax.contour(data, cl, cmap=cmap,
extent=(0, data.shape[1] - 1, 0, data.shape[0] - 1))
extent=(0, data.shape[1] - 1, 0, data.shape[0] - 1))

# loop over the peaks
for name, x0, y0, x1, y1 in peak_list:
Expand Down
12 changes: 6 additions & 6 deletions examples/plotting/plot_2d/plot_boxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
dic, data = ng.pipe.read("nmrpipe_2d/test.ft2")

# read in the integration limits
peak_list = np.recfromtxt("limits.in")
peak_list = np.genfromtxt("limits.in", dtype=None)

# loop over the peaks
for name, x0, y0, x1, y1 in peak_list:
Expand All @@ -32,16 +32,16 @@
y0, y1 = y1, y0

# slice the data around the peak
slice = data[y0 - ypad:y1 + 1 + ypad, x0 - xpad:x1 + 1 + xpad]
slice_ = data[y0 - ypad:y1 + 1 + ypad, x0 - xpad:x1 + 1 + xpad]

# create the figure
fig = plt.figure()
ax = fig.add_subplot(111)

# plot the contours
print "Plotting:", name
print("Plotting:", name)
etup = (x0 - xpad + 1, x1 + xpad - 1, y0 - ypad + 1, y1 + ypad - 1)
ax.contour(slice, cl, cmap=cmap, extent=etup)
ax.contour(slice_, cl, cmap=cmap, extent=etup)

# draw a box around the peak
ax.plot([x0, x1, x1, x0, x0], [y0, y0, y1, y1, y0], 'k--')
Expand All @@ -50,11 +50,11 @@
ax.plot([x0 - 1, x1 + 1, x1 + 1, x0 - 1, x0 - 1],
[y0 - 1, y0 - 1, y1 + 1, y1 + 1, y0 - 1], 'k--', alpha=0.35)
ax.plot([x0 + 1, x1 - 1, x1 - 1, x0 + 1, x0 + 1],
[y0 + 1, y0 + 1, y1 - 1, y1 - 1, y0 + 1], 'k--',alpha=0.35)
[y0 + 1, y0 + 1, y1 - 1, y1 - 1, y0 + 1], 'k--', alpha=0.35)

# set the title
ax.set_title(name)

# save the figure
fig.savefig(f"{name}.png")
del(fig)
del fig
2 changes: 1 addition & 1 deletion examples/simulation/simulate_ucsf/make_ucsf.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
data = np.empty((512, 1024), dtype='float32')

# read in the peak list
peak_list = np.recfromtxt('peaks.txt', names=True)
peak_list = np.genfromtxt('peaks.txt', dtype=None, names=True)
npeaks = len(peak_list)

# convert the peak list from PPM to points
Expand Down
2 changes: 1 addition & 1 deletion nmrglue/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
from .util import *
from .analysis import *

__version__ = '0.12-dev'
__version__ = '0.13-dev'
Loading
Loading