{"id":24151,"library":"opendsm","title":"OpenDSM","description":"OpenDSM provides standard methods for predicting building energy usage, supporting hourly, daily, and billing models with clustering and baseline metrics. Current version 1.2.7, requires Python >=3.10, and is actively maintained on GitHub.","status":"active","version":"1.2.7","language":"python","source_language":"en","source_url":"http://github.com/opendsm/opendsm","tags":["energy","building","modeling","efficiency","clustering","hourly","daily","billing"],"install":[{"cmd":"pip install opendsm","lang":"bash","label":"Standard install"}],"dependencies":[{"reason":"Core data manipulation","package":"pandas","optional":false},{"reason":"Numerical operations","package":"numpy","optional":false},{"reason":"Clustering and regression models","package":"scikit-learn","optional":false},{"reason":"Plotting","package":"matplotlib","optional":true}],"imports":[{"note":"Direct import of the package does not expose the top-level class; must import specifically.","wrong":"import opendsm","symbol":"OpenDSM","correct":"from opendsm import OpenDSM"},{"note":"HourlyModel is in the hourly submodule, not at package root.","wrong":"from opendsm import HourlyModel","symbol":"HourlyModel","correct":"from opendsm.hourly import HourlyModel"},{"note":"DailyModel is in the daily submodule.","wrong":"from opendsm import DailyModel","symbol":"DailyModel","correct":"from opendsm.daily import DailyModel"},{"note":"BillingModel is in the billing submodule.","wrong":"from opendsm import BillingModel","symbol":"BillingModel","correct":"from opendsm.billing import BillingModel"},{"note":"Metrics module is named 'metrics', not 'evaluation'.","wrong":"from opendsm.evaluation import BaselineMetrics","symbol":"BaselineMetrics","correct":"from opendsm.metrics import BaselineMetrics"}],"quickstart":{"code":"from opendsm import OpenDSM\nfrom opendsm.hourly import HourlyModel\nimport pandas as pd\n\n# Create sample hourly energy usage data\nimport numpy as np\ndates = pd.date_range('2023-01-01', periods=8760, freq='H')\nenergy = np.random.rand(8760) * 100\ntemp = np.random.rand(8760) * 35\ndf = pd.DataFrame({'energy': energy, 'temperature': temp}, index=dates)\n\n# Initialize OpenDSM with a project name\nproject = OpenDSM('my_project')\n\n# Add data\nproject.add_data(df, energy_column='energy', temperature_column='temperature')\n\n# Run hourly model\nmodel = HourlyModel(project)\nmodel.fit()\nprint(model.results())","lang":"python","description":"Quickstart example loading hourly data and fitting an hourly model."},"warnings":[{"fix":"Use from opendsm.logger import logger and configure via logger.setLevel(...) instead of direct logging calls.","message":"In v1.2.0, the logging interface changed to a modern logger. If you previously configured logging via the old interface, you must update your code to use the new logging module from opendsm.logger.","severity":"breaking","affected_versions":">=1.2.0"},{"fix":"Use from opendsm.metrics import BaselineMetrics to access metrics.","message":"Daily and billing models now use BaselineMetrics natively in v1.2.0. If you relied on custom metric calculations, you may need to update your code to use the BaselineMetrics class.","severity":"breaking","affected_versions":">=1.2.0"},{"fix":"Upgrade to v1.2.6: pip install opendsm>=1.2.6","message":"The old 'from_series' method for daily data class instantiation has a bug fixed in v1.2.6. If you were using it before, upgrade to v1.2.6+ to avoid issues.","severity":"deprecated","affected_versions":"<1.2.6"},{"fix":"Set seed in clustering_settings: clustering_settings = {'seed': 42}.","message":"Spectral clustering results may not be deterministic across runs unless you set the seed via the clustering settings. Use seed=42 or similar.","severity":"gotcha","affected_versions":">=1.2.4"},{"fix":"Documentation for data sufficiency settings is limited; use with caution.","message":"Data sufficiency can be modified via a settings dictionary but this is intended for R&D; defaults may differ from production standards.","severity":"gotcha","affected_versions":">=1.2.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Check Python version: python --version. Upgrade to Python 3.10+ and reinstall: pip install opendsm","cause":"OpenDSM requires Python >=3.10. If your environment uses an older Python version, installation will fail.","error":"ModuleNotFoundError: No module named 'opendsm'"},{"fix":"Use: from opendsm import OpenDSM","cause":"Using 'import opendsm' and then accessing opendsm.OpenDSM fails because the package does not export classes at the top level when imported as a module.","error":"AttributeError: module 'opendsm' has no attribute 'OpenDSM'"},{"fix":"Use: from opendsm.hourly import HourlyModel","cause":"HourlyModel is not in the top-level package; it is in a submodule.","error":"ImportError: cannot import name 'HourlyModel' from 'opendsm'"},{"fix":"Ensure the DataFrame contains the specified temperature column name.","cause":"When adding data, if you specify a temperature column, that column must exist in the DataFrame.","error":"ValueError: Data must have a 'temperature' column when temperature_column is set"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}