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

cim-graph error when checking if PowerElectronicsConnections exist in IEEE123 model #1771

Closed
Tylores opened this issue Apr 8, 2024 · 2 comments
Assignees

Comments

@Tylores
Copy link

Tylores commented Apr 8, 2024

Describe the bug
DEBUG:main:<class 'cimgraph.data_profile.rc4_2021.gridappsd_cim_profile_rc4_2021.PowerElectronicsConnection'>
DEBUG:main:Traceback (most recent call last):
File "/home/tylor/dev/micro-apps/micro-apps/power_factor/power_factor.py", line 491, in
app = PowerFactor(gapps, sim)
File "/home/tylor/dev/micro-apps/micro-apps/power_factor/power_factor.py", line 289, in init
self.mrids, self.electronics = get_power_electronics(self.mrids)
File "/home/tylor/dev/micro-apps/micro-apps/power_factor/power_factor.py", line 219, in get_power_electronics
if not network.graph[PowerElectronicsConnection]:
KeyError: <class 'cimgraph.data_profile.rc4_2021.gridappsd_cim_profile_rc4_2021.PowerElectronicsConnection'>

To Reproduce

        cim_profile = 'rc4_2021'
        cim = importlib.import_module('cimgraph.data_profile.' + cim_profile)
        mrid = "_C1C3E687-6FFD-C753-582B-632A27E28507"

        feeder = cim.Feeder(mRID=mrid)
        params = ConnectionParameters(
            url="http://localhost:8889/bigdata/namespace/kb/sparql",
            cim_profile=cim_profile)

        bg = BlazegraphConnection(params)
        network = FeederModel(
            connection=bg,
            container=feeder,
            distributed=False)
        utils.get_all_data(network)

        electronics = {}
        if not network.graph[PowerElectronicsConnection]:

Additional context
Other models appear to work fine or at least don't crash when there is no connection found.

@craig8
Copy link
Contributor

craig8 commented Apr 8, 2024

@AAndersn this is a top level api for the network.graph calls we can easily handle the case where there is non-defined and return None as a response. This would probably be the best course, but I thought I would give you a heads up if that's the way you wanted this to work.

@afisher1 @poorva1209 your input would be valuable as well.

@poorva1209
Copy link
Contributor

Not an issue anymore. It was an API usage error.

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

3 participants