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

No Unitful support #17

Closed
freemin7 opened this issue Feb 24, 2020 · 2 comments · Fixed by #93
Closed

No Unitful support #17

freemin7 opened this issue Feb 24, 2020 · 2 comments · Fixed by #93

Comments

@freemin7
Copy link

freemin7 commented Feb 24, 2020

Unitful.jl is a nice library which allows type inference over physical units making unit conversion errors less likely.
I tried the following:

circ = @circuit begin
                j_in = voltagesource(9u"V")
                j_out = voltageprobe()
                j_in[+] == j_out[+]
                j_in[-] == j_out[-]
              end

Currently i am getting a ERROR: DimensionError: and V are not dimensionally compatible.
You might want to look into Unitful and whether supporting it makes sense for you.

@martinholters
Copy link
Member

Agree this would be super nice to support. Unfortunately it's not just writing the code in a way that just happens to work with unitful numbers. Internally, it's quite likely that quantities of different units are collected in the same vector, but for performance, we definitely want that vector elements to be concretely typed, so that leaves dimensionless as best option internally.

The surface, however, would definitely benefit from supporting units. It's just that I'm reluctant to add dependencies. But if we get something like JuliaLang/Pkg.jl#1285 eventually, I'd definitely like to add Unitful as an optional dependency.

@bhalonen
Copy link

Will also note that supporting Unitful APIs makes life much easier to get started. Have lost weeks of work putting the wrong unit into a complex program I did not understand.

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 a pull request may close this issue.

3 participants