-
Notifications
You must be signed in to change notification settings - Fork 3
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
Alternate way of fetching resources #49
base: master
Are you sure you want to change the base?
Conversation
labels=LabelFilter(contains_all=[label]), | ||
limit=None, | ||
assets = self._cognite_client.power_assets.list( | ||
grid_type=grid_type, base_voltage=base_voltage, **{"metadata": {"type": power_type}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**{"x":"y"} is commonly also known as x="y"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note power_type may be None
labels=LabelFilter(contains_all=[label]), | ||
limit=None, | ||
) | ||
assets = [a for a in assets if a.external_id in [r.target_external_id for r in rels]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
target_external_ids = {r.target_external_id for r in rels}
and then in (set) here please
labels=LabelFilter(contains_all=[label]), | ||
limit=None, | ||
) | ||
assets = [a for a in assets if a.external_id in [r.source_external_id for r in rels]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
likewise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:50:
@@ -1,5 +1,4 @@ | |||
import sys |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import sys | |
import grouphug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤗
with this pr it takes 2-3 secs to run client.substations.list().shunt_compensators(), but 1 minute to run client.substations.list().busbar_sections()