You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a user enters a field that doesn't exist, the current development version of EasySpin lacks a validity check and simply loads the default parameters. For instance, if Opt.GridSize is mistakenly input as Opt.GridSiz, EasySpin won't provide a reminder or error message (as it has already loaded the default value). This also applies to arbitrarily defined fields like Sys.T, or other illegal or undefined fields. These will always exist in fields such as Sys, Exp, or Opt. While EasySpin doesn't flag an error, it could potentially lead to bugs or calculation errors.
Agreed, it would be nice to have spell checker for this. We've been considering adding one, but it hasn't been a high enough priority.
Can you provide, or point to, an efficient implementation for such a spell checker?
There are two downsides of this though: (1) A spell checker slows down simulation functions. (2) The dictionary of field names needs to be maintained so it doesn't slip out of sync with the fields that are actually being used.
stestoll
changed the title
It is necessary to check whether the user input field exists or is valid.
Spell checker for input fields
May 23, 2024
If a user enters a field that doesn't exist, the current development version of EasySpin lacks a validity check and simply loads the default parameters. For instance, if
Opt.GridSize
is mistakenly input asOpt.GridSiz
, EasySpin won't provide a reminder or error message (as it has already loaded the default value). This also applies to arbitrarily defined fields likeSys.T
, or other illegal or undefined fields. These will always exist in fields such asSys
,Exp
, orOpt
. While EasySpin doesn't flag an error, it could potentially lead to bugs or calculation errors.test code:
tic
clear,clc,clf
Sys.S = 3/2;
Sys.Nucs = 'Mn';
Sys.g = [1.998 1.997];
Sys.A = [110 120];
Sys.T = [0 0 0];
D = -529979;
Sys.D = [D 0.01D];
Sys.lw = 2.5;
Exp.mwFreq = 9.8;
Exp.Range = [0 2000];
Exp.nPoints = 1e4;
Opt.GridSize = [1e2 1e1];
Opt.Verbosity = 2;
Exp.Temperature = 0.4;
[x,y] = pepper(Sys,Exp,Opt);
plot(x,y);
toc
The text was updated successfully, but these errors were encountered: