Wildmeshing Toolkit
Loading...
Searching...
No Matches
Functions | Variables
simwild.polyfem_ops.spec Namespace Reference

Functions

list load_spec (str op_name)
 
 _rule_for (rules, pointer)
 
 _check (rules, pointer, value)
 
dict validate (list rules, dict params)
 

Variables

dict _TYPES
 

Detailed Description

Minimal validator for the wmtk-style JSON spec rule lists (same format as
simwild_spec.json): pointer/type/required/optional/default/options/min/max.
Fills defaults for absent optional keys and rejects unmatched pointers with
the same "No rule matched" wording as the C++ jse.

Function Documentation

◆ _rule_for()

simwild.polyfem_ops.spec._rule_for (   rules,
  pointer 
)
protected
Component-wise pointer match where any rule component may be `*`;
the most specific matching rule (fewest wildcards) wins.

◆ load_spec()

list simwild.polyfem_ops.spec.load_spec ( str  op_name)
Load the spec.json packaged with simwild.polyfem_ops.<op_name>.

◆ validate()

dict simwild.polyfem_ops.spec.validate ( list  rules,
dict  params 
)
Validate `params` against the rule list; returns a new dict with
top-level defaults filled in.

Variable Documentation

◆ _TYPES

dict simwild.polyfem_ops.spec._TYPES
protected
Initial value:
1= {
2 "string": str,
3 "bool": bool,
4 "int": int,
5 "float": (int, float),
6 "list": (list, tuple),
7 "object": dict,
8}