Skip to content

Is there a reason why the two parsers are using different algorithms? Additionally, implement the max and min functions. #6

@light-weaver

Description

@light-weaver

def parser(self, math_json):

In the polars parser you are using recursion. In here, you are using stack operations. This can make things unnecessarily difficult for future maintainers.

Also, if I am not wrong... The algorithm here only works for functions/operators with known arity (one or two in the cases you have implemented). We may eventually have cases with an unknown number of inputs. Infact, I would like you to implement two such functions: max and min.

You can find two valid JSON structures for these functions in the MathJSON documentation: https://cortexjs.io/compute-engine/reference/arithmetic/

Choose whichever one is easier to handle in your parsers and document the choice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions