[FEATURE] Add warning to interpolation #159
Closed
opened 2023-11-29 12:40:01 +00:00 by cwolter
·
6 comments
No Branch/Tag Specified
Labels
Clear labels
Kind/Breaking
Kind/Bug
Kind/Crash
Kind/Documentation
Kind/Enhancement
Kind/Feature
Reviewed/Won't Fix
Type/BDS
Type/DSC
Type/Fit
Type/General
Type/NMR
Breaking change that won't be backward compatible
Something is not working
This issue describes unexpected shutdowns or non-responsive behaviors
Improves documentation
Improve existing functionality
New feature
Priority
Critical
The priority is critical
Priority
High
The priority is high
Priority
Low
The priority is low
Priority
Medium
The priority is medium
Priority
Very low
The priority is very low
Reviewed
Duplicate
This issue or pull request already exists
Reviewed
Invalid
Invalid isssue
This issue won't be fixed
Status
Need More Info
Feedback is required to reproduce issue or to continue work
Status
On Hold
This issue or pull request is on hold
Status
Stale
Issues without activity for more than 6 months
Issues connected to BDS
Issues connected to DSC
Issue is connected to fitting data
issue connected to general functionality
Issues connected to NMR
No labels
Kind/Enhancement
Milestone
No items
No Milestone
Assignees
aahmad (Arshid Ahmad)
anisar (Aqsa Nisar)
ckolb (Christian Kolb)
cwolter (Celine Wolter)
dominik (Dominik Demuth)
dwuerz (David Würz)
elisa (Elisa Steinruecken)
fwolter (Finn Wolter)
huczhang (Huanchen Zhang)
jepsinrajkp (Jepsinraj Kakkuzhiyulla Parambath)
kschroeder (Katharina Schroeder)
malbrecht (Maximilian Albrecht)
mandal (Suvendu Mandal)
markusro (Markus Rosenstihl)
mbergmann (Mark Bergmann)
mhaneke (Markus Haneke)
robin (Robin Horstmann)
saeckech (Christoph Säckel)
skloth (Sebastian Kloth)
skrueger (Sandra Krüger)
ypiliauskaya (Yauheniya Piliauskaya)
Clear assignees
No Assignees
dominik
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: IPKM/nmreval#159
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Current behavior
Wenn man Daten interpolieren will passiert nichts. x-Daten sollten aus einem anderen Datenset genommen werden.
Einstellung: log(y), cubic
Fehlermeldung: 29/11/2023 13:33:36 - ERROR - root : Uncaught exception:
Traceback (most recent call last):
File "/tmp/.mount_NMRevamMrIm6/usr/src/gui_qt/main/management.py", line 826, in interpolate_data
k = self.add(interpolate(self.data[ids], new_x, xlog=xlog, ylog=ylog, kind=mode, extrapolate=True))
File "/tmp/.mount_NMRevamMrIm6/usr/src/nmreval/math/interpol.py", line 17, in interpolate
f = interp1d(_x, _y, kind=kind, fill_value=fill)
File "/tmp/.mount_NMRevamMrIm6/usr/lib/python3/dist-packages/scipy/interpolate/interpolate.py", line 546, in init
self._spline = make_interp_spline(xx, yy, k=order,
File "/tmp/.mount_NMRevamMrIm6/usr/lib/python3/dist-packages/scipy/interpolate/_bsplines.py", line 788, in make_interp_spline
raise ValueError("Expect x to not have duplicates")
ValueError: Expect x to not have duplicates
Expected behavior
No response
Steps to reproduce
No response
Log messages
No response
Anything else?
No response
Das oder so was ähnliches gabs bei mir auch schon mal. Hast du in deinen Daten zwei Punkte mit exakt gleichem x-Wert? Das hatte bei mir manche interpolate-Modi durcheinander gebracht.
#103 (comment)
Ja wir hatten zwei gleiche x-Werte. Nach Entfernen hat es funktioniert, aber auch mit zwei gleichen x-Werten funktionierts mit Einstellung linear.
Das kommt mir bekannt vor. Ich habe oben nachträglich noch meine alte Issue Nummer dazugeschrieben.
[BUG] <interpolation>to [FEATURE] Add warning to interpolationFür die Interpolation müssen die x-Werte sortiert und, für alle Varianten außer 'linear', auch noch alle unterschiedlich sein, sonst klappt das nicht. Ich werde das mal als Warnung anzeigen lassen, damit sich Leute nicht wundern, warum das nicht geht.
Muss man denn zwangsweise sortieren? Wenn ich in einem Datenset z.B. eine Heiz und Kühlkurve habe könnte ich ja wollen, dass die Punkte nach Index-Reihenfolge verbunden werden und nicht nach x-Wert.
Ja, muss man. Die Bedingung kommt auch nicht von mir, sondern Scipy setzt das voraus. Ansonsten kann es sein, dass die Ableitungen für Interpolation falsch ist.