Skip to content

Commit

Permalink
docs: tweak Expression example
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer authored Jul 28, 2024
1 parent 9752dbb commit e5adc4b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/test_expressions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -289,19 +289,18 @@ end
a mathematical expression as a tree structure. It combines an
`AbstractExpressionNode` (typically a `Node`) with metadata like operators
and variable names.
Let's explore how to create and work with `Expression` objects:
=#
using DynamicExpressions, Random

# First, let's define our operators and variable names:

operators = OperatorEnum(;
binary_operators=[+, -, *, /], unary_operators=[sin, cos, exp]
binary_operators=(+, -, *, /), unary_operators=(sin, cos, exp)
)
#
variable_names = ["x", "y"]

# Now, let's create a simple Expression manually:
# Now, let's create an Expression manually:
x = Node{Float64}(; feature=1)
x_expr = Expression(x; operators, variable_names)

Expand Down

0 comments on commit e5adc4b

Please sign in to comment.