-
Notifications
You must be signed in to change notification settings - Fork 22
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
dss.Generators kW function is missing #63
Comments
Since you didn't provide the info requested in issue template, there's not much we can do.
It works for me, a complete sample: import inspect
import opendssdirect as dss
for name, function in inspect.getmembers(dss.Generators):
if callable(function) and not name.startswith('_'):
print(f'dss.Generators.{name}')
print()
print(dss.__version__) Output:
Don't know why you'd do that though, there is |
Thank you for your reply. The
Also:
Returns this error: |
@julioolvera1 One possibility is that your installation is broken somehow. There have been no recent changes about the generators and the OpenDSSDirect.py/opendssdirect/Generators.py Line 150 in 64e03a1
But there could be another issue:
This is invalid, you'd be overwriting the
If you already have code that uses the COM syntax, you might prefer to use DSS Python (you already have it installed, it's a dependency) since it tries to be very compatible with COM. You can still import OpenDSSDirect.py and use it together, including EDIT: Thanks for adding these:
I tested in nearly the same setup, working OK. |
I see, I think that is the root of the problem. I was overwriting the kW function instead of assigning a new value. I haven't considered the option of using DSS Python. In your opinion, are there any advantages between OpenDSSDirect and DSS Python? Is there a difference in performance or it's just that the syntax is more COM-like? Thank you for your help. |
It's mainly the syntax. ODD.py has a couple of extras in the Python side (such as the dataframes, docs). DSS-Python has a few extensions/newer classes (not present in COM) that weren't ported to ODD.py yet, as well as mapping from the Error interface to Python exceptions more frequently. These differences should be gone after #55 is done. There is a new batch of extensions cooking in the Pascal side of OpenDSS too. The only other notable difference (that I can think right now) is that, for backwards compatibility, ODD.py uses lists. DSS-Python returns NumPy arrays for most things. But there is a plan to change that soon too (#60). They can be used together because they bind to the same instance of the DSS C-API library. Besides being multi-platform, the library itself removes a lot of the overhead from the COM interface and we're slowly making changes to add more error checking and handle performance issues. So, in the end, both Python modules are generally faster (sometimes several times) than the COM alternative. |
dss.version
Out[497]: '0.3.7'
When using the following loop to get the functions for the generators, the "kW" function is missing.
for name, function in inspect.getmembers(dss.Generators):
if callable(function) and not name.startswith('_'):
print(f'dss.Generators.{name}')
The text was updated successfully, but these errors were encountered: