transition-zero / tz-client

A client repository for accessing FEO data programmatically.
https://docs.feo.transitionzero.org
Apache License 2.0
21 stars 4 forks source link

Get an alias from a node #132

Open isabellasoldner opened 4 months ago

isabellasoldner commented 4 months ago

Feature Type

Problem Description

We want to enter a node id and get a list of its aliases


# Can't get aliases from a node. Can only get a node from an alias!
# Maybe there is a way using the api directly. Don't want to load entire alias table.

# ENTSO-E IDs are returned in the records dataframe:

mapping = records.drop_duplicates(subset='node_id').set_index('id').properties.apply(lambda x: [id['entsoe_unit_id'] for id in x['entsoe_units']]).explode()
mapping

Feature Description

node_aliases = node.alias

would return {"GEM_unit_id":"G1231232", "entsoe_unit_id":23123} and maybe even

node.alias.entsoe_unit_id would return 23123