-
Notifications
You must be signed in to change notification settings - Fork 963
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
Add CN-MN exchange and parser #6283
base: master
Are you sure you want to change the base?
Conversation
/review |
PR Analysis
PR Feedback
How to useInstructions
|
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.
We have already created some of this functionality to ensure it's consistent across parsers but it don't work until the RU.py parser has been upgraded. So I would like to hold of with this until that is upgraded.
(Some of the background for that is that we are doing a code freeze over the holidays anyhow so while we will be merging things in contrib they won't be deployed until early jan so there is no hurry to get this merged.)
I could not get this to work when I tested it as no matching data could be found, I'll try again tomorrow. |
zoneKey=sorted_zone_keys, | ||
# We calculate the flow with the total imports and the MN->RU-2 exchange, as Mongolia has only two connections | ||
netFlow=query_data["importMW"] + data["netFlow"], | ||
source="https://ndc.energy.mn/", |
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.
The current implementation seems to be inversed.
Please double check this yourself.
It would also be good if we could add a test or two for this so we can validate the expected behavior.
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.
seems to be inversed
I think it isn't.
Let's see:
CN->MN + RU->MN = Total Imports
CN->MN = Total Imports + MN->RU
I'll work on those tests. It would be optimal to be able to test the parser without requiring the sources to have matching data.
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.
the easiest way would probably be to add snapshot tests using mock data. Like I did in #6285.
That way it don't rely on an online source, changing data or creating manual tests are are both logic intensive and hard to maintain long term.
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.
I was thinking of doing something similar to what I did for the REE parser but I will take a look at these snapshot tests.
@florianscheidl I just come to think about your project in relation to this. Would it be useful for you to know the total imports/exports in some form? If so perhaps we can begin shaping the requirements for it as we don't store that at the moment? (MN is not the only zone that has this data in some form.) |
Hey, @VIKTORVAV99, that would be interesting to pursue! Let's chat about it some time soon. |
Description
This PR adds the CN->MN exchange. To calculate the exchange, I used the total imports data from the MN source, and the MN->RU-2 from the Russian source. This is based on the assumption that Mongolia only trades with this two countries. I think this is a reasonable assumption, given geography and Mongolian grid.
Preview
Double check
poetry run test_parser "zone_key"
pnpx prettier --write .
andpoetry run format
to format my changes.