Skip to content

🐝 💎 Library and measures for translating between Honeybee JSON schema and OpenStudio Model schema (OSM)

License

Notifications You must be signed in to change notification settings

ladybug-tools/honeybee-openstudio-gem

Repository files navigation

Build Status

Ruby 2.7

honeybee-openstudio-gem

Library and measures for translating between Honeybee JSON schema and OpenStudio Model schema (OSM).

Run the measures of this repo using OpenStudio CLI

Running the measures using OpenStudio CLI requires no installation other than cloning this repo and installing OpenStudio.

  1. Write an OpenStudio Workflow (osw) JSON that passes honeybee model and simulation parameter JSON files to the measures. Here is a sample where the items in parentheses should be replaced with specific file paths:
{
    "measure_paths": [(PATH TO THIS REPOSITORY)/lib/measures"],
    "steps": [
        {
            "arguments": {"model_json": (PATH TO MODEL JSON)},
            "measure_dir_name": "from_honeybee_model"
        },
        {
            "arguments": {"simulation_parameter_json": (PATH TO SIMULATION PARAMETER JSON)},
            "measure_dir_name": "from_honeybee_simulation_parameter"
        }
    ]
}
  1. Call the OpenStudio CLI from command line, making sure to pass this repository's lib folder to the CLI using the -I (or --include) option. Here is a sample where the items in parentheses should be replaced with specific file paths:
"(OPENSTUDIO INSTALLATION PATH)/bin/openstudio.exe" -I (PATH TO THIS REPOSITORY)/lib run -m -w (PATH TO OSW FILE)

Local Development

  1. Clone this repo locally
git clone [email protected]:ladybug-tools/honeybee-openstudio-gem

# or

git clone https://github.com/ladybug-tools/honeybee-openstudio-gem
  1. Install dependencies: First install the OpenStudio Extension Gem following the installation instructions on the gem's github This will involve both the installation of OpenStudio and Ruby. Then, you must install the OpenStudio Extension Gem itself with:
gem install openstudio-extension

Then, the specific dependencies of this repository can be installed by running:

cd honeybee-openstudio-gem
bundle update
  1. Run Core Library Tests:
cd honeybee-openstudio-gem
bundle exec rake
  1. Run Measure Tests:
cd honeybee-openstudio-gem/lib/measures/from_honeybee_model/tests/
bundle exec ruby from_honeybee_model_test.rb

cd honeybee-openstudio-gem/lib/measures/from_honeybee_simulation_parameter/tests/
bundle exec ruby from_honeybee_simulation_parameter_test.rb
  1. Update doc_templates:
cd honeybee-openstudio-gem
bundle exec rake openstudio:update_copyright
  1. See all available rake tasks:
cd honeybee-openstudio-gem
bundle exec rake -T

About

🐝 💎 Library and measures for translating between Honeybee JSON schema and OpenStudio Model schema (OSM)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages