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

feat: raise error if generation post>A x capacity #102

Merged
merged 3 commits into from
Jan 8, 2025

Conversation

suvanbanerjee
Copy link
Contributor

Pull Request

Description

Add HTTP 422 exception when trying to post data more than site_capacity_kw*capacity_factor

Fixes #87

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
Please also list any relevant details for your test configuration

  • Yes

If your changes affect data processing, have you plotted any changes? i.e. have you done a quick sanity check?

  • Yes

Checklist:

  • My code follows OCF's coding style guidelines
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked my code and corrected any misspellings

@suvanbanerjee
Copy link
Contributor Author

@peterdudfield, I’ve made the changes to the India client. I believe I’ll need to do the same for dummydb, but in that case, the post function is just a placeholder. Also, could you guide me on how to test the changes? Are there any relevant docs available? I’m currently unable to test them.

@suvanbanerjee
Copy link
Contributor Author

@peterdudfield bumping this up

@peterdudfield
Copy link
Contributor

Hi @suvanbanerjee

  1. Yea dont worry about dummydb.
  2. For testing, adding a test here would be great - https://github.com/openclimatefix/india-api/blob/main/src/india_api/internal/inputs/indiadb/test_indiadb.py#L102

@suvanbanerjee suvanbanerjee marked this pull request as ready for review January 3, 2025 18:18
@suvanbanerjee
Copy link
Contributor Author

@peterdudfield i have added the test can you please review pr

@suvanbanerjee
Copy link
Contributor Author

@peterdudfield bumping this up

Copy link
Contributor

@peterdudfield peterdudfield left a comment

Choose a reason for hiding this comment

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

one small change, but otherwise looks good

Copy link
Contributor

@peterdudfield peterdudfield left a comment

Choose a reason for hiding this comment

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

Thank you very much for this

@peterdudfield peterdudfield merged commit 0b6f403 into openclimatefix:main Jan 8, 2025
4 checks passed
@peterdudfield
Copy link
Contributor

@all-contributors please add @suvanbanerjee for code

Copy link
Contributor

@peterdudfield

I've put up a pull request to add @suvanbanerjee! 🎉

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

Successfully merging this pull request may close these issues.

Raise error if generation post > A x capacity
2 participants