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

fix/feat(parsers, MN): fix json parsing error and add coal data #7735

Merged
merged 2 commits into from
Jan 23, 2025

Conversation

consideRatio
Copy link
Contributor

@consideRatio consideRatio commented Jan 13, 2025

Issue

For #5906 that should resolve after a while if it works by its own.

Description

The JSON API used had a new format which broke the parser.

  • I made it so that wind data is now collected from another key clearly for the wind data based on seeing a wind power icon used to represent it.
    image
  • I ignored the JSON API key Songino as it wasn't obvious enough what to do about it, but it could be battery storage perhaps based on the icon, see discussion following MN production parser down #5906 (comment).
  • See also highlighted decision below

Highlighted decision

  • I mapped dts to coal, even without understanding what dts refers to.

Double check

  • I have tested my parser changes locally with poetry run test_parser "zone_key"
  • I have run pnpx prettier@2 --write . and poetry run format in the top level directory to format my changes.

@github-actions github-actions bot added parser python Pull requests that update Python code zone config Pull request or issue for zone configurations labels Jan 13, 2025
@consideRatio consideRatio marked this pull request as ready for review January 13, 2025 21:37
Comment on lines -98 to -106
# Calculated 'unknown' production from available data (consumption, import, solar, wind, tpp).
# 'unknown' consists of 92.8% coal, 5.8% oil and 1.4% hydro as per 2020; sources: IEA and IRENA statistics.
query_data["leftoverMW"] = round(
query_data["consumptionMW"]
- query_data["importMW"]
- query_data["solarMW"]
- query_data["windMW"],
13,
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This calculation maps exactly to the dts value, which is presented in the website https://ndc.energy.mn/ as:
image

Due to this, I figure it should be used directly. If it should be coal or unknown is not in any way obvious in my mind - whats clear is that Mongolia is mostly using coal though, and they didn't mind reporting this as some kind of fossil power plant with the icon.

@consideRatio
Copy link
Contributor Author

Force pushed a rebase on master.

Copy link
Member

@VIKTORVAV99 VIKTORVAV99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🎉

@VIKTORVAV99 VIKTORVAV99 enabled auto-merge (squash) January 23, 2025 21:14
@VIKTORVAV99 VIKTORVAV99 merged commit 77210a7 into electricitymaps:master Jan 23, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parser python Pull requests that update Python code zone config Pull request or issue for zone configurations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants