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

Move with_units here from PowerFlows.jl #1229

Closed
GabrielKS opened this issue Dec 16, 2024 · 1 comment · Fixed by #1232
Closed

Move with_units here from PowerFlows.jl #1229

GabrielKS opened this issue Dec 16, 2024 · 1 comment · Fixed by #1232

Comments

@GabrielKS
Copy link
Collaborator

In a recent pull request to PowerFlows.jl, I've prototyped this function with_units that can be combined with the Julia do block to perform some action with a System under a particular units setting without permanently changing the units setting:

with_units(sys, PSY.UnitSystem.SYSTEM_BASE) do
  # things in this block will evaluate as if the System's unit system was SYSTEM_BASE no matter what it was before
end
# the System's unit system is back to normal

I think it should be moved to PSY and exported. Also

  • A less heavy-handed approach to suppressing the logging should probably be taken
  • Tests need to be written

Adding this as an issue here in case someone wants to take it on to learn about writing tests, etc. — otherwise I'll do it myself later this week.

@jd-lara
Copy link
Member

jd-lara commented Dec 16, 2024

We should add this to the power flow project

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

Successfully merging a pull request may close this issue.

2 participants