Skip to content

Spell checker for input fields #339

@cerium1925

Description

@cerium1925

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions