Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider all model fields for model truthiness checks #112

Closed
lu-pl opened this issue Oct 24, 2024 · 0 comments · Fixed by #113
Closed

Consider all model fields for model truthiness checks #112

lu-pl opened this issue Oct 24, 2024 · 0 comments · Fixed by #113
Assignees

Comments

@lu-pl
Copy link
Contributor

lu-pl commented Oct 24, 2024

Depends on #110 .

Currently the model serialization values are checked in order to determine model truthiness.

If excluded model fields should be applicable for determining model truthiness according to #110, the default check must not rely on model serialization because excluded fields obviously will be - well - excluded. See #110 (comment).

A solution for this is to use model dict-casting instead of model_dump in the default model_bool predicate.

The default model_bool predicate would then have to be this:

class ModelBoolPredicate(Protocol):
    def __call__(self, model: _TModelInstance) -> bool: ...

def default_model_bool_predicate(model: _TModelType) -> bool: 
    return any(dict(model).values())
@lu-pl lu-pl self-assigned this Oct 24, 2024
lu-pl added a commit that referenced this issue Oct 28, 2024
lu-pl added a commit that referenced this issue Nov 6, 2024
@lu-pl lu-pl added this to the Model truthiness milestone Nov 7, 2024
lu-pl added a commit that referenced this issue Nov 8, 2024
lu-pl added a commit that referenced this issue Nov 11, 2024
lu-pl added a commit that referenced this issue Nov 15, 2024
Model truthiness is an important metric for the rdfproxy grouping mechanism.
Currently, a model is considered truthy if at least one of its fields is truthy.

This is a sane default, yet certain frontend demands require different model truth conditions.
The feature provides the option for client code to specify conditions/predicates for determining model truthiness.

Closes #110, closes #112.
lu-pl added a commit that referenced this issue Nov 15, 2024
Model truthiness is an important metric for the rdfproxy grouping mechanism.
Currently, a model is considered truthy if at least one of its fields is truthy.

This is a sane default, yet certain frontend demands require different model truth conditions.
The feature introduces a model_bool option in the model_config that allows client code to specify conditions/predicates for determining model truthiness.

Closes #110, closes #112.
lu-pl added a commit that referenced this issue Nov 15, 2024
Model truthiness is an important metric for the rdfproxy grouping mechanism.
Currently, a model is considered truthy if at least one of its fields is truthy.

This is a sane default, yet certain frontend demands require different model truth conditions.

The feature introduces a model_bool option in the model_config
that allows client code to specify conditions/predicates for determining model truthiness.

Closes #110, closes #112.
lu-pl added a commit that referenced this issue Nov 16, 2024
Model truthiness is an important metric for the rdfproxy grouping mechanism.
Currently, a model is considered truthy if at least one of its fields is truthy.

This is a sane default, yet certain frontend demands require different model truth conditions.

The feature introduces a model_bool option in the model_config
that allows client code to specify conditions/predicates for determining model truthiness.

Closes #110, closes #112.
b1rger added a commit that referenced this issue Nov 19, 2024
Model truthiness is an important metric for the rdfproxy grouping mechanism.
Currently, a model is considered truthy if at least one of its fields is truthy.

This is a sane default, yet certain frontend demands require different model truth conditions.

The feature introduces a model_bool option in the model_config
that allows client code to specify conditions/predicates for determining model truthiness.

Closes #110, closes #112.
lu-pl added a commit that referenced this issue Nov 19, 2024
Model truthiness is an important metric for the rdfproxy grouping mechanism.
Currently, a model is considered truthy if at least one of its fields is truthy.

This is a sane default, yet certain frontend demands require different model truth conditions.

The feature introduces a model_bool option in the model_config
that allows client code to specify conditions/predicates for determining model truthiness.

Closes #110, closes #112.
lu-pl added a commit that referenced this issue Nov 20, 2024
Model truthiness is an important metric for the rdfproxy grouping mechanism.
Currently, a model is considered truthy if at least one of its fields is truthy.

This is a sane default, yet certain frontend demands require different model truth conditions.

The feature introduces a model_bool option in the model_config
that allows client code to specify conditions/predicates for determining model truthiness.

Closes #110, closes #112.
@lu-pl lu-pl closed this as completed in daf72cb Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant