{"id":24269,"library":"properscoring","title":"Properscoring","description":"A Python library for evaluating probabilistic forecasts using proper scoring rules. Version 0.1 is the only release; the project is in maintenance mode with no recent updates. It provides implementations of the Continuous Ranked Probability Score (CRPS), Brier score, and related metrics for forecast verification.","status":"maintenance","version":"0.1","language":"python","source_language":"en","source_url":"https://github.com/TheClimateCorporation/properscoring","tags":["scoring-rules","forecast-verification","crps","probability","ensembles"],"install":[{"cmd":"pip install properscoring","lang":"bash","label":"PyPI install"}],"dependencies":[{"reason":"Core dependency for array operations and numerical computations.","package":"numpy","optional":false},{"reason":"Required for special functions (e.g., erf) used in CRPS calculations.","package":"scipy","optional":false}],"imports":[{"note":"Most commonly used function for CRPS from ensemble forecasts.","symbol":"crps_ensemble","correct":"from properscoring import crps_ensemble"},{"note":"For parametric Gaussian forecasts.","symbol":"crps_gaussian","correct":"from properscoring import crps_gaussian"}],"quickstart":{"code":"import numpy as np\nfrom properscoring import crps_ensemble\n\n# Ensemble forecasts (10 members)\nensemble = np.random.randn(10, 100)\n# Observations\nobservations = np.random.randn(100)\n\n# Calculate CRPS for each observation\ncrps = crps_ensemble(observations, ensemble)\nprint(crps.mean())","lang":"python","description":"Compute the Continuous Ranked Probability Score (CRPS) for ensemble forecasts against observations."},"warnings":[{"fix":"Ensure observations have shape (n,) or (1, n) and ensemble has shape (n_ens, n); use `ensemble.T` if needed.","message":"Input arrays for `crps_ensemble` must be 1D or 2D with observations as first argument and ensemble as second. If dimensions are mismatched (e.g., shapes (n,) vs (m, n) transposed), you may get incorrect results or broadcasting issues.","severity":"gotcha","affected_versions":"<=0.1"},{"fix":"Use Python 3.8 or 3.9 for guaranteed compatibility, or install via conda-forge: `conda install -c conda-forge properscoring`.","message":"The library has no official support for Python 3.10+ (no wheels for recent Python versions). Installing on Python 3.10 or 3.11 requires building from source, which may fail if compilation tools are missing.","severity":"gotcha","affected_versions":">=0.1"},{"fix":"Manually remove or impute NaN values before calling the function.","message":"In v0.1, `crps_ensemble` does not handle NaN values; passing arrays with NaN can cause silent errors or incorrect results.","severity":"breaking","affected_versions":"0.1"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install properscoring` and verify import with `import properscoring`.","cause":"Older version or mis-installation. The import name is correct; ensure properscoring is installed.","error":"ImportError: cannot import name 'crps_ensemble'"},{"fix":"Reshape: observations should be (n,) or (1, n), ensemble should be (m, n). Use `np.atleast_2d(obs)` and check ensemble shape.","cause":"Input arrays of incompatible shapes to `crps_ensemble`.","error":"ValueError: operands could not be broadcast together with shapes ..."},{"fix":"Restart the interpreter and avoid using the function name as a variable.","cause":"Accidentally shadowed the `crps_ensemble` function with a variable (e.g., `crps_ensemble = ...`).","error":"TypeError: 'numpy.float64' object is not callable"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}