Skip to content

Conversation

@Koolvansh07
Copy link

Pull Request

Description

This PR standardizes all country codes in the solar-consumer project to follow the ISO 3166-1 alpha-3 standard as requested in issue #157.

Changes made:

  • gb → gbr_gb (Great Britain - excluding Northern Ireland)
  • nl → nld (Netherlands)
  • de → deu (Germany)
  • bebel (Belgium)
  • ind_rajasthan → ind_rj (India - Rajasthan)

Files updated:

  • solar_consumer/fetch_data.py - Updated country code mappings and default parameters
  • solar_consumer/app.py - Updated country code conditionals and defaults
  • solar_consumer/save/save_data_platform.py - Updated all country code references
  • solar_consumer/save/save_site_database.py - Updated all country code references
  • tests/unit/test_fetch_data.py - Updated test cases with new codes
  • tests/unit/test_save_forecast.py - Updated test cases with new codes
  • tests/integration/test_save_nl_to_data_platform.py - Updated integration test
  • README.md - Updated documentation with new country codes
  • .example.env - Updated default configuration

All country codes now follow the ISO 3166-1 alpha-3 standard, maintaining functionality while improving standardization.

Fixes #157

How Has This Been Tested?

  • Yes

Testing performed:

  • All Python files compile without syntax errors
  • Verified all country code mappings are correctly updated across the codebase
  • Verified all test files reference the new country codes
  • Checked that no old country codes remain in function signatures or conditionals
  • Created verification scripts to validate changes

Test results:

  • 9 files changed: 57 insertions(+), 57 deletions(-)
  • All syntax validation passed
  • All country code references updated consistently

Note: Full unit and integration tests require dependencies to be installed. The changes maintain the same logic flow, only updating the country code strings.

Data processing sanity check:

  • Yes - No data processing logic was changed, only country code identifiers were updated

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 (updated existing tests)
  • I have checked my code and corrected any misspellings

Fixes openclimatefix#157

Changes:
- gb -> gbr_gb (Great Britain)
- nl -> nld (Netherlands)
- de -> deu (Germany)
- be -> bel (Belgium)
- ind_rajasthan -> ind_rj (India - Rajasthan)

Updated files:
- solar_consumer/fetch_data.py
- solar_consumer/app.py
- solar_consumer/save/save_data_platform.py
- solar_consumer/save/save_site_database.py
- tests/unit/test_fetch_data.py
- tests/unit/test_save_forecast.py
- tests/integration/test_save_nl_to_data_platform.py
- README.md
- .example.env

All country codes now follow ISO 3166-1 alpha-3 standard.
@Koolvansh07
Copy link
Author

Saw this issue was open and had some time, so figured I'd tackle it. Changed the country codes to the ISO standard as requested. Let me know if I missed anything!

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.

Standardise countries ISO_3166-1_alpha-3

1 participant