dss-extensions / AltDSS-Go

Golang (CGo) bindings for AltDSS/DSS C-API. Tries to mimic the organization of the OpenDSS COM classes, within the scope of Go's language features.
BSD 3-Clause "New" or "Revised" License
7 stars 0 forks source link

Functions that should be public are Private #4

Closed dougchristie-DukeEnergy closed 6 months ago

dougchristie-DukeEnergy commented 6 months ago

There are a lot of function in dsslib.go that are private but need to be made public. Note all functions that start with a lowercase are private and cannot be accessed in the package. For example puVmagAngle() in dsslib.go is private and not public and cannot be used with an instance of *IBus, it same with kVBase as well.

dougchristie-DukeEnergy commented 6 months ago

I can make some of these changes if you do not mind me doing that? I did make the change locally and imported my local package and tried it out with my code and it worked.

PMeira commented 6 months ago

Thanks for pointing these. Let me think a bit about it first. It seems there are at least 51 functions. Of those, 30 can be adjusted without issues (puVmagAngle is fine as PUVMagAngle, so is kVArated as RatedkVA). The remaining 21 are mostly variations on kV, kVA, kvar and kW. Maybe something in the style of VoltageskV or Voltages_kV works. I'll review these 21 cases to see what fits better and push a commit later today.

(I personally don't like using pure units as names since that's vague, but OpenDSS uses that convention in a lot of places)

PMeira commented 6 months ago

Actually, looks like since most k... function are properties (Get_k.../Set_k...), only these 8 were changed: :smile:

Struct Old name New name
IBus kVBase Get_kVBase
IBus puVLL PUVLL
IBus puVmagAngle PUVMagAngle
IBus puVoltages PUVoltages
IMonitors dblFreq DblFreq
IMonitors dblHour DblHour
ITransformers strWdgCurrents StrWdgCurrents
IPVSystems kW Get_kW
dougchristie-DukeEnergy commented 6 months ago

Thanks for the fix I appreciate it.