MCPcopy Index your code
hub / github.com/plotly/plotly.py / get_validator_params

Function get_validator_params

codegen/validators.py:8–32  ·  view source on GitHub ↗

Get params for the validator instance for the supplied node and add them to the store. Parameters ---------- node : PlotlyNode The datatype node (node.is_datatype must evaluate to true) for which to build a validator class store : dict Dictionary to

(node: PlotlyNode, store: dict)

Source from the content-addressed store, hash-verified

6
7
8def get_validator_params(node: PlotlyNode, store: dict):
9 """
10 Get params for the validator instance for the supplied node
11 and add them to the store.
12
13 Parameters
14 ----------
15 node : PlotlyNode
16 The datatype node (node.is_datatype must evaluate to true) for which
17 to build a validator class
18 store : dict
19 Dictionary to store the JSON data for the validator
20 Returns
21 -------
22 None
23 """
24 assert isinstance(store, dict)
25 assert node.is_datatype
26
27 raw_params = node.get_validator_params()
28 params = dict([(k, eval(v)) for k, v in raw_params.items()])
29 superclass_name = node.name_base_validator.split(".")[-1]
30
31 key = ".".join(node.parent_path_parts + (node.name_property,))
32 store[key] = {"params": params, "superclass": superclass_name}
33
34
35def get_data_validator_params(base_trace_node: TraceNode, store: dict):

Callers 1

perform_codegenFunction · 0.90

Calls 3

get_validator_paramsMethod · 0.80
itemsMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected