Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create validate model UI #214

Closed
wants to merge 6 commits into from
Closed

Create validate model UI #214

wants to merge 6 commits into from

Conversation

haneslinger
Copy link
Collaborator

Wanted your thoughts on this: I created a GET libraries/shapes endpoint (see buildingmotif/api/views/library.py). It works, but it takes too long. Run the following code snippet for an example.

One possible solution getting the shapes one library at a time, upon user request. This would break up the load and put it in a place in the ui that would make sense to the user.

thoughts?

from rdflib import Namespace, Graph
from buildingmotif import BuildingMOTIF
from buildingmotif.namespaces import BRICK
from buildingmotif.dataclasses import Model, Library
import requests
import time

bm = BuildingMOTIF("sqlite://") # in-memory

constraints = Library.load(ontology_graph="constraints/constraints.ttl")
brick = Library.load(ontology_graph="./libraries/brick/Brick-subset.ttl")
g36 = Library.load(directory="./libraries/ashrae/guideline36")

start = time.perf_counter()
response = requests.request("GET", "http://127.0.0.1:5000/libraries/shapes")
stop = time.perf_counter()

print(f"GET /libraries/shapes took {stop-start} seconds")

image

@codecov-commenter
Copy link

codecov-commenter commented Jan 26, 2023

Codecov Report

Base: 73.80% // Head: 73.94% // Increases project coverage by +0.14% 🎉

Coverage data is based on head (a24d585) compared to base (9f65179).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@                 Coverage Diff                 @@
##           Add-validate-UI     #214      +/-   ##
===================================================
+ Coverage            73.80%   73.94%   +0.14%     
===================================================
  Files                   31       31              
  Lines                 2031     2042      +11     
===================================================
+ Hits                  1499     1510      +11     
  Misses                 532      532              
Impacted Files Coverage Δ
buildingmotif/dataclasses/library.py 91.28% <ø> (ø)
buildingmotif/api/views/library.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@haneslinger
Copy link
Collaborator Author

Alright, this is coming along but I need some pretty keen reviewing.

  1. Now, only two shapes are coming out of the query
  2. It's validating as true????
  3. And the tests have a few todos in them I need help filling out. I want a test case where it first doesn't validate, then does
    image

@haneslinger haneslinger changed the base branch from Add-validate-UI to develop March 21, 2023 22:53
@haneslinger haneslinger changed the title Alter get shapes endpoint Create validate model UI Mar 21, 2023
@gtfierro
Copy link
Collaborator

@haneslinger can you tell me what configuration you are using, what libraries you are loading, and what sequence of actions you are taking to produce the above?

@gtfierro gtfierro closed this Apr 3, 2023
@haneslinger haneslinger deleted the validate-on-shapes branch November 30, 2023 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants