Conditions and literals¶
- class qca.ConditionSpec(name, kind, domain=None, calibrated=None, value_columns=None)[source]¶
Normalized description of one QCA condition.
Public engines can accept friendly APIs such as
conditionspluscondition_typesor legacyset_conditions. Internally they should converge on this small schema object so csQCA, fsQCA, mvQCA, and gsQCA share the same condition contract.- Parameters:
name (str)
kind (Literal['crisp', 'fuzzy', 'multi'])
domain (tuple[Any, ...] | None)
calibrated (bool | None)
value_columns (Mapping[Any, str] | None)
- qca.condition_specs_from_schema(schema)[source]¶
Normalize a user-facing condition schema into
ConditionSpecobjects.Accepted inputs are:
a sequence of
ConditionSpecobjects;a sequence of mapping objects with
nameandkind/typefields;a pandas-like DataFrame with matching columns.
Optional mapping/DataFrame fields are
domain,calibrated, andvalue_columns.value_columnsmaps a multi-value domain value to a calibrated membership column, which is the schema representation used for generalized-set QCA multivalent fuzzy set variables.- Parameters:
schema (Any)
- Return type:
list[ConditionSpec]
- class qca.SetLiteral(name, negated=False)[source]¶
Literal for a crisp-set or fuzzy-set condition.
- Parameters:
name (str)
negated (bool)
- membership(df)[source]¶
Return membership scores for this literal.
- Parameters:
df (DataFrame)
- Return type:
Series
- class qca.MultiValueLiteral(name, value)[source]¶
Literal for a multi-value QCA condition.
- Parameters:
name (str)
value (Any)
- qca.parse_literal(text)[source]¶
Parse a literal label into a literal object.
- Parameters:
text (str)
- Return type:
- qca.parse_conjunction(text)[source]¶
Parse a conjunction label into literal objects.
- Parameters:
text (str)
- Return type:
list[SetLiteral | MultiValueLiteral]