Hello there,
I have a GeoJSON file containing four buildings and an EPW weather data file. When I import these files into Grasshopper DragonFly, the simulation completes without error.
However, when I try to run the simulation outside Grasshopper (e.g., in VS Code on Windows) using the code below, I encounter numerous issues.
from pathlib import Path
from ladybug.epw import EPW
from dragonfly.model import Model
from dragonfly_energy.writer import model_to_urbanopt
from dragonfly_energy.run import prepare_urbanopt_folder, run_urbanopt, run_default_reportGEOJSON = Path(r"C:\Chania\Community_Model.geojson")
EPW = Path(r"C:\Chania\GRC_CR_Chania.167470_TMYx.epw")
OUTDIR = Path(r"C:\Chania\uo_results")
CPU = 8model, location = Model.from_geojson(str(GEOJSON))
if location is None:
location = EPW(str(EPW)).locationfeature_geojson, hbjsons, hb_models = model_to_urbanopt(
model,
location=location,
folder=str(OUTDIR)
)scenario_csv = prepare_urbanopt_folder(feature_geojson, cpu_count=CPU, verbose=False)
osm, idf, sql, zsz, rdd, html, err = run_urbanopt(feature_geojson, scenario_csv)csv_report, json_report = run_default_report(feature_geojson, scenario_csv)
print(“OSM files:”, osm)
print(“IDF files:”, idf)
print(“SQL files:”, sql)
print(“HTML summary reports:”, html)
print(“URBANopt scenario report CSV:”, csv_report)
The below is the logs:
C:\Chania>uo process --default -f “C:\Chania\uo_results\Community_Model.geojson” -s “C:\Chania\uo_results\honeybee_scenario.csv”
Top level ::CompositeIO is deprecated, require ‘multipart/post’ and useMultipart::Post::CompositeReadIOinstead!
Top level ::Parts is deprecated, require ‘multipart/post’ and useMultipart::Post::Partsinstead!
Post-processing URBANopt results
Defaulting bundle_install_path to bundle’s local config value: ‘C:/Chania/uo_results/.bundle/install’
Bundle final path is set to: C:/Chania/uo_results/.bundle/install
E, [2025-11-08T20:42:15.689993 #19972] ERROR – : Feature Building_1_0 failed to run!
E, [2025-11-08T20:42:15.691341 #19972] ERROR – : Feature Building_1_1 failed to run!
E, [2025-11-08T20:42:15.692506 #19972] ERROR – : Feature Building_1_2 failed to run!
E, [2025-11-08T20:42:15.693676 #19972] ERROR – : Feature Building_1_3 failed to run!
C:/URBANopt-cli-1.0.2/gems/ruby/3.2.0/gems/urbanopt-reporting-1.0.0/lib/urbanopt/reporting/default_reports/timeseries_csv.rb:191:inblock in save_data': undefined method’ for nil:NilClass (NoMethodError)n = @data[@column_names[0]].size - 1 ^^^^^^^^^^^^^^^^^^ from C:/URBANopt-cli-1.0.2/gems/ruby/3.2.0/gems/urbanopt-reporting-1.0.0/lib/urbanopt/reporting/default_reports/timeseries_csv.rb:189:in `open' from C:/URBANopt-cli-1.0.2/gems/ruby/3.2.0/gems/urbanopt-reporting-1.0.0/lib/urbanopt/reporting/default_reports/timeseries_csv.rb:189:in `save_data' from C:/URBANopt-cli-1.0.2/gems/ruby/3.2.0/gems/urbanopt-reporting-1.0.0/lib/urbanopt/reporting/default_reports/scenario_report.rb:147:in `save' from C:/URBANopt-cli-1.0.2/gems/ruby/3.2.0/gems/urbanopt-cli-1.0.2/lib/uo_cli.rb:1513:in `<module:CLI>' from C:/URBANopt-cli-1.0.2/gems/ruby/3.2.0/gems/urbanopt-cli-1.0.2/lib/uo_cli.rb:23:in `<module:URBANopt>' from C:/URBANopt-cli-1.0.2/gems/ruby/3.2.0/gems/urbanopt-cli-1.0.2/lib/uo_cli.rb:22:in `<top (required)>' from <internal:C:/urbanopt-cli-1.0.2/ruby/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require' from <internal:C:/urbanopt-cli-1.0.2/ruby/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require' from C:/URBANopt-cli-1.0.2/gems/ruby/3.2.0/gems/urbanopt-cli-1.0.2/bin/uo:3:in `<top (required)>' from C:/URBANopt-cli-1.0.2/gems/ruby/3.2.0/bin/uo:25:in `load' from C:/URBANopt-cli-1.0.2/gems/ruby/3.2.0/bin/uo:25:in `<main>'OSM files:
IDF files:
SQL files:
HTML summary reports:
URBANopt scenario report CSV: C:\Chania\uo_results\run\honeybee_scenario\default_scenario_report.csv
I would appreciate it if you could kindly help me to detect the problem.
Thank you very much for your time and assistance.
Sincerely,
Behnam