Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.
/ hasty Public archive

This repository has been archived and development has been moved to BuildingMOTIF.

License

Notifications You must be signed in to change notification settings

NREL/hasty

Repository files navigation

Hasty codecov

A web app to create and edit semantic metadata models of buildings with the following schemas.

Installing

With Docker

The following dependencies are required:

Project Setup:

  1. Navigate to project root
  2. Set postgres name, username, and password in .env
  3. Build Docker images docker compose build
  4. Create and run containers docker compose up for first time startup

Run Server

  • Start docker compose start
  • Stop docker compose stop
  • Tests docker compose run web pytest

Reset Procedure

If the environment gets messed up this is what you need to start from scratch again.

  1. Stop and remove containers and volumes docker compose down -v

Containers

hasty-web

Django server container responsible for serving webpages and managing app. This container reads code from the working directory of the repo and will auto update on changes.

hasty-db

Postgres database container. Data is stored in hasty_pg_data volume.

Running

After installation is complete, the web app can be run. We have committed migrations in order to populate the following:

  • Versions: Only Haystack 3.9.9 and Brick 1.1 are supported at this time
  • Haystack marker tags: q = "SELECT ?m WHERE { ?m rdfs:subClassOf* ph:marker}"
  • Brick tags
  • Haystack Point tagsets: (generated using Haystack's pointProtos webpage)
  • Brick Point classes: q = "SELECT ?p WHERE { ?p rdfs:subClassOf* brick:Point}"
  • Haystack Equipment types: q = "SELECT ?m WHERE { ?m rdfs:subClassOf* phIoT:equip }"

Before starting the server, make sure to do the following:

  • python manage.py makemigrations
  • python manage.py migrate --run-syncdb

Now the server can be run:

  • python manage.py runserver

TODO:

  • Create migrations for mappings between Brick Classes <-> Haystack Point Tagsets
  • Create migrations for equipment templates
  • Create migrations for fault templates

Understanding Mappings

Point protos in Project Haystack are mapped to Brick Classes at different release versions. The mapping happens via use of the py-brickschema package, which means that there are three 'versions' to consider when a mapping is made:

  • Haystack Version
  • Brick Version (although this is currently embedded as part of the py-brickschema package)
  • py-brickschema Version

Third-Party Licenses

This project utilizes code written by Patrick Coffey under an MIT license.