question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add validation to case settings where appropriate

See original GitHub issue

I have noticed a handful of case settings that have implied bounds on their ranges, but no check is ever done to confirm the user input a valid value. For instance, burnSteps, nCycles, and power should all be non-negative but nothing stops the user from entering negative numbers.

In all of these instances, the code crashes somewhere where it is not necessarily clear what caused the crash. And in all instances, we could easily set a bound on the possible input values using the schema attribute when each of the Settings are defined and using some of the built-ins of Voluptuous (which we are already using). The schema for these cases would look something like voluptuous.Range(min=0). Very easy to add in.

I think it would be worthwhile to go through the case settings and add simple validators where they are not currently in place.

Does anybody have any objections to me doing this?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kecklercommented, May 13, 2022

Checklist of settings to add validation:

From globalSettings:

Setting Range Implemented Tested
numProcessors >= 1 Y Y
axialMeshRefinementFactor > 0 Y Y
minMeshSizeRatio > 0 Y Y
cycleLength > 0 Y Y
availabilityFactor >= 0 Y Y
burnSteps >= 0 Y Y
beta 0 =< f_i <= 1 Y Y
decayConstants lambda_i >= 0 Y Y
buGroups 0 < p_i <= 100 Y Y
burnupPeakingFactor >= 0 Y Y
startCycle >= 0 Y Y
startNode >= 0 Y Y
lowPowerRegionFraction 0 <= F <= 1 Y Y
mpiTasksPerNode >= 0 Y Y
nCycles >= 1 Y Y
numCoupledIterations >= 0 Y Y
power >= 0 Y Y
skipCycles >= 0 Y Y
targetK >= 0 Y Y
acceptableBlockAreaError > 0 Y Y
independentVariables list of tuples of length 2 will not do N/A
Tin > -273 Y Y
Tout > -273 Y Y

From databaseSettings:

Setting Range Complete Tested
dbStorageAfterCycle >= 0 Y Y

From reportSettings:

Setting Range Complete Tested
timelineInclusionCutoff 0 <= f <= 100 Y Y
0reactions
kecklercommented, Mar 11, 2022

See #595 for the PR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Apply data validation to cells - Microsoft Support
Select the cell(s) you want to create a rule for. Select Data >Data Validation. Data Validation. On the Settings tab, under Allow, select...
Read more >
Create a validation rule for escalated cases.
The validation rule should be on the Case object. The validation rule should be named 'Mark_as_Escalated'. The validation rule should fire ...
Read more >
Data validation in Excel: how to add, use and remove - Ablebits
On the Settings tab, define the validation criteria according to your needs. In the criteria, you can supply any of the following: Values...
Read more >
How to Create Validation Rules with Multiple Conditions
Salesforce #SalesforceSupport #SalesforceHowToAfter watching this screencast the user will be able to learn how to create validation rules ...
Read more >
How to Use Validation Rules in Salesforce (+ Examples)
How to Create a Validation Rule in Salesforce ... This means that Case activity won't be associated with that user – both the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found