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

Duplicate area code in mappings.py leading to bugs #369

Open
morrisonmaxw opened this issue Nov 18, 2024 · 0 comments
Open

Duplicate area code in mappings.py leading to bugs #369

morrisonmaxw opened this issue Nov 18, 2024 · 0 comments

Comments

@morrisonmaxw
Copy link

Area code 10Y1001A1001A82H is used for both DE_LU and LU_BZN. It looks like only DE_LU is valid? Entsoe Areas Ref

This is leading to unexpected results in data processing.

One example is I am looping through country codes for EntsoePandasClient.query_day_ahead_prices and get a duplicate result for DE_LU and LU_BZN.

Another example is I am extracting mappings.py into JSON to build my data model and LU_BZN gets omitted:

`import json
from entsoe import mappings

area = mappings.Area
psrtype = mappings.PSRTYPE_MAPPINGS
docstatus = mappings.DOCSTATUS
bsntype = mappings.BSNTYPE
marketagreementtype = mappings.MARKETAGREEMENTTYPE
documenttype = mappings.DOCUMENTTYPE
processtype = mappings.PROCESSTYPE
neighbours = mappings.NEIGHBOURS

def enum_to_json(enum_class):
members = []
for member in enum_class:
print(member) # Debugging line
members.append({
"area_key": member.name,
"code": member.code,
"meaning": member.meaning,
"timezone": member.tz
})
return members

data = {
"areas": enum_to_json(area),
"psrtype": psrtype,
"docstatus": docstatus,
"bsntype": bsntype,
"marketingagreementtype": marketagreementtype,
"documenttype": documenttype,
"process_types": processtype,
"neighbours": neighbours
}

json_output = json.dumps(data, indent=4)

with open('entsoe_mappings.json', 'w') as file:
file.write(json_output)`

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

1 participant