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

A switch variable in startup.jl? If not enabled, do not parse the code string unit = u"V" to avoid Unit buggs #3248

Open
wang890 opened this issue Nov 30, 2024 · 1 comment

Comments

@wang890
Copy link

wang890 commented Nov 30, 2024

Is your feature request related to a problem? Please describe.

Unit system is only auxiliary to modeling and solving, but useful. Many variables from Blocks have no Units, so it is very troublesome to balance the units when equation solving. Currently, Unit only have a display function before solving.

In addtion, there are still some Issues about the Unit System, which may be improved in the future when there is time. Is it necessary to have mtk provide a switch variable? If this variable is not enabled, the code string of Unit metadata like unit = u"V" will not be parsed to avoid unnecessary buggs like the issue #3247.

Describe the solution you’d like
Perhaps, the switch variable can be placed in .julia\config\startup.jl as a global variable, or some other user-settable way. startup.jl needs to be created manually.

Additional context
My temporary Unit solution like unit = u("Resistance") had been described at the issue comment.
After I learned Julia macro and mtk, I would also like to contribute some code.

@ChrisRackauckas
Copy link
Member

This would be for the standard library? I think it would make sense there.

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

No branches or pull requests

2 participants