Skip to content
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

Remove type argument, symtype, update docs #39

Merged
merged 4 commits into from
Jun 2, 2024
Merged

Remove type argument, symtype, update docs #39

merged 4 commits into from
Jun 2, 2024

Conversation

0x0f0f0f
Copy link
Member

@0x0f0f0f 0x0f0f0f commented Jun 2, 2024

#36

@0x0f0f0f 0x0f0f0f changed the title Remove type argument Remove type argument, symtype, update docs Jun 2, 2024
@0x0f0f0f
Copy link
Member Author

0x0f0f0f commented Jun 2, 2024

#37

@0x0f0f0f 0x0f0f0f merged commit 386008e into master Jun 2, 2024
6 checks passed
@ChrisRackauckas
Copy link
Member

Was there an agreement on this?

@0x0f0f0f
Copy link
Member Author

0x0f0f0f commented Jun 2, 2024

Was there an agreement on this?

I will file a reviewable PR with the needed changes to SU

@ChrisRackauckas
Copy link
Member

@bowenszhu you've been considering the performance semantics, what do you think of this?

@ChrisRackauckas
Copy link
Member

Also, is this actually correct? How is the type used in the hash if it's in the metadata?

@ChrisRackauckas ChrisRackauckas deleted the ale/notype branch June 3, 2024 00:53
@bowenszhu
Copy link
Member

@bowenszhu you've been considering the performance semantics, what do you think of this?

This doesn't bother with performance.

Also, is this actually correct? How is the type used in the hash if it's in the metadata?

Probably fine. In SymbolicUtils.jl, symtype is a part of parametrized typeof.

using SymbolicUtils

@syms x y::Complex{Int64} z::Float32

tx = typeof(x)                        # SymbolicUtils.BasicSymbolic{Number}
sx = SymbolicUtils.symtype(x)         # Number
ty = typeof(y)                        # SymbolicUtils.BasicSymbolic{Complex{Int64}}
sy = SymbolicUtils.symtype(y)         # Complex{Int64}
tz = typeof(z)                        # SymbolicUtils.BasicSymbolic{Float32}
sz = SymbolicUtils.symtype(z)         # Float32

@ChrisRackauckas
Copy link
Member

If that's the case then it should just use:

@assume_effects :total __parameterless_type(T)=Base.typename(T).wrapper
parameterless_type(x) = parameterless_type(typeof(x))
parameterless_type(x::Type) = __parameterless_type(x)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants