-
Notifications
You must be signed in to change notification settings - Fork 16
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
feat: create Expression
type to store operators with expression and parse_expression
to have robust parsing
#73
Conversation
Pull Request Test Coverage Report for Build 9182557303Details
💛 - Coveralls |
ec97698
to
44e541b
Compare
With my very limited Julia knowledge, this looks like solving the issues I have and probably allowing the end user to later easily create a backbone expression from a parsed formula to feed the search with a seed. I like it. |
This comment was marked as resolved.
This comment was marked as resolved.
Thanks indeed for the reminder that I should try out this package. I do have some use-cases where it would be useful for |
d62d65b
to
7b63aa0
Compare
I'm also thinking about just ditching the |
2946391
to
1e2f100
Compare
Expressions
This creates the
Expression
andAbstractExpression
type for attaching operators and potentially other metadata to the expression itself.This will likely be most useful as user-facing type to return self-contained expressions. I think it can also be useful for expression searches that attach other types of metadata.
This means you can do things like
without needing to provide the operators or variable names – they are stored inside the
Expression
struct.Previously you needed to keep track of these yourself which is a bit of a pain if you aren't deeply knowledgeable about how everything works.
Parsing
In addition to this, I also add
@parse_expression
macro. This is a safer and easier alternative to operator overloading for creatingNode
types.Basically it works as follows:
You can also optionally provide a
node_type
argument to specify e.g., use of aGraphNode
instead of aNode
.This is much nicer because it means you can have multiple sets of operator enums, and generate expressions without worrying about overwriting the global mapping from function to index.
TODO:
Expression
to allow anything being set for theoperators
field (includingnothing
). And rewrite the field to besettings
so its clear its not specificallyoperators
.variable_names
to benothing
.options
function to allow passing both the expression (in case it contains its own settings), AND anoptions
variable that by default is nothing. This would let you work with an expression that does not refer to its own options.variable_names
.Expression
for referring to arbitrary metadata.MultiExpression
andParametricExpression
Tagging in case of interest @avik-pal @AlCap23 @rikhuijzer @Moelf