https://github.com/ladybug-tools/honeybee-anvil
Honeybee Anvil Docker image
https://github.com/ladybug-tools/honeybee-anvil
Last synced: 9 months ago
JSON representation
Honeybee Anvil Docker image
- Host: GitHub
- URL: https://github.com/ladybug-tools/honeybee-anvil
- Owner: ladybug-tools
- Created: 2017-12-20T22:07:18.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-09-21T16:06:52.000Z (over 4 years ago)
- Last Synced: 2024-01-25T11:38:02.814Z (over 2 years ago)
- Language: Python
- Size: 5.85 MB
- Stars: 0
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Honeybee Anvil Prototype
## Prerequisites
* Python 2.7 (`apt-get install python2.7` or [https://www.python.org/downloads/](https://www.python.org/downloads/))
* pip 9.01 (installed with python, check with `pip --version`, upgrade with `pip install --upgrade pip`)
* pipenv (`pip install pipenv`)
## Building and running
1. Install Python dependencies and activate the environment
```
$ pipenv install
$ pipenv shell
```
2. Compile proto files into message and service Python classes
```
$ python -m grpc.tools.protoc -Iproto --python_out=. --grpc_python_out=. proto/honeybee.proto
$ python -m grpc.tools.protoc -Iproto --python_out=. --grpc_python_out=. proto/anvilCore/*.proto
```
3. Run the server
```
$ python server.py
Starting Honeybee on [::]:50001
```
4. Test with grpcc (in another shell window)
```
$ npm install -g grpcc
$ grpcc --proto ./proto/honeybee.proto --address 127.0.0.1:50001 -i
RunRecipe@127.0.0.1:50001> client.run({"id": 0, "hoys": [10, 11, 12], "location": { "city": "-", "latitude": 40.7128, "longitude": 74.0060, "time_zone": 5, "elevation": 33}, "analysis_grids": [{"analysis_points": [{"direction": {"x": 0, "y": 0, "z": 1}, "location": {"x": 0, "y": 0, "z": 0}}]}]}, pr)
EventEmitter{}
RunRecipe@127.0.0.1:50001>
{
"job_id": "random_id",
"success": true,
"values": [
{
"hoy": 12,
"total": 1,
"direct": 0
},
{
"hoy": 13,
"total": 1,
"direct": 0
},
{
"hoy": 14,
"total": 1,
"direct": 0
}
],
"log_info": "TODO: Add logging!"
}
RunRecipe@127.0.0.1:50001>
```
## Notes
* On Windows, you may need to prefix any python commands with `winpty` in order to see console output, for example:
```
$ winpty python server.py
```