/py3-openstudio-linux-sdk

Unofficial python bindings for openstudio for linux in python 3. (Do not use yet, not configured)

Primary LanguagePythonMIT LicenseMIT

py3-openstudio-linux-sdk GitHub license Python 3.6 Build Status

Package the python bindings for openstudio for linux in python 3.

todo

  • add dockerfile to compile bindings
  • add clean up python script to fix py3 relative imports
  • package bundle
  • how to build bindings using docker
  • add tests
  • add sample use of sdk
  • example use of sdk and CLI in docker
  • how to track versions with openstudio versions

Installation

This package is only built for linux.

pip install py3_openstudio_linux_sdk

Example

import py3_openstudio_linux_sdk as openstudio

# Generate an osm model
model = openstudio.model.Model()
space = openstudio.model.Space(model)
space.setName("New Space")

for s in openstudio.model.getSpaces(model):
    print(s)
    
# Load a osm model
osmpath = openstudio.toPath("/path/to/osm/in.osm")
model = openstudio.model.Model.load(osmpath).get()

Troubleshooting

1. ImportError: libopenstudio_airflow_static.so: cannot open shared object file: No such file or directory

Ensure you are using Python 3.6 and add the python bindings path to the LD_LIBRARY_PATH environmental variable in linux:

export LD_LIBRARY_PATH=/usr/src/openstudio:$LD_LIBRARY_PATH

Credits