C:/URBANopt-cli-0.9.0/gems/ruby/2.7.0/gems/urbanopt-geojson-0.9.0/lib/urbanopt/geojson/feature.rb:277:in `block in find_feature_center': undefined method `/' for #<Array:0x000000000aec6af8> (NoMethodError)

uo run -f “~~~.geojson” -s “~~~honeybee_scenario.csv”
command was executed through cmd.

And the following error occurred.
C:/URBANopt-cli-0.9.0/gems/ruby/2.7.0/gems/urbanopt-geojson-0.9.0/lib/urbanopt/geojson/feature.rb:277:in block in find_feature_center': undefined method /’ for #Array:0x000000000aec6af8 (NoMethodError)

What should I do to fix this error? Any help please?

It looks like your GeoJSON file is not compatible with the URBANopt schema. Did you generate this GeoJSON from dragonfly? Or did you alter it in any way?

Thank you for responding to my question.

Actually I tried running URBANopt via python scripting. But at the very end, AssertionError: The URBANopt simulation failed to run. No results were found at: ./tests/simulation\run\honeybee_scenario error occurred.

So, uo run -f “~~~.geojson” -s “~~~honeybee_scenario.csv” command was executed in cmd when I tried to run URBANopt by typing directly.

All input files were obtained from https://github.com/ladybug-tools/dragonfly-energy. The image below show the full code.

If the process for creating a directory called ./tests/simulation\run\honeybee_scenario is omitted in my code, please let me know the process.

Your script there looks mostly correct but I would avoid using relative paths like that since URBANopt CLI does not handle these well (at least not on Windows where there’s a danger of exceeding the maximum number of characters in a file path).

Beyond that, I would ask you to check what version of dragonfly-energy you are using and make sure that it is the latest.

Following your suggestion, I first verified the version and proceeded to reinstall the latest version of the dragonfly-energy package, version 1.22.66.

Additionally, I changed the directory to an absolute path and made it shorter, as you advised.

However, despite my efforts, when I execute the Python code simulation_result = run_urbanopt(feature_geojson=geojson, scenario_csv=scenario_csv), I am still encountering the same problem that was previously present, started with run_dir 'D:/uo/tests/simulation/run/honeybee_scenario/ResidenceBuilding/' does not exist, simulation dir 'D:/uo/tests/simulation/run/honeybee_scenario/ResidenceBuilding/' out of date simulation_dir D:/uo/tests/simulation/run/honeybee_scenario/ResidenceBuilding/ is out of date, regenerating input files.

In addition, the version of URBANopt is 0.9.0 downloaded from http://urbanopt-cli-installers.s3-website-us-west-2.amazonaws.com/?prefix=0.9.0/

I executed the command uo create -p Project_1 at the homepath to create the project folder.
After that, I executed the command uo create -s Project_1/example_project.json to create the scenario csv file.
Finally, I executed the command uo run -s Project_1/baseline_scenario.csv -f Project_1/example_project.json to run the simulation and it was successful.
Based on this, I surmise that the entire path for the simulation should be consistent with the homepath drive.

However, I encountered an issue when trying to run URBANopt using Python code. I noticed that the path for the simulation files is on the D drive, not the C drive of the homepath when I run the Python code. I am currently investigating and working towards finding a solution to this issue.

The image below depicts the successful execution of the process in the command prompt.

Unfortunately, I changed all paths for simulation to C drive and executed the python code, but the same error occurred.


With great care, I have relocated all the paths of the executed code and related inputs to a sub-path of the homepath.
Additionally, I have made further efforts to simplify the code.
The content of the error has been changed accordingly.
Although the URBANopt appeared to run smoothly, I encountered the following error towards the end of the process:

Error running command: 'C:/URBANopt-cli-0.9.0/OpenStudio/bin/openstudio.exe --bundle 'C:/Users/MOOYEOL-OH/uo_test_py/urbanopt_model/Gemfile' --bundle_path 'C:/Users/MOOYEOL-OH/uo_test_py/urbanopt_model/.bundle/install/' run -w 'C:/Users/MOOYEOL-OH/uo_test_py/urbanopt_model/run/honeybee_scenario/OfficeBuilding/in.osw' 2>&1 > "C:/Users/MOOYEOL-OH/uo_test_py/urbanopt_model/run/honeybee_scenario/OfficeBuilding/in.osw.log"'

and

FAILED SIMULATION IDs: OfficeBuilding

The symptom of the error is that no files are created in the 000_from_honeybee_model, 001_default_feature_reports, generated_files folders created in the run/honeybee_scenario/OfficeBuilding path.



I will continue my reply in a new topic below.

Thank you.