zdelrosario / py_grama

Implementation of a grammar of model analysis
https://py-grama.readthedocs.io/en/latest/
MIT License
19 stars 11 forks source link

Double invariant testing eval verbs #196

Open mstites opened 2 years ago

mstites commented 2 years ago

Issue: Evaluation verbs that call eval_df as part of their operation are performing the same invariant testing twice (on the model and dataframe objects). With the current code architecture, this is necessary to ensure proper type and value checking of dataframe and model arguments; since eval verbs will perform operations on the model and/or dataframe object before eventually calling eval_df which also has its own invariants check since it is a function available to the user.

Evaluation verbs with this issue (such as eval_nominal) should be modified so that this duplicate invariant testing does not happen. A potential solution could involve segmenting out the vital code from evaldf and putting it in a helper function that can be called (without invariant tests) or directly in the eval* function itself.

mstites commented 2 years ago

I can add code snipets once PR #195 is merged.