Skip to content

Commit

Permalink
Merge branch 'store-options' into sympy-or
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Dec 14, 2023
2 parents 11dea32 + f21e3d6 commit 50c1407
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions docs/operators.md
Expand Up @@ -14,6 +14,9 @@ A selection of these and other valid operators are stated below.
- `*`
- `/`
- `^`
- `max`
- `min`
- `mod`
- `cond`
- Equal to `(x, y) -> x > 0 ? y : 0`
- `greater`
Expand All @@ -22,7 +25,6 @@ A selection of these and other valid operators are stated below.
- Equal to `(x, y) -> (x > 0 || y > 0) ? 1 : 0`
- `logical_and`
- Equal to `(x, y) -> (x > 0 && y > 0) ? 1 : 0`
- `mod`

**Unary**

Expand Down Expand Up @@ -60,7 +62,7 @@ A selection of these and other valid operators are stated below.
## Custom

Instead of passing a predefined operator as a string,
you can define with by passing it to the `pysr` function, with, e.g.,
you can just define a custom function as Julia code. For example:

```python
PySRRegressor(
Expand Down
2 changes: 1 addition & 1 deletion pysr/export_sympy.py
Expand Up @@ -47,9 +47,9 @@
"ceil": sympy.ceiling,
"sign": sympy.sign,
"gamma": sympy.gamma,
"round": lambda x: sympy.ceiling(x - 0.5),
"max": lambda x, y: sympy.Piecewise((y, x < y), (x, True)),
"min": lambda x, y: sympy.Piecewise((x, x < y), (y, True)),
"round": lambda x: sympy.ceiling(x - 0.5),
"cond": lambda x, y: sympy.Piecewise((y, x > 0), (0.0, True)),
"logical_or": lambda x, y: sympy.Piecewise((1.0, (x > 0) | (y > 0)), (0.0, True)),
"logical_and": lambda x, y: sympy.Piecewise((1.0, (x > 0) & (y > 0)), (0.0, True)),
Expand Down
2 changes: 1 addition & 1 deletion pysr/version.py
@@ -1,2 +1,2 @@
__version__ = "0.16.4"
__version__ = "0.16.5"
__symbolic_regression_jl_version__ = "0.22.5"

0 comments on commit 50c1407

Please sign in to comment.