Skip to content

Commit

Permalink
Simplify .variables
Browse files Browse the repository at this point in the history
  • Loading branch information
grst committed Dec 1, 2024
1 parent 5cfdf83 commit 355acf9
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/formulaic_contrasts/_contrasts.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,7 @@ def __init__(self, data: pd.DataFrame, design: str):
@property
def variables(self):
"""Get the names of the variables used in the model definition."""
try:
return self.design_matrix.model_spec.variables_by_source["data"]
except AttributeError:
raise ValueError(
"Retrieving variables is only possible if the model was initialized using a formula."
) from None
return self.design_matrix.model_spec.variables_by_source["data"]

def cond(self, **kwargs):
"""
Expand Down

0 comments on commit 355acf9

Please sign in to comment.