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

Issue with country code #15

Open
ClareO9 opened this issue Apr 10, 2023 · 1 comment
Open

Issue with country code #15

ClareO9 opened this issue Apr 10, 2023 · 1 comment

Comments

@ClareO9
Copy link

ClareO9 commented Apr 10, 2023

Hi, when trying to use the EntsogPandasClient I get the following error on 'country_code'.

TypeError: query_operational_data() got an unexpected keyword argument 'country_code'

I would like to pull the data by country but I also struggled with identifying a way to do this when looking at the ENTSOG API user manual as well. It looks like in mappings.py that there was code developed to map the operator labels to countries, but not sure how to resolve the error when running the sample code for NL. The gazprom example with the plot runs perfectly.

Thank you!

@nhcb
Copy link
Owner

nhcb commented Apr 10, 2023

Hi @ClareO9,

Thanks for using the package.

The issue you have encountered is due to me not having updated the documentation.

I have removed the country functionality a while back due to the ENTSOG API requiring either an operator or a pointdirection parameter, but not a country key. Therefore, I had to iterate through operators within an country which was very error prone. Therefore, I decided it would be better to retrieve simply all data instead.

It's still possible to retrieve only the point_directions from the Netherlands. You will need to get the full list of direction keys from the other API endpoints. However, I recommend that you should obtain the full operational_point_data, that is do not enter point_direction, as this additional parameter is also somewhat error prone (especially if you have more than 50 point direction keys).

keys = ... # Dutch pointdirecton keys
data = client.query_operational_point_data(start = start, end = end, indicators = ['physical_flow'], point_directions = keys, verbose = False)
# Preferred:
data = client.query_operational_point_data(start =start, end = end, indicators = ['physcal_flow'])
# Filter afterward

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

2 participants