Git Product home page Git Product logo

honeybee-anvil's Introduction

Honeybee Anvil Prototype

Prerequisites

  • Python 2.7 (apt-get install python2.7 or 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
    [email protected]: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{}
    [email protected]: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!"
    }
    [email protected]: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
    

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.