Skip to content

Commit

Permalink
Merge pull request #82 from jverzani/issue_sympy_554
Browse files Browse the repository at this point in the history
  • Loading branch information
jverzani authored Jan 17, 2025
2 parents fba40ef + 59d9a9a commit 10d12cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SymPyCore"
uuid = "458b697b-88f0-4a86-b56b-78b75cfb3531"
authors = ["jverzani <jverzani@gmail.com> and contributors"]
version = "0.2.8"
version = "0.2.9"

[deps]
CommonEq = "3709ef60-1bee-4518-9f2f-acd86f176c50"
Expand Down
8 changes: 6 additions & 2 deletions src/lambdify.jl
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ sympy_fn_julia_fn = Dict(

const fn_map = Dict(k => last(v) for (k,v) pairs(sympy_fn_julia_fn))

map_fn(key, fn_map) = haskey(fn_map, key) ? fn_map[key] : Symbol(key)
map_fn(key, fn_map) = haskey(fn_map, key) ? fn_map[key] :
isdefined(@__MODULE__, Symbol(key)) ? Symbol(key) :
error("Lambdify doesn't know what to do with $key. Sorry.")

##

Expand Down Expand Up @@ -272,8 +274,10 @@ function walk_expression(ex; values=Dict(), fns=Dict())
return vals_map[fn]
end

fn′ = map_fn(fn, fns_map)

as = args(ex)
Expr(:call, map_fn(fn, fns_map), [walk_expression(a, values=values, fns=fns) for a in as]...)
Expr(:call, fn′, [walk_expression(a, values=values, fns=fns) for a in as]...)
end

"""
Expand Down

2 comments on commit 10d12cb

@jverzani
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/123235

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.9 -m "<description of version>" 10d12cba6a8cb6ccac74892727c2c7c64b1655dc
git push origin v0.2.9

Please sign in to comment.