Skip to content

PyDSS is incompatible with OpenDSSDirect.py v0.8.1 #121

@daniel-thom

Description

@daniel-thom

Here is a partial backtrace when running PyDSS on a circuit that has a Vsource element. OpenDSSDirect v0.8 has a new restriction that disallows calling AllVariableNames() when the active element is not a power conversion element (PCElement). The old docstring said, "Array of strings listing all the published variable names, if a PCElement. Otherwise, null string.", so I suspect that this was always invalid and they are now correctly failing the operation.

PyDSS/dssInstance.py:324: in CreateDssObjects
    dssObjectsByClass[ClassName][ElmName] = create_dss_element(Class, Name)
PyDSS/dssElementFactory.py:14: in create_dss_element
    return dssElement(dss_instance)
PyDSS/dssElement.py:84: in __init__
    for VarName in dssInstance.CktElement.AllVariableNames():
../../miniconda3/envs/pydsstest/lib/python3.10/site-packages/opendssdirect/CktElement.py:78: in AllVariableNames
    return CheckForError(get_string_array(lib.CktElement_Get_AllVariableNames))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <dss.IDSS.IDSS object at 0x7fc6f0456d60>, result = []

    def _check_for_error(self, result=None):
        '''Checks for an OpenDSS error. Raises an exception if any, otherwise returns the `result` parameter.'''
        if self._errorPtr[0]:
            error_num = self._errorPtr[0]
            self._errorPtr[0] = 0
>           raise DSSException(error_num, self._get_string(self._lib.Error_Get_Description()))
E           dss._cffi_api_util.DSSException: (#100004) The active circuit element is not a PC Element

../../miniconda3/envs/pydsstest/lib/python3.10/site-packages/dss/_cffi_api_util.py:145: DSSException
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> entering PDB >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> PDB post_mortem (IO-capturing turned off) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> /Users/dthom/miniconda3/envs/pydsstest/lib/python3.10/site-packages/dss/_cffi_api_util.py(145)_check_for_error()
-> raise DSSException(error_num, self._get_string(self._lib.Error_Get_Description()))
(Pdb) up
> /Users/dthom/miniconda3/envs/pydsstest/lib/python3.10/site-packages/opendssdirect/CktElement.py(78)AllVariableNames()
-> return CheckForError(get_string_array(lib.CktElement_Get_AllVariableNames))
(Pdb) up
> /Users/dthom/sandboxes/PyDSS/PyDSS/dssElement.py(84)__init__()
-> for VarName in dssInstance.CktElement.AllVariableNames():
(Pdb) up
> /Users/dthom/sandboxes/PyDSS/PyDSS/dssElementFactory.py(14)create_dss_element()
-> return dssElement(dss_instance)
(Pdb) up
> /Users/dthom/sandboxes/PyDSS/PyDSS/dssInstance.py(324)CreateDssObjects()
-> dssObjectsByClass[ClassName][ElmName] = create_dss_element(Class, Name)
(Pdb) ClassName, ElmName
('Vsources', 'Vsource.source')

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions