cdm_data_loaders.converters.core.inference ¶
Target-independent JSON Schema type inference and decimal scale helpers.
infer_implicit_type ¶
Approximate a type-less schema from its type-specific keywords.
Precedence is object, array, string, number. These keywords constrain values of their own type but do not exclude other JSON types.
Source code in src/cdm_data_loaders/converters/core/inference.py
json_type_from_enum ¶
Infer a scalar JSON type, using string for empty or heterogeneous enums.
Source code in src/cdm_data_loaders/converters/core/inference.py
is_unconstrained_node ¶
Identify false or empty JSON schemas that carry no type information.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node
|
TypedNode
|
the schema node to inspect |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True for a |
Source code in src/cdm_data_loaders/converters/core/inference.py
decimal_places ¶
Count fractional digits in the decimal representation; non-finite values return zero.
Source code in src/cdm_data_loaders/converters/core/inference.py
decimal_pattern ¶
Build the decimal string pattern from integer precision and scale.