formulaic icon indicating copy to clipboard operation
formulaic copied to clipboard

`_ordering="none"` is ignored when a dependent variable is included

Open eirki opened this issue 5 months ago • 1 comments

Thanks for the very useful library!

I'm having some issues with retaining the order of the terms as they are in the formula. Using the example from the README, but with a c  ~ added, yield the following result:

In [2]: {
   ...:     "degree": Formula("c ~ z + z:a + z:b:a + g").rhs,
   ...:     "none": Formula("c ~ z + z:a + z:b:a + g", _ordering="none").rhs,
   ...:     "sort": Formula("c ~ z + z:a + z:b:a + g", _ordering="sort").rhs,
   ...: }
Out[2]:
{'degree': 1 + z + g + z:a + z:b:a,
 'none': 1 + z + g + z:a + z:b:a,
 'sort': 1 + g + z + a:z + a:b:z}

Notice the 'none' example is identical to the 'degree' (default) option. Is there a reason for this?

eirki avatar Sep 05 '24 07:09 eirki