Skip to content
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

Spell checker for input fields #339

Open
cerium1925 opened this issue May 23, 2024 · 2 comments
Open

Spell checker for input fields #339

cerium1925 opened this issue May 23, 2024 · 2 comments

Comments

@cerium1925
Copy link

cerium1925 commented 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 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.
Screenshot 2024-05-23 171856

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.01
D];
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
Screenshot 2024-05-23 171948

@stestoll
Copy link
Member

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 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
@stestoll
Copy link
Member

Closing this due to low priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants