Repository navigation
Conversation
napattan
requested review from
chahank,
emanuel-schmid and
peanutfun
as code owners
November 6, 2026 03:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes proposed in this PR:
ValueErrorinworld_bank()(climada/util/finance.py) whendownload_world_bank_indicator()returns an all-NaNseries (close_val.emptyafter.dropna()), and includeValueErrorinincome_group()'s fallback exception tuple so missing World Bank income group rows fall back cleanly tonat_earth_adm0().nat_earth_adm0()inclimada/util/finance.pyto check fallback ISO code attributes("ADM0_A3", "ISO_A3", "WB_A3", "ADM0_A3_US")(resolvingESHandALAlookup failures in missing worldbank indicators #1331) and distinguish missing country records (close_val is None) from legitimate0.0GDP records (such asHMD), logging a warning when Natural Earth reports0.world_bank_wealth_account()inclimada/util/finance.pyagainst all-NaNNW.PCA.TOindicator series andnp.isnan(fac)whenwealth2gdp()returns(None, np.nan), falling back tofac = 1.0with a warning instead of propagatingNaN.climada/util/test/test_finance.py(test_ne_fallback_iso_and_zero_gdp_pass,test_wb_empty_indicator_raises_value_error,test_pca_missing_wealth2gdp_factor_pass).Reproducible Verification Script (#1331)
Below is a self-contained script verifying all four failure modes reported in #1331 (
world_bankempty indicatorValueError,income_groupfallback to Natural Earth,nat_earth_adm0fallback ISO attributes & zero-GDP handling, andworld_bank_wealth_accountNaNwealth-to-GDP factor fallback):This PR fixes #1331
PR Author Checklist
develop)PR Reviewer Checklist