From 0e8e4ac78173ad0e5f63ad3ddfc1b16d4062581f Mon Sep 17 00:00:00 2001 From: kflemin Date: Mon, 16 Mar 2020 13:34:45 -0600 Subject: [PATCH 01/14] parser changes to handle restriction by pattern --- bsyncviewer/lib/schema_parser.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bsyncviewer/lib/schema_parser.py b/bsyncviewer/lib/schema_parser.py index aaf823cb..c88c632e 100644 --- a/bsyncviewer/lib/schema_parser.py +++ b/bsyncviewer/lib/schema_parser.py @@ -107,6 +107,7 @@ def __init__(self): self.enumerations = [] self.min_inclusive = 0 self.max_inclusive = 0 + self.pattern = '' class ChoiceElement(BuildingSyncSchemaElement): @@ -314,6 +315,8 @@ def _read_restriction(parent_object): this_restriction.min_inclusive = child.attrib['value'] elif child.tag.endswith('maxInclusive'): this_restriction.max_inclusive = child.attrib['value'] + elif child.tag.endswith('pattern'): + this_restriction.pattern = child.attrib['value'] else: raise Exception("Invalid tag type in _read_restriction: " + child.tag) return this_restriction From b4c61f9ae1d752e89c90ca1ba24c734afd41538b Mon Sep 17 00:00:00 2001 From: kflemin Date: Mon, 16 Mar 2020 14:03:14 -0600 Subject: [PATCH 02/14] adding additional examples --- .../examples/schema2.0.0/example_files.zip | Bin 10530 -> 12022 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/bsyncviewer/lib/validator/examples/schema2.0.0/example_files.zip b/bsyncviewer/lib/validator/examples/schema2.0.0/example_files.zip index 5ac258287d569c2d7c36530f2f568a1b6c53ebbe..a394be8ae9d26b058805f62d36cf21b289f3b28b 100644 GIT binary patch delta 1696 zcmZ1!^evVzz?+#xgncT%(&w8f&d02Aj2TQ;A3E55FebGTbh$tl9`_u?-b1m;~UtWB*QN;x{8c&307b;3#U3&Nb>Nj(r zWPIroJ6PZMx^~}5L6ON$%@-IaOJ;71NL4&9?)XCBAa~y1j0crZSDw*)ta)AL1Ix|_ z7o9|RJlZ8@dBZxSvHbR0rXy-`h95Q4_dM@;_hiZ*#n^{l!IOU^Cc1u$-^^nfe0=8% zJ9g9Owly<X&tRK4wR-6ttNMZ$`+n?-nG@tPub}#K zpw8wqcVw2YJX`E`ZF=F!h&lu1(wxlcoj*Cv?ppfB@2k{Wx+~aWqwjXs*nMjwD(Lh-Tz|=={l%*+n|*wT6>^?#$hofk^Fm7ZJCjJOAIu@TlOtxOhFWU(XO$T5 z+p^L2$%5#G`wqUF^35l?-t=nk-AeZhcXujhotR+pVDU@k@VT*T5*|Iv>GpmpEVJa& zTNbgmYc6*+F6cVFuXNSUqPg!holdcSSs$dUTfTH!SgrZW{-oc}PvmK({(r$Y&GUOn z)G2ijhnf8>M~<}^u2aaYP=D_B<}y>Be(Y+!`?6E!6>n>)*7sdgx7qXe#j*+YpK{CF zKYo$zU|S#H&CbD7u*bxfiGjh6oq++7)JaI2MzFM5f|54l^KTgl)ISdfrcE{1xnV3T zGt9PmzMZjPcKx=!KF4AXL?tQD4}Ng_`jL}e!k4qw@2|JJUH)4$b(WF@|Qfx61d;8^=reQ`K9~syZ=s9xq8fl&G6^Xg8ggG)Ys|-1Rp%GV?uw< zqrE91;ZOhFKXuTv&u#q+yITc&b;DJgl7cb>tdce zQmz^vHUGHvYn6xpcC+o*--i3!M?I=J6(>-#{BwsCmkQsHgl~bX&Rw}?P-uMnk=L$< zxgon`6E2=}(3Rv^wc`tK$l*}tQg^{KF%9*Tq%uv_d$-*CZuxcA_503c0h+(P%?-}) zT7Ef5Pk}jgpRk9o;IabNn~`sy1a^ajNN&^c ztA`cF$daJsj+_x>7v%`|cZ|V#L3T6&?!HjMyvPZzCdP58b8r!Rd(^zPp;$VQ~ WsQ_Dj*j5sQQ zqB#>PV>U;zZ4+YA3~u(HEF$T^aTX|C3&fjaBmUI$Ex;Qg2{yD1 jC Date: Tue, 17 Mar 2020 15:34:46 -0600 Subject: [PATCH 03/14] adding new examples --- .../schema2.0.0/L000_Simulation_BRICR_01.xml | 47 ++++++++++++++++++ .../schema2.0.0/L000_Simulation_BRICR_02.xml | 48 +++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 bsyncviewer/lib/validator/examples/schema2.0.0/L000_Simulation_BRICR_01.xml create mode 100644 bsyncviewer/lib/validator/examples/schema2.0.0/L000_Simulation_BRICR_02.xml diff --git a/bsyncviewer/lib/validator/examples/schema2.0.0/L000_Simulation_BRICR_01.xml b/bsyncviewer/lib/validator/examples/schema2.0.0/L000_Simulation_BRICR_01.xml new file mode 100644 index 00000000..21d71372 --- /dev/null +++ b/bsyncviewer/lib/validator/examples/schema2.0.0/L000_Simulation_BRICR_01.xml @@ -0,0 +1,47 @@ + + + + + + + + Chicago + IL + + + + Willis Tower + Commercial + Office + + + Gross + 4477800.0 + + + 1973 + + + + + + + + + + + + + Baseline + + + + + + + + + + + + diff --git a/bsyncviewer/lib/validator/examples/schema2.0.0/L000_Simulation_BRICR_02.xml b/bsyncviewer/lib/validator/examples/schema2.0.0/L000_Simulation_BRICR_02.xml new file mode 100644 index 00000000..693bccb2 --- /dev/null +++ b/bsyncviewer/lib/validator/examples/schema2.0.0/L000_Simulation_BRICR_02.xml @@ -0,0 +1,48 @@ + + + + + + + + + 6A + + + + + Office Carolina + Commercial + Office + + + Gross + 31053 + + + 1915 + + + + + + + + + + + + + Baseline + + + + + + + + + + + + From 8990729e78fe6e4b6ce32fea80a92cd581ebde33 Mon Sep 17 00:00:00 2001 From: kflemin Date: Tue, 17 Mar 2020 15:34:59 -0600 Subject: [PATCH 04/14] attempting to add a docker volume for test suite --- Dockerfile | 7 +++++++ docker-compose.local.yml | 3 +++ docker-compose.yml | 3 +++ 3 files changed, 13 insertions(+) diff --git a/Dockerfile b/Dockerfile index b16e8b3d..b8980dd8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,7 @@ RUN apk add --no-cache python3 \ linux-headers \ bash \ bash-completion \ + git \ ruby \ ruby-dev \ nginx && \ @@ -51,6 +52,12 @@ COPY . /srv/selection-tool/ ### Copy the wait-for-it command to /usr/local COPY /docker/wait-for-it.sh /usr/local/wait-for-it.sh +### Copy the GitHub TestSuite repo into the testsuite volume +WORKDIR /srv/selection-tool/bsyncviewer/lib/testsuite +RUN cd /srv/selection-tool/bsyncviewer/lib/testsuite +RUN git clone https://github.com/BuildingSync/TestSuite.git . + + # nginx configurations - alpine doesn't use the sites-available directory. Put the selection tool # configuration file into the /etc/nginx/conf.d/ folder. COPY /docker/nginx.conf /etc/nginx/conf.d/selection_tool.conf diff --git a/docker-compose.local.yml b/docker-compose.local.yml index 17cf90cb..019a3d17 100644 --- a/docker-compose.local.yml +++ b/docker-compose.local.yml @@ -42,6 +42,7 @@ services: - "80:80" volumes: - selectiontool_mediadata:/srv/selection-tool/bsyncviewer/media + - selectiontool_testsuite:/srv/selection-tool/bsyncviewer/lib/testsuite deploy: restart_policy: condition: on-failure @@ -53,3 +54,5 @@ volumes: external: true selectiontool_mediadata: external: true + selectiontool_testsuite: + external: true diff --git a/docker-compose.yml b/docker-compose.yml index e9b41663..3b25c2b1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -28,8 +28,11 @@ services: - "8080:80" volumes: - selectiontool_mediadata:/srv/selection-tool/bsyncviewer/media + - selectiontool_testsuite:/srv/selection-tool/bsyncviewer/lib/testsuite volumes: selectiontool_pgdata: external: true selectiontool_mediadata: external: true + selectiontool_testsuite: + external: true From e67c018a2c553a037869207da1571ef0e64244bc Mon Sep 17 00:00:00 2001 From: kflemin Date: Tue, 24 Mar 2020 16:25:52 -0600 Subject: [PATCH 05/14] adding special L000 OpenStudio Simulation use case --- README.md | 36 ++- ....xml => L000_OpenStudio_Simulation_01.xml} | 0 ....xml => L000_OpenStudio_Simulation_02.xml} | 0 .../examples/schema2.0.0/example_files.zip | Bin 12022 -> 12042 bytes bsyncviewer/lib/validator/workflow.py | 36 ++- bsyncviewer/templates/validator_results.html | 25 +- bsyncviewer/testsuitelib/buildingElements.sch | 101 ++++++ bsyncviewer/testsuitelib/contactElements.sch | 61 ++++ bsyncviewer/testsuitelib/energyElements.sch | 6 + bsyncviewer/testsuitelib/floorElements.sch | 302 ++++++++++++++++++ .../testsuitelib/occupancyElements.sch | 59 ++++ bsyncviewer/testsuitelib/rootElements.sch | 79 +++++ bsyncviewer/testsuitelib/scenarioElements.sch | 32 ++ bsyncviewer/testsuitelib/sectionElements.sch | 55 ++++ .../testsuitelib/siteBuildingElements.sch | 36 +++ 15 files changed, 821 insertions(+), 7 deletions(-) rename bsyncviewer/lib/validator/examples/schema2.0.0/{L000_Simulation_BRICR_01.xml => L000_OpenStudio_Simulation_01.xml} (100%) rename bsyncviewer/lib/validator/examples/schema2.0.0/{L000_Simulation_BRICR_02.xml => L000_OpenStudio_Simulation_02.xml} (100%) create mode 100644 bsyncviewer/testsuitelib/buildingElements.sch create mode 100644 bsyncviewer/testsuitelib/contactElements.sch create mode 100644 bsyncviewer/testsuitelib/energyElements.sch create mode 100644 bsyncviewer/testsuitelib/floorElements.sch create mode 100644 bsyncviewer/testsuitelib/occupancyElements.sch create mode 100644 bsyncviewer/testsuitelib/rootElements.sch create mode 100644 bsyncviewer/testsuitelib/scenarioElements.sch create mode 100644 bsyncviewer/testsuitelib/sectionElements.sch create mode 100644 bsyncviewer/testsuitelib/siteBuildingElements.sch diff --git a/README.md b/README.md index 2d1d64bf..f5facaf8 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,15 @@ This is the repository for the BuildingSync Validator web application. ```bash pip install -r requirements.txt ``` +1. Install the schematron-nokogiri gem for schematron use case validation. We are using a forked version to handle OpenStudio Simulation use cases which contain abstract patterns. + ```bash + git clone https://github.com/BuildingSync/schematron.git + cd schematron + gem build schematron-nokogiri.gemspec + gem install schematron-nokogiri-0.0.3 + + ``` + 1. Initialize the database: ```bash python manage.py migrate @@ -182,12 +191,35 @@ Follow these steps to add a new schema version to the selection tool: 1. Test the validator with the new XML example files. 1. Reparse bedes terms to map them to the new schema following the steps in the BEDES section above. -### Adding Examples from the TestSuite +### Adding Examples from the TestSuite repo -Follow these steps to add new example tables from the TestSuite +Follow these steps to add new example tables from the TestSuite repo 1. Clone the [TestSuite](https://github.com/BuildingSync/TestSuite) repo 2. Install [pandoc](https://pandoc.org/installing.html) 3. Convert the TestSuite README to html: ``` pandoc README.md -s -o README.html ``` 4. Copy the tables part of the README.html and paste to replace the old content in ```bsyncviewer/templates/examples.html```. + +### Adding an OpenStudio Simulation Use Case from the TestSuite repo + +1. The relevant files are currently on the L000_Schematron branch of the [TestSuite](https://github.com/BuildingSync/TestSuite/tree/L100_Schematron) repo. Clone the repo locally. +1. OpenStudio Simulation use case schematron files include patterns from a [library of schematron files](https://github.com/BuildingSync/TestSuite/tree/L100_Schematron/lib). Copy these files from the TestSuite repo into the selection-tool at the following location: ```bsyncviewer/testsuitelib```. +1. Open the relevant use case file from the TestSuite repo. For example: [L00_OpenStudio_Simulation.sch](https://github.com/BuildingSync/TestSuite/blob/L100_Schematron/spec/use_cases/schema2.0.0/L000_OpenStudio_Simulation.sch). Edit the include statements at the top of the file with relative paths to the selection-tool testsuitelib directory. Save the file. + ```bash + + + + + + + + + ``` +1. Add the use case to the selection-tool by browsing to the ```/use_cases``` URL and clicking the *New Use Case* button. + 1. Fill out the name, description, and schema version + 1. Upload the file that was modified in the previous step + 1. Save +1. Make the use case public from the selection-tool admin interface. +1. If you have any example files to add to the selection-tool (for example, for the L000 OpenStudio Simulation use case, there are [2 examples files](https://github.com/BuildingSync/TestSuite/tree/L100_Schematron/spec/use_cases/schema2.0.0/examples)), add them in the appropriate schema directory in ```bsyncviewer/lib/validator/examples```. Regenerate the ```example_files.zip``` archive. This will make the files available as examples at the ```/validator``` URL. +1. You can now validate XMLs against the new use case. diff --git a/bsyncviewer/lib/validator/examples/schema2.0.0/L000_Simulation_BRICR_01.xml b/bsyncviewer/lib/validator/examples/schema2.0.0/L000_OpenStudio_Simulation_01.xml similarity index 100% rename from bsyncviewer/lib/validator/examples/schema2.0.0/L000_Simulation_BRICR_01.xml rename to bsyncviewer/lib/validator/examples/schema2.0.0/L000_OpenStudio_Simulation_01.xml diff --git a/bsyncviewer/lib/validator/examples/schema2.0.0/L000_Simulation_BRICR_02.xml b/bsyncviewer/lib/validator/examples/schema2.0.0/L000_OpenStudio_Simulation_02.xml similarity index 100% rename from bsyncviewer/lib/validator/examples/schema2.0.0/L000_Simulation_BRICR_02.xml rename to bsyncviewer/lib/validator/examples/schema2.0.0/L000_OpenStudio_Simulation_02.xml diff --git a/bsyncviewer/lib/validator/examples/schema2.0.0/example_files.zip b/bsyncviewer/lib/validator/examples/schema2.0.0/example_files.zip index a394be8ae9d26b058805f62d36cf21b289f3b28b..ead5208fdc885d730095d4c90e6c072885fc35a0 100644 GIT binary patch delta 389 zcmews+Z8v#fw`-xYNInh8*`;);pR}b|3b`irB$25C0Ft}xK&gHFdzX%1_1^i0|SG2 z|AN%K;F8jm%>4M^%-qtP#FEVXym$jcy^7qN&ke!vg9H4hE1fq=10|G@F$T QWB@A=o?&EQ(9i|(048Z`_W%F@ delta 382 zcmeB*`xZOFfm!%!{zhkhHfF`E`I|%8{tGc102$$uEBUO8(+dI^kbn$>0E3T#fkAw5 zW^QRtVo7FxUc6I~r*lxefuUYSZcbw!*-Q(J5i7vRmvB+4wpzyX9HSMn6>F|lQ0V6bCnV31+pfw|dX zN#i$l1_Ey8fVmmN)Y#)XIp#o9Ghn8ALktEQ+pC4sSg21p7@$4@8q3NC(#Q&ghZq?c I 0 - if len(results['errors']) > 0: + if len(temp_results['errors']) > 0: results['valid'] = False + results['warnings'] = temp_results['warnings'] + results['errors'] = temp_results['errors'] + results['infos'] = temp_results['infos'] + return results + + def process_errors(self, results): + # separate INFO, WARNING, ERROR + + final_results = OrderedDict() + final_results['infos'] = [] + final_results['warnings'] = [] + final_results['errors'] = [] + + for res in results: + if '[INFO]' in res: + # append to info + final_results['infos'].append(res) + elif '[WARNING]' in res: + # append to warnings + final_results['warnings'].append(res) + else: + # assume error + final_results['errors'].append(res) + + return final_results diff --git a/bsyncviewer/templates/validator_results.html b/bsyncviewer/templates/validator_results.html index 4b8feb8d..2fca7e8c 100644 --- a/bsyncviewer/templates/validator_results.html +++ b/bsyncviewer/templates/validator_results.html @@ -72,8 +72,31 @@

{# {{ name }} #} {# Invalid#}

{% endif %} + {% if uc.infos %} +

Info{{ uc.infos|length }}

+ + {% for item in uc.infos %} + + + + + {% endfor %} +
{{ forloop.counter }}.{{ item }}
+ {% endif %} + {% if uc.warnings %} +

Warnings{{ uc.warnings|length }}

+ + {% for item in uc.warnings %} + + + + + {% endfor %} +
{{ forloop.counter }}.{{ item }}
+ {% endif %} + {% if uc.valid is False %} -

Issues {{ uc.errors|length }}

+

Errors {{ uc.errors|length }}

{% for err in uc.errors %} diff --git a/bsyncviewer/testsuitelib/buildingElements.sch b/bsyncviewer/testsuitelib/buildingElements.sch new file mode 100644 index 00000000..db475cd9 --- /dev/null +++ b/bsyncviewer/testsuitelib/buildingElements.sch @@ -0,0 +1,101 @@ + + + + + + + + + [ERROR] element 'auc:PremisesName' is REQUIRED EXACTLY ONCE for: '' + + + [ERROR] element 'auc:BuildingClassification' is REQUIRED EXACTLY ONCE for: '' + + + [ERROR] element 'auc:OccupancyClassification' is REQUIRED EXACTLY ONCE for: '' + + + [ERROR] element 'auc:YearOfConstruction' is REQUIRED EXACTLY ONCE for: '' + + + + + + + + [ERROR] element 'auc:PremisesName' is REQUIRED EXACTLY ONCE for: '' + + + [ERROR] element 'auc:BuildingClassification' is REQUIRED EXACTLY ONCE for: '' + + + [ERROR] element 'auc:OccupancyClassification' is REQUIRED EXACTLY ONCE for: '' + + + [ERROR] element 'auc:YearOfConstruction' is REQUIRED EXACTLY ONCE for: '' + + + [ERROR] element 'auc:BuildingAutomationSystem' is REQUIRED EXACTLY ONCE for: '' + + + [ERROR] element 'auc:HistoricalLandmark' is REQUIRED EXACTLY ONCE for: '' + + + [ERROR] element 'auc:PercentOccupiedByOwner' is REQUIRED EXACTLY ONCE for: '' + + + [ERROR] element 'auc:PercentLeasedByOwner' is REQUIRED EXACTLY ONCE for: '' + + + [ERROR] element 'auc:ConditionedFloorsAboveGrade' is REQUIRED EXACTLY ONCE for: '' + + + [ERROR] element 'auc:ConditionedFloorsBelowGrade' is REQUIRED EXACTLY ONCE for: '' + + + [ERROR] element 'auc:FloorsAboveGrade' or 'auc:UnconditionedFloorsAboveGrade' is REQUIRED EXACTLY ONCE for: '' + + + [ERROR] element 'auc:FloorsBelowGrade' or 'auc:UnconditionedFloorsBelowGrade' is REQUIRED EXACTLY ONCE for: '' + + + [WARNING] element 'auc:YearOfLastEnergyAudit' is RECOMMENDED for: '' + + + [WARNING] element 'auc:RetrocommissioningDate' is RECOMMENDED for: '' + + + [WARNING] element 'auc:YearOfLastMajorRemodel' is RECOMMENDED for: '' + + + + + + + + + + [ERROR] element 'auc:City' within element 'auc:Address' is REQUIRED EXACTLY ONCE for: '' + + + [ERROR] element 'auc:State' within element 'auc:Address' is REQUIRED EXACTLY ONCE for: '' + + + [ERROR] element 'auc:PostalCode' within element 'auc:Address' is REQUIRED EXACTLY ONCE for: '' + + + [ERROR] element 'auc:StreetAddress' within element 'auc:Address/auc:StreetAddressDetail/auc:Simplified' is REQUIRED EXACTLY ONCE for: '' + + + + diff --git a/bsyncviewer/testsuitelib/contactElements.sch b/bsyncviewer/testsuitelib/contactElements.sch new file mode 100644 index 00000000..a20ccdf5 --- /dev/null +++ b/bsyncviewer/testsuitelib/contactElements.sch @@ -0,0 +1,61 @@ + + + + + + + + [ERROR] element 'auc:ContactName' is REQUIRED EXACTLY ONCE for: '' + + + [ERROR] element 'auc:EmailAddress' within element 'auc:ContactEmailAddresses/auc:ContactEmailAddress' is REQUIRED AT LEAST ONCE for: '' + + + [ERROR] element 'auc:TelephoneNumber' within element 'auc:ContactTelephoneNumbers/auc:ContactTelephoneNumber' is REQUIRED AT LEAST ONCE for: '' + + + + + + + + + + + [ERROR] element 'auc:Contact' is REQUIRED AT LEAST TWICE for: '’. Current number of occurrences: + + + [ERROR] element 'auc:Contact' with child element 'auc:ContactRoles/auc:ContactRole' with value 'Energy Auditor' is REQUIRED AT LEAST ONCE for: '’. Current number of occurrences: + + + [ERROR] element 'auc:Contact' with child element 'auc:ContactRoles/auc:ContactRole' with value 'Owner' is REQUIRED AT LEAST ONCE for: '’. Current number of occurrences: + + + + + + + + + + [ERROR] element 'auc:ContactRole' MUST NOT HAVE values 'Energy Auditor' and 'Owner' within 'auc:ContactRoles' for: '' + + + + diff --git a/bsyncviewer/testsuitelib/energyElements.sch b/bsyncviewer/testsuitelib/energyElements.sch new file mode 100644 index 00000000..61ed8c00 --- /dev/null +++ b/bsyncviewer/testsuitelib/energyElements.sch @@ -0,0 +1,6 @@ + + + + diff --git a/bsyncviewer/testsuitelib/floorElements.sch b/bsyncviewer/testsuitelib/floorElements.sch new file mode 100644 index 00000000..851551d8 --- /dev/null +++ b/bsyncviewer/testsuitelib/floorElements.sch @@ -0,0 +1,302 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [ERROR] element 'auc:FloorAreaType' with value 'Tenant' is ALLOWED NO MORE THAN ONCE for '' + + + [ERROR] element 'auc:FloorAreaType' with value 'Common' is ALLOWED NO MORE THAN ONCE for '' + + + [ERROR] element 'auc:FloorAreaType' with value 'Gross' is ALLOWED NO MORE THAN ONCE for '' + + + [ERROR] element 'auc:FloorAreaType' with value 'Net' is ALLOWED NO MORE THAN ONCE for '' + + + [ERROR] element 'auc:FloorAreaType' with value 'Finished' is ALLOWED NO MORE THAN ONCE for '' + + + [ERROR] element 'auc:FloorAreaType' with value 'Footprint' is ALLOWED NO MORE THAN ONCE for '' + + + [ERROR] element 'auc:FloorAreaType' with value 'Rentable' is ALLOWED NO MORE THAN ONCE for '' + + + [ERROR] element 'auc:FloorAreaType' with value 'Occupied' is ALLOWED NO MORE THAN ONCE for '' + + + [ERROR] element 'auc:FloorAreaType' with value 'Lighted' is ALLOWED NO MORE THAN ONCE for '' + + + [ERROR] element 'auc:FloorAreaType' with value 'Daylit' is ALLOWED NO MORE THAN ONCE for '' + + + [ERROR] element 'auc:FloorAreaType' with value 'Heated' is ALLOWED NO MORE THAN ONCE for '' + + + [ERROR] element 'auc:FloorAreaType' with value 'Cooled' is ALLOWED NO MORE THAN ONCE for '' + + + [ERROR] element 'auc:FloorAreaType' with value 'Conditioned' is ALLOWED NO MORE THAN ONCE for '' + + + [ERROR] element 'auc:FloorAreaType' with value 'Unconditioned' is ALLOWED NO MORE THAN ONCE for '' + + + [ERROR] element 'auc:FloorAreaType' with value 'Semi-conditioned' is ALLOWED NO MORE THAN ONCE for '' + + + [ERROR] element 'auc:FloorAreaType' with value 'Heated and Cooled' is ALLOWED NO MORE THAN ONCE for '' + + + [ERROR] element 'auc:FloorAreaType' with value 'Heated only' is ALLOWED NO MORE THAN ONCE for '' + + + [ERROR] element 'auc:FloorAreaType' with value 'Cooled only' is ALLOWED NO MORE THAN ONCE for '' + + + [ERROR] element 'auc:FloorAreaType' with value 'Ventilated' is ALLOWED NO MORE THAN ONCE for '' + + + [ERROR] element 'auc:FloorAreaType' with value 'Enclosed' is ALLOWED NO MORE THAN ONCE for '' + + + [ERROR] element 'auc:FloorAreaType' with value 'Non-Enclosed' is ALLOWED NO MORE THAN ONCE for '' + + + [ERROR] element 'auc:FloorAreaType' with value 'Open' is ALLOWED NO MORE THAN ONCE for '' + + + [ERROR] element 'auc:FloorAreaType' with value 'Lot' is ALLOWED NO MORE THAN ONCE for '' + + + [ERROR] element 'auc:FloorAreaType' with value 'Custom' is ALLOWED NO MORE THAN ONCE for '' + + + + + + + + [ERROR] elements 'auc:FloorAreaType' and 'auc:FloorAreaValue' are REQUIRED EXACTLY ONCE for: '' + + + + + + + + [ERROR] element 'auc:FloorAreaType' with value '' is REQUIRED EXACTLY ONCE within element 'auc:FloorArea' for ''. Currently occurs: + + + + + + + + [WARNING] element 'auc:FloorAreaType' with value '' is RECOMMENDED for: '' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [ERROR] Conditioned Floor Area () must be greater than or equal to: Heated and Cooled () + Heated only () + Cooled only () + Ventilated () + + + [ERROR] Gross Floor Area () must be greater than or equal to: Conditioned () + Unconditioned () AND Unconditioned Floor Area must be > 0 + + + [INFO] 'Gross' Floor Area: + + + [INFO] 'Cooled only' Floor Area: + + + [INFO] 'Heated only' Floor Area: + + + [INFO] 'Heated and Cooled' Floor Area: + + + [INFO] 'Ventilated' Floor Area: + + + [INFO] 'Conditioned' Floor Area: + + + [INFO] 'Unconditioned' Floor Area: + + + + + + + + [ERROR] element 'auc:FloorAreaType' with value 'Heated' within element 'auc:FloorArea' SHOULD NOT BE USED for: '' + + + [ERROR] element 'auc:FloorAreaType' with value 'Cooled' within element 'auc:FloorArea' SHOULD NOT BE USED for: '' + + + + + + + + + + + + + [ERROR] element 'auc:FloorAreaType' with value 'Conditioned' or 'Heated and Cooled' or 'Heated only' or 'Cooled only' or 'Ventilated' is REQUIRED AT LEAST ONCE for '' + + + + + + + + + + + + + + + Conditioned Area Percentage * Gross Area () must be greater than or equal to: Heated and Cooled () + Heated only () + Cooled only () + Ventilated () + + + + + + + + + + [ERROR] auc:Building Gross Floor () Area MUST BE GREATER THAN OR EQUAL TO the sum of all Gross Floor areas from elements auc:Section[auc:SectionType='Space function'] () + + + [INFO] Building Gross Floor Area: + + + [INFO] Sum of all auc:Section[auc:SectionType='Space function'] Gross Floor Area: + + + + + + + + + + [ERROR] either element 'auc:FloorAreaValue' OR 'auc:FloorAreaPercentage' MUST BE SPECIFIED for: '' + + + + + diff --git a/bsyncviewer/testsuitelib/occupancyElements.sch b/bsyncviewer/testsuitelib/occupancyElements.sch new file mode 100644 index 00000000..bffa8be5 --- /dev/null +++ b/bsyncviewer/testsuitelib/occupancyElements.sch @@ -0,0 +1,59 @@ + + + + + + + + + [ERROR] elements 'auc:TypicalOccupantUsageValue' and 'auc:TypicalOccupantUsageUnits' are REQUIRED EXACTLY ONCE for: '' + + + + + + + + [ERROR] element 'auc:TypicalOccupantUsage' with child element 'auc:TypicalOccupantUsageUnits' having value '' is REQUIRED EXACTLY ONCE for ''. Current number of occurrences: + + + + + + + + [ERROR] elements 'auc:OccupancyQuantityType' and 'auc:OccupantQuantity' are REQUIRED EXACTLY ONCE for: '' + + + + + + + + [ERROR] element 'auc:OccupancyLevel' with child element 'auc:OccupantQuantityType' having value '' is REQUIRED EXACTLY ONCE for ''. Current number of occurrences: + + + + diff --git a/bsyncviewer/testsuitelib/rootElements.sch b/bsyncviewer/testsuitelib/rootElements.sch new file mode 100644 index 00000000..97361080 --- /dev/null +++ b/bsyncviewer/testsuitelib/rootElements.sch @@ -0,0 +1,79 @@ + + + + + + + [ERROR] element 'auc:BuildingSync' is REQUIRED EXACTLY ONCE for: '' + + + [ERROR] element 'auc:Facilities' is REQUIRED EXACTLY ONCE for: '' + + + [ERROR] element 'auc:Facility' is REQUIRED EXACTLY ONCE for: '' + + + [ERROR] element 'auc:Sites' is REQUIRED EXACTLY ONCE for: '' + + + [ERROR] element 'auc:Site' is REQUIRED EXACTLY ONCE for: '' + + + [ERROR] element 'auc:Buildings' is REQUIRED EXACTLY ONCE for: '' + + + [ERROR] element 'auc:Building' is REQUIRED EXACTLY ONCE for: '' + + + + + + [ERROR] element 'auc:Reports' is REQUIRED EXACTLY ONCE for: '' + + + [ERROR] element 'auc:Report' is REQUIRED AT LEAST ONCE for: '' + + + [ERROR] element 'auc:Scenarios' is REQUIRED EXACTLY ONCE for: '' + + + [ERROR] element 'auc:Scenario' is REQUIRED AT LEAST ONCE for: '' + + + + + + [ERROR] element 'auc:Contacts' is REQUIRED EXACTLY ONCE for: '' + + + + + + [ERROR] element 'auc:Report' is REQUIRED AT LEAST ONCE for: '' + + + + + + [ERROR] element 'auc:Scenario' is REQUIRED AT LEAST ONCE for: '' + + + diff --git a/bsyncviewer/testsuitelib/scenarioElements.sch b/bsyncviewer/testsuitelib/scenarioElements.sch new file mode 100644 index 00000000..06c9f5be --- /dev/null +++ b/bsyncviewer/testsuitelib/scenarioElements.sch @@ -0,0 +1,32 @@ + + + + + + + + + + [ERROR] element 'auc:Scenario' with attribute ID='Baseline' is REQUIRED EXACTLY ONCE for: + + + + + + + [ERROR] element 'auc:Scenario' with attribute ID='Baseline' MUST CONTAIN the following subelements: + auc:ScenarioType/auc:PackageOfMeasures/auc:ReferenceCase IDref='Baseline' + + + + diff --git a/bsyncviewer/testsuitelib/sectionElements.sch b/bsyncviewer/testsuitelib/sectionElements.sch new file mode 100644 index 00000000..188e1da2 --- /dev/null +++ b/bsyncviewer/testsuitelib/sectionElements.sch @@ -0,0 +1,55 @@ + + + + + + + + + [ERROR] element 'auc:OccupancyClassification' is REQUIRED EXACTLY ONCE for: '' + + + [WARNING] element 'auc:OriginalOccupancyClassification' is RECOMMENDED for: '' + + + + + + + + + + + + + has id: + + + HVAC IDRefs: + + + + + + diff --git a/bsyncviewer/testsuitelib/siteBuildingElements.sch b/bsyncviewer/testsuitelib/siteBuildingElements.sch new file mode 100644 index 00000000..7473ea3f --- /dev/null +++ b/bsyncviewer/testsuitelib/siteBuildingElements.sch @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + [WARNING] elements 'auc:City' and 'auc:State' or element 'auc:ClimateZoneType//auc:ClimateZone' are RECOMMENDED EXACTLY ONCE at either the 'auc:Site' or 'auc:Building' level. + + + [INFO] Number of 'auc:City' elements defined at the 'auc:Site' = , 'auc:Building' = + + + [INFO] Number of 'auc:State' elements defined at the 'auc:Site' = , 'auc:Building' = + + + [INFO] Number of 'auc:ClimateZoneType//auc:ClimateZone' elements defined at the 'auc:Site' = , 'auc:Building' = + + + + From 6f82d8df47d2b3593ce68488e609a451f7bdb663 Mon Sep 17 00:00:00 2001 From: kflemin Date: Tue, 24 Mar 2020 16:27:50 -0600 Subject: [PATCH 06/14] reverting separate volume for testsuite and modifying install of schematron-nokogiri gem --- Dockerfile | 13 +++++-------- README.md | 2 +- docker-compose.local.yml | 3 --- docker-compose.yml | 3 --- 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index b8980dd8..7ce3c675 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,8 +43,11 @@ WORKDIR /srv/selection-tool COPY /requirements.txt /srv/selection-tool/requirements.txt RUN pip install -r requirements.txt -#install the schematron-nokogiri gem -RUN gem install schematron-nokogiri +#install the schematron-nokogiri gem from BuildingSync org +git clone https://github.com/BuildingSync/schematron +RUN cd schematron +RUN gem build schematron-nokogiri.gemspec +RUN gem install schematron-nokogiri-0.0.3.gem ### Copy over the remaining part of the application and some helpers COPY . /srv/selection-tool/ @@ -52,12 +55,6 @@ COPY . /srv/selection-tool/ ### Copy the wait-for-it command to /usr/local COPY /docker/wait-for-it.sh /usr/local/wait-for-it.sh -### Copy the GitHub TestSuite repo into the testsuite volume -WORKDIR /srv/selection-tool/bsyncviewer/lib/testsuite -RUN cd /srv/selection-tool/bsyncviewer/lib/testsuite -RUN git clone https://github.com/BuildingSync/TestSuite.git . - - # nginx configurations - alpine doesn't use the sites-available directory. Put the selection tool # configuration file into the /etc/nginx/conf.d/ folder. COPY /docker/nginx.conf /etc/nginx/conf.d/selection_tool.conf diff --git a/README.md b/README.md index f5facaf8..40433e45 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ This is the repository for the BuildingSync Validator web application. git clone https://github.com/BuildingSync/schematron.git cd schematron gem build schematron-nokogiri.gemspec - gem install schematron-nokogiri-0.0.3 + gem install schematron-nokogiri-0.0.3.gem ``` diff --git a/docker-compose.local.yml b/docker-compose.local.yml index 019a3d17..17cf90cb 100644 --- a/docker-compose.local.yml +++ b/docker-compose.local.yml @@ -42,7 +42,6 @@ services: - "80:80" volumes: - selectiontool_mediadata:/srv/selection-tool/bsyncviewer/media - - selectiontool_testsuite:/srv/selection-tool/bsyncviewer/lib/testsuite deploy: restart_policy: condition: on-failure @@ -54,5 +53,3 @@ volumes: external: true selectiontool_mediadata: external: true - selectiontool_testsuite: - external: true diff --git a/docker-compose.yml b/docker-compose.yml index 3b25c2b1..e9b41663 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -28,11 +28,8 @@ services: - "8080:80" volumes: - selectiontool_mediadata:/srv/selection-tool/bsyncviewer/media - - selectiontool_testsuite:/srv/selection-tool/bsyncviewer/lib/testsuite volumes: selectiontool_pgdata: external: true selectiontool_mediadata: external: true - selectiontool_testsuite: - external: true From 9288581f0021d6a28091138475ad55782d874e1d Mon Sep 17 00:00:00 2001 From: kflemin Date: Tue, 24 Mar 2020 20:55:15 -0600 Subject: [PATCH 07/14] dockerfile changes --- Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7ce3c675..20467366 100644 --- a/Dockerfile +++ b/Dockerfile @@ -44,11 +44,14 @@ COPY /requirements.txt /srv/selection-tool/requirements.txt RUN pip install -r requirements.txt #install the schematron-nokogiri gem from BuildingSync org -git clone https://github.com/BuildingSync/schematron -RUN cd schematron +WORKDIR /srv +RUN git clone https://github.com/BuildingSync/schematron +WORKDIR /srv/schematron + RUN gem build schematron-nokogiri.gemspec RUN gem install schematron-nokogiri-0.0.3.gem +WORKDIR /srv/selection-tool ### Copy over the remaining part of the application and some helpers COPY . /srv/selection-tool/ From 36ecd410354091a96961ec08fde73a15055f5c3c Mon Sep 17 00:00:00 2001 From: Nicholas Long Date: Thu, 26 Mar 2020 07:57:11 -0600 Subject: [PATCH 08/14] precommit, changelog, version --- .pre-commit-config.yaml | 29 +++++++++++++++++++++++++++++ CHANGELOG.md | 12 ++++++++++++ app_version.txt | 2 +- docker/start_server.sh | 2 +- docs/scripts/change_log.py | 0 5 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 .pre-commit-config.yaml mode change 100644 => 100755 docs/scripts/change_log.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..8c111ba7 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,29 @@ +exclude: | + (?x)( + ^docs/conf.py| + ^modelica_builder/modelica_parser/ + ) + +repos: +- repo: git://github.com/pre-commit/pre-commit-hooks + rev: v2.2.3 + hooks: + - id: trailing-whitespace + - id: check-added-large-files + - id: check-ast + - id: check-json + - id: check-merge-conflict + - id: check-xml + - id: check-yaml + - id: debug-statements + - id: end-of-file-fixer +# - id: requirements-txt-fixer + - id: mixed-line-ending + - id: flake8 + args: ['--max-line-length=140'] # default of Black + +- repo: https://github.com/pre-commit/mirrors-isort + rev: v4.3.4 + hooks: + - id: isort + args: ['-m 3'] # vertical hanging diff --git a/CHANGELOG.md b/CHANGELOG.md index 82de9a1f..b065f410 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # BuildingSync Use Case Selection Tool +## Version 1.1.1 (Unreleased) + +General updates: + +* Adding L000 OpenStudio Simulation use case and example files +* Dockerize TestSuite repository + +Date Range: 12/21/20 - 03/26/20 + +Closed Issues and Features: + + ## Version 1.1.0 Date Range: 11/19/19 - 12/20/19 diff --git a/app_version.txt b/app_version.txt index 1cc5f657..8cfbc905 100644 --- a/app_version.txt +++ b/app_version.txt @@ -1 +1 @@ -1.1.0 \ No newline at end of file +1.1.1 \ No newline at end of file diff --git a/docker/start_server.sh b/docker/start_server.sh index bf330791..dfef5191 100755 --- a/docker/start_server.sh +++ b/docker/start_server.sh @@ -9,7 +9,7 @@ echo "Waiting for postgres to start" ./manage.py migrate ./manage.py collectstatic --noinput -# Check if a schema has been imports +# Check if a schema has been imported ./manage.py reset_schema --schema_version 1.0.0 ./manage.py bedes --schema_version=1.0.0 --bedes_version=v2.2 --save_to_db diff --git a/docs/scripts/change_log.py b/docs/scripts/change_log.py old mode 100644 new mode 100755 From cef951617ced237b0be86a1cb7888695e0810a7d Mon Sep 17 00:00:00 2001 From: Nicholas Long Date: Thu, 26 Mar 2020 08:01:53 -0600 Subject: [PATCH 09/14] precommit info --- .pre-commit-config.yaml | 6 ------ README.md | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8c111ba7..da40f5d5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,9 +1,3 @@ -exclude: | - (?x)( - ^docs/conf.py| - ^modelica_builder/modelica_parser/ - ) - repos: - repo: git://github.com/pre-commit/pre-commit-hooks rev: v2.2.3 diff --git a/README.md b/README.md index 40433e45..35c171c5 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,20 @@ This is the repository for the BuildingSync Validator web application. python manage.py reset_schema --schema_version=1.0.0 ``` +### Precommit + +This project used `pre-commit `_ to ensure code consistency. To enable pre-commit, run the following from the command line. + +```bash +pip install pre-commit +pre-commit install +``` + +To run pre-commit against the files without calling git commit, then run the following. This is useful when cleaning up the repo before committing. + +```bash +pre-commit run --all-files +``` ### Testing From 2ea75057de3d89c557ae9ac5c62ef3a628a5e135 Mon Sep 17 00:00:00 2001 From: Nicholas Long Date: Thu, 26 Mar 2020 08:05:22 -0600 Subject: [PATCH 10/14] code cleanup --- .gitignore | 1 - README.md | 14 ++-- app_version.txt | 2 +- bsyncviewer/admin.py | 2 +- bsyncviewer/forms.py | 1 + bsyncviewer/lib/bedes/bedes_parser.py | 3 +- .../v2.2/bedes_online_dictionary_uuid-lo.xml | 12 ++-- bsyncviewer/lib/bedes/v2.2/bedes_v2.2.json | 2 +- .../BuildingSync_v1.0.0.xsd | 2 +- bsyncviewer/lib/schema_parser.py | 5 +- .../bricr_use_case_ashrae_v1.0.0.csv | 2 +- .../lib/use_cases/bricr_use_case_v1.0.0.csv | 2 +- .../lib/use_cases/ll87_usecase_schematron.sch | 2 +- .../Example \342\200\223 A Valid Schema.xml" | 2 +- .../Example \342\200\223 Invalid Schema.xml" | 4 +- ...\200\223 Valid Schema Invalid UseCase.xml" | 2 +- .../Example \342\200\223 A Valid Schema.xml" | 2 +- .../Example \342\200\223 Invalid Schema.xml" | 4 +- .../Example \342\200\223 A Valid Schema.xml" | 2 +- .../Example \342\200\223 Invalid Schema.xml" | 4 +- .../Example \342\200\223 A Valid Schema.xml" | 2 +- .../Example \342\200\223 Invalid Schema.xml" | 4 +- bsyncviewer/lib/validator/workflow.py | 5 +- bsyncviewer/management/commands/bedes.py | 15 ++-- .../management/commands/create_use_case.py | 5 +- .../management/commands/reset_schema.py | 4 +- bsyncviewer/migrations/0001_initial.py | 4 +- .../migrations/0002_auto_20190501_2038.py | 2 +- .../migrations/0005_auto_20190501_2111.py | 2 +- bsyncviewer/models/enumeration.py | 3 +- bsyncviewer/models/schema.py | 5 +- bsyncviewer/models/use_case.py | 4 +- bsyncviewer/static/images/arrow.svg | 69 +++++++++---------- bsyncviewer/static/images/bars.svg | 69 +++++++++---------- bsyncviewer/static/images/close.svg | 69 +++++++++---------- bsyncviewer/static/style.css | 6 +- bsyncviewer/templates/base.html | 2 - bsyncviewer/templates/dictionary.html | 4 +- bsyncviewer/templates/email.html | 2 +- bsyncviewer/templates/use_case_mappings.html | 4 +- bsyncviewer/templates/use_cases.html | 10 +-- bsyncviewer/templates/validator_results.html | 6 +- bsyncviewer/tests/test_api.py | 3 +- bsyncviewer/tests/test_command.py | 7 +- bsyncviewer/tests/test_schema.py | 5 +- bsyncviewer/tests/test_use_case.py | 5 +- bsyncviewer/tests/test_validator.py | 7 +- bsyncviewer/tests/test_views.py | 16 +++-- bsyncviewer/testsuitelib/contactElements.sch | 8 +-- bsyncviewer/testsuitelib/energyElements.sch | 2 +- bsyncviewer/testsuitelib/floorElements.sch | 26 +++---- .../testsuitelib/occupancyElements.sch | 12 ++-- bsyncviewer/testsuitelib/rootElements.sch | 10 +-- bsyncviewer/testsuitelib/scenarioElements.sch | 4 +- bsyncviewer/testsuitelib/sectionElements.sch | 6 +- .../testsuitelib/siteBuildingElements.sch | 8 +-- bsyncviewer/urls.py | 6 +- bsyncviewer/views.py | 33 +++++---- docker/README.md | 4 +- docs/release_instructions.md | 1 - requirements.txt | 1 - 61 files changed, 261 insertions(+), 269 deletions(-) diff --git a/.gitignore b/.gitignore index 80b7036d..353fec21 100644 --- a/.gitignore +++ b/.gitignore @@ -98,4 +98,3 @@ bsyncviewer/lib/bedes/v2.2/schema0.0.1/ bsyncviewer/lib/bedes/*/schema*/bedes-mappings-enumerations.csv bsyncviewer/lib/bedes/*/schema*/bedes-mappings-terms.csv bsyncviewer/lib/bedes/*/schema*/bsync_unique_words.csv - diff --git a/README.md b/README.md index 35c171c5..bca88618 100644 --- a/README.md +++ b/README.md @@ -2,17 +2,17 @@ [![Build Status](https://travis-ci.org/BuildingSync/selection-tool.svg?branch=develop)](https://travis-ci.org/BuildingSync/selection-tool) -This is the repository for the BuildingSync Validator web application. +This is the repository for the BuildingSync Validator web application. ## Installation 1. Clone the repository. 1. Setup python 3. You can use a virtual environment: ```bash - pyenv install 3.6.5 + pyenv install 3.6.5 pyenv virtualenv 3.6.5 bsync-validator-3.6.5 pyenv local bsync-validator-3.6.3 - ``` + ``` 1. Install PostgreSQL server for local development (if desired) * Once installed, create your local database and user: ```bash @@ -75,7 +75,7 @@ To run pre-commit against the files without calling git commit, then run the fol ```bash pre-commit run --all-files -``` +``` ### Testing @@ -114,7 +114,7 @@ To modify an existing schema, click on the edit link. If changes are made to th Authenticated users can add private use cases to the BuildingSync Schema Viewer. Use cases are represented by a schematron file that defines a set of rules and patterns. To add a use case, click on the 'Use Case' link in the top navigation bar, then click on the '+ New Use Case' button. -Select a name and a BuildingSync schema version. Select your use case definitions schematron file and upload, then click 'Submit'. +Select a name and a BuildingSync schema version. Select your use case definitions schematron file and upload, then click 'Submit'. Once ready, contact a BuildingSync admin to make the use case public. Public use cases will be available on the 'Validator' page to validate XML files submitted by users. @@ -201,7 +201,7 @@ Follow these steps to add a new schema version to the selection tool: 1. Add the schema file in the admin interface. Must have admin privileges. The schema will get automatically parsed. 1. Convert existing use cases schematron files to the new schema. Add the new use cases. 1. When the use cases have been reviewed, make them public in the admin interface. -1. Create XML example files and place them in the `lib/validator/examples/schema` directory. +1. Create XML example files and place them in the `lib/validator/examples/schema` directory. 1. Test the validator with the new XML example files. 1. Reparse bedes terms to map them to the new schema following the steps in the BEDES section above. @@ -235,5 +235,5 @@ Follow these steps to add new example tables from the TestSuite repo 1. Upload the file that was modified in the previous step 1. Save 1. Make the use case public from the selection-tool admin interface. -1. If you have any example files to add to the selection-tool (for example, for the L000 OpenStudio Simulation use case, there are [2 examples files](https://github.com/BuildingSync/TestSuite/tree/L100_Schematron/spec/use_cases/schema2.0.0/examples)), add them in the appropriate schema directory in ```bsyncviewer/lib/validator/examples```. Regenerate the ```example_files.zip``` archive. This will make the files available as examples at the ```/validator``` URL. +1. If you have any example files to add to the selection-tool (for example, for the L000 OpenStudio Simulation use case, there are [2 examples files](https://github.com/BuildingSync/TestSuite/tree/L100_Schematron/spec/use_cases/schema2.0.0/examples)), add them in the appropriate schema directory in ```bsyncviewer/lib/validator/examples```. Regenerate the ```example_files.zip``` archive. This will make the files available as examples at the ```/validator``` URL. 1. You can now validate XMLs against the new use case. diff --git a/app_version.txt b/app_version.txt index 8cfbc905..524cb552 100644 --- a/app_version.txt +++ b/app_version.txt @@ -1 +1 @@ -1.1.1 \ No newline at end of file +1.1.1 diff --git a/bsyncviewer/admin.py b/bsyncviewer/admin.py index 76bfd960..fd3c1be3 100644 --- a/bsyncviewer/admin.py +++ b/bsyncviewer/admin.py @@ -1,9 +1,9 @@ import semantic_version +from django import forms from django.contrib import admin from django.contrib.admin import AdminSite from django.contrib.auth.admin import GroupAdmin, UserAdmin from django.contrib.auth.models import Group, User -from django import forms from .models.attribute import Attribute from .models.schema import Schema diff --git a/bsyncviewer/forms.py b/bsyncviewer/forms.py index ebfff46f..c1d5aff2 100644 --- a/bsyncviewer/forms.py +++ b/bsyncviewer/forms.py @@ -4,6 +4,7 @@ from django.conf import settings from .models.schema import Schema + DEFAULT_SCHEMA_VERSION = settings.DEFAULT_SCHEMA_VERSION diff --git a/bsyncviewer/lib/bedes/bedes_parser.py b/bsyncviewer/lib/bedes/bedes_parser.py index 3c36c5cd..02e52832 100644 --- a/bsyncviewer/lib/bedes/bedes_parser.py +++ b/bsyncviewer/lib/bedes/bedes_parser.py @@ -1,10 +1,9 @@ import json import os -from collections import defaultdict, OrderedDict, Mapping +from collections import Mapping, OrderedDict, defaultdict import xmltodict - # BEDES have a very simple two level hierarchy. The first level is the category and the # second category is the Term. The data are stored in this format, but it is important # to note that the Term is globally unique. diff --git a/bsyncviewer/lib/bedes/v2.2/bedes_online_dictionary_uuid-lo.xml b/bsyncviewer/lib/bedes/v2.2/bedes_online_dictionary_uuid-lo.xml index bebdb34f..bc2f4277 100644 --- a/bsyncviewer/lib/bedes/v2.2/bedes_online_dictionary_uuid-lo.xml +++ b/bsyncviewer/lib/bedes/v2.2/bedes_online_dictionary_uuid-lo.xml @@ -36246,8 +36246,8 @@ environment. b6fca2b4-5856-452a-9198-1a0455dd73f0 https://bedes.lbl.gov/node/b6fca2b4-5856-452a-9198-1a0455dd73f0 WELL Educational Facilities (Pilot) - Educational Facilities applies to projects where dedicated staff are employed for instructional purposes, and students may be of any age. -Courses may cover any range of topics, and facilities may be typified by fully scheduled days, or distinct classes that students enroll in at will. + Educational Facilities applies to projects where dedicated staff are employed for instructional purposes, and students may be of any age. +Courses may cover any range of topics, and facilities may be typified by fully scheduled days, or distinct classes that students enroll in at will. The education pilot standard is applicable to early education, K-12, and adult education (college, university, or other). N/A Assessment Recognition @@ -36260,8 +36260,8 @@ The education pilot standard is applicable to early education, K-12, and adult e 51c3b1c9-2ffd-4b1a-84b8-bd86d675a4dc https://bedes.lbl.gov/node/51c3b1c9-2ffd-4b1a-84b8-bd86d675a4dc WELL Multifamily Residential (Pilot) - Multifamily Residential applies specifically to projects with at least five dwelling units in a single building with common structural elements. -Projects that qualify include apartments, condominiums, townhouses, and other residential complexes within all market thresholds - + Multifamily Residential applies specifically to projects with at least five dwelling units in a single building with common structural elements. +Projects that qualify include apartments, condominiums, townhouses, and other residential complexes within all market thresholds - affordable housing, market-rate, and luxury. N/A Assessment Recognition @@ -36322,8 +36322,8 @@ affordable housing, market-rate, and luxury. a3b99610-6784-432f-b07e-65385daf0f16 https://bedes.lbl.gov/node/a3b99610-6784-432f-b07e-65385daf0f16 WELL Retail (Pilot) - Retail applies to locations where consumers can view and purchase merchandise onsite, and staff are employed to assist in the sale of -products. The Retail pilot standard is applicable to both owner- and tenant-occupied projects, and to both those in stand-alone retail + Retail applies to locations where consumers can view and purchase merchandise onsite, and staff are employed to assist in the sale of +products. The Retail pilot standard is applicable to both owner- and tenant-occupied projects, and to both those in stand-alone retail buildings and/ or those integrated into larger structures. N/A Assessment Recognition diff --git a/bsyncviewer/lib/bedes/v2.2/bedes_v2.2.json b/bsyncviewer/lib/bedes/v2.2/bedes_v2.2.json index 8fadda81..f333a8c7 100644 --- a/bsyncviewer/lib/bedes/v2.2/bedes_v2.2.json +++ b/bsyncviewer/lib/bedes/v2.2/bedes_v2.2.json @@ -46155,4 +46155,4 @@ "list_options": [] } ] -} \ No newline at end of file +} diff --git a/bsyncviewer/lib/buildingsync_schemas/BuildingSync_v1.0.0.xsd b/bsyncviewer/lib/buildingsync_schemas/BuildingSync_v1.0.0.xsd index 31b86cd7..3c1d2dbe 100644 --- a/bsyncviewer/lib/buildingsync_schemas/BuildingSync_v1.0.0.xsd +++ b/bsyncviewer/lib/buildingsync_schemas/BuildingSync_v1.0.0.xsd @@ -15888,4 +15888,4 @@ Window spacing: the dimension between windows in a discrete window layout. (in.) - \ No newline at end of file + diff --git a/bsyncviewer/lib/schema_parser.py b/bsyncviewer/lib/schema_parser.py index c88c632e..88bdc7ae 100644 --- a/bsyncviewer/lib/schema_parser.py +++ b/bsyncviewer/lib/schema_parser.py @@ -1,8 +1,9 @@ import xmlschema - from bsyncviewer.models.attribute import Attribute +from bsyncviewer.models.attribute_enumeration_class import ( + AttributeEnumerationClass +) from bsyncviewer.models.enumeration import Enumeration, EnumerationClass -from bsyncviewer.models.attribute_enumeration_class import AttributeEnumerationClass from django.db import transaction diff --git a/bsyncviewer/lib/use_cases/bricr_use_case_ashrae_v1.0.0.csv b/bsyncviewer/lib/use_cases/bricr_use_case_ashrae_v1.0.0.csv index 9db9f974..dc9b79e4 100644 --- a/bsyncviewer/lib/use_cases/bricr_use_case_ashrae_v1.0.0.csv +++ b/bsyncviewer/lib/use_cases/bricr_use_case_ashrae_v1.0.0.csv @@ -3521,4 +3521,4 @@ BuildingSync.Facilities.Facility.Tenants.Tenant.UserDefinedFields.UserDefinedFie BuildingSync.Facilities.Facility.UserDefinedFields,,,,, BuildingSync.Facilities.Facility.UserDefinedFields.UserDefinedField,,,,, BuildingSync.Facilities.Facility.UserDefinedFields.UserDefinedField.FieldName,,,,, -BuildingSync.Facilities.Facility.UserDefinedFields.UserDefinedField.FieldValue,,,,, \ No newline at end of file +BuildingSync.Facilities.Facility.UserDefinedFields.UserDefinedField.FieldValue,,,,, diff --git a/bsyncviewer/lib/use_cases/bricr_use_case_v1.0.0.csv b/bsyncviewer/lib/use_cases/bricr_use_case_v1.0.0.csv index 38cab595..983c01e9 100644 --- a/bsyncviewer/lib/use_cases/bricr_use_case_v1.0.0.csv +++ b/bsyncviewer/lib/use_cases/bricr_use_case_v1.0.0.csv @@ -3521,4 +3521,4 @@ BuildingSync.Facilities.Facility.Tenants.Tenant.UserDefinedFields.UserDefinedFie BuildingSync.Facilities.Facility.UserDefinedFields,,,,, BuildingSync.Facilities.Facility.UserDefinedFields.UserDefinedField,,,,, BuildingSync.Facilities.Facility.UserDefinedFields.UserDefinedField.FieldName,,,,, -BuildingSync.Facilities.Facility.UserDefinedFields.UserDefinedField.FieldValue,,,,, \ No newline at end of file +BuildingSync.Facilities.Facility.UserDefinedFields.UserDefinedField.FieldValue,,,,, diff --git a/bsyncviewer/lib/use_cases/ll87_usecase_schematron.sch b/bsyncviewer/lib/use_cases/ll87_usecase_schematron.sch index 6c2e55f4..07b80e0e 100644 --- a/bsyncviewer/lib/use_cases/ll87_usecase_schematron.sch +++ b/bsyncviewer/lib/use_cases/ll87_usecase_schematron.sch @@ -6970,4 +6970,4 @@ text "": element "text()" MUST be a number and MUST be greater than or equal to 0 - \ No newline at end of file + diff --git "a/bsyncviewer/lib/validator/examples/schema1.0.0/Example \342\200\223 A Valid Schema.xml" "b/bsyncviewer/lib/validator/examples/schema1.0.0/Example \342\200\223 A Valid Schema.xml" index ba9d9727..a9c4ceb6 100644 --- "a/bsyncviewer/lib/validator/examples/schema1.0.0/Example \342\200\223 A Valid Schema.xml" +++ "b/bsyncviewer/lib/validator/examples/schema1.0.0/Example \342\200\223 A Valid Schema.xml" @@ -1623,4 +1623,4 @@ - \ No newline at end of file + diff --git "a/bsyncviewer/lib/validator/examples/schema1.0.0/Example \342\200\223 Invalid Schema.xml" "b/bsyncviewer/lib/validator/examples/schema1.0.0/Example \342\200\223 Invalid Schema.xml" index 564256f7..370d44de 100644 --- "a/bsyncviewer/lib/validator/examples/schema1.0.0/Example \342\200\223 Invalid Schema.xml" +++ "b/bsyncviewer/lib/validator/examples/schema1.0.0/Example \342\200\223 Invalid Schema.xml" @@ -771,7 +771,7 @@ bob.auditor@test.com - + BIN @@ -802,4 +802,4 @@ 1234 - \ No newline at end of file + diff --git "a/bsyncviewer/lib/validator/examples/schema1.0.0/Example \342\200\223 Valid Schema Invalid UseCase.xml" "b/bsyncviewer/lib/validator/examples/schema1.0.0/Example \342\200\223 Valid Schema Invalid UseCase.xml" index d9084879..36cab897 100644 --- "a/bsyncviewer/lib/validator/examples/schema1.0.0/Example \342\200\223 Valid Schema Invalid UseCase.xml" +++ "b/bsyncviewer/lib/validator/examples/schema1.0.0/Example \342\200\223 Valid Schema Invalid UseCase.xml" @@ -948,4 +948,4 @@ - \ No newline at end of file + diff --git "a/bsyncviewer/lib/validator/examples/schema2.0.0-pr1/Example \342\200\223 A Valid Schema.xml" "b/bsyncviewer/lib/validator/examples/schema2.0.0-pr1/Example \342\200\223 A Valid Schema.xml" index 2ecf4f7b..68bf4227 100644 --- "a/bsyncviewer/lib/validator/examples/schema2.0.0-pr1/Example \342\200\223 A Valid Schema.xml" +++ "b/bsyncviewer/lib/validator/examples/schema2.0.0-pr1/Example \342\200\223 A Valid Schema.xml" @@ -164,7 +164,7 @@ - + diff --git "a/bsyncviewer/lib/validator/examples/schema2.0.0-pr1/Example \342\200\223 Invalid Schema.xml" "b/bsyncviewer/lib/validator/examples/schema2.0.0-pr1/Example \342\200\223 Invalid Schema.xml" index e68ae381..370d44de 100644 --- "a/bsyncviewer/lib/validator/examples/schema2.0.0-pr1/Example \342\200\223 Invalid Schema.xml" +++ "b/bsyncviewer/lib/validator/examples/schema2.0.0-pr1/Example \342\200\223 Invalid Schema.xml" @@ -771,7 +771,7 @@ bob.auditor@test.com - + BIN @@ -802,4 +802,4 @@ 1234 - \ No newline at end of file + diff --git "a/bsyncviewer/lib/validator/examples/schema2.0.0-pr2/Example \342\200\223 A Valid Schema.xml" "b/bsyncviewer/lib/validator/examples/schema2.0.0-pr2/Example \342\200\223 A Valid Schema.xml" index 3e88822d..22481d8e 100644 --- "a/bsyncviewer/lib/validator/examples/schema2.0.0-pr2/Example \342\200\223 A Valid Schema.xml" +++ "b/bsyncviewer/lib/validator/examples/schema2.0.0-pr2/Example \342\200\223 A Valid Schema.xml" @@ -162,7 +162,7 @@ - + diff --git "a/bsyncviewer/lib/validator/examples/schema2.0.0-pr2/Example \342\200\223 Invalid Schema.xml" "b/bsyncviewer/lib/validator/examples/schema2.0.0-pr2/Example \342\200\223 Invalid Schema.xml" index e68ae381..370d44de 100644 --- "a/bsyncviewer/lib/validator/examples/schema2.0.0-pr2/Example \342\200\223 Invalid Schema.xml" +++ "b/bsyncviewer/lib/validator/examples/schema2.0.0-pr2/Example \342\200\223 Invalid Schema.xml" @@ -771,7 +771,7 @@ bob.auditor@test.com - + BIN @@ -802,4 +802,4 @@ 1234 - \ No newline at end of file + diff --git "a/bsyncviewer/lib/validator/examples/schema2.0.0/Example \342\200\223 A Valid Schema.xml" "b/bsyncviewer/lib/validator/examples/schema2.0.0/Example \342\200\223 A Valid Schema.xml" index 2ecf4f7b..68bf4227 100644 --- "a/bsyncviewer/lib/validator/examples/schema2.0.0/Example \342\200\223 A Valid Schema.xml" +++ "b/bsyncviewer/lib/validator/examples/schema2.0.0/Example \342\200\223 A Valid Schema.xml" @@ -164,7 +164,7 @@ - + diff --git "a/bsyncviewer/lib/validator/examples/schema2.0.0/Example \342\200\223 Invalid Schema.xml" "b/bsyncviewer/lib/validator/examples/schema2.0.0/Example \342\200\223 Invalid Schema.xml" index e68ae381..370d44de 100644 --- "a/bsyncviewer/lib/validator/examples/schema2.0.0/Example \342\200\223 Invalid Schema.xml" +++ "b/bsyncviewer/lib/validator/examples/schema2.0.0/Example \342\200\223 Invalid Schema.xml" @@ -771,7 +771,7 @@ bob.auditor@test.com - + BIN @@ -802,4 +802,4 @@ 1234 - \ No newline at end of file + diff --git a/bsyncviewer/lib/validator/workflow.py b/bsyncviewer/lib/validator/workflow.py index f64ae1fb..7f737c01 100644 --- a/bsyncviewer/lib/validator/workflow.py +++ b/bsyncviewer/lib/validator/workflow.py @@ -1,9 +1,8 @@ -from collections import OrderedDict - -import xmlschema import copy import subprocess +from collections import OrderedDict +import xmlschema from bsyncviewer.models.schema import Schema from bsyncviewer.models.use_case import UseCase diff --git a/bsyncviewer/management/commands/bedes.py b/bsyncviewer/management/commands/bedes.py index e35f7f29..bcadd429 100644 --- a/bsyncviewer/management/commands/bedes.py +++ b/bsyncviewer/management/commands/bedes.py @@ -1,19 +1,22 @@ import csv -import xmltodict import os import re from collections import defaultdict import jellyfish -from django.conf import settings -from django.core.management.base import BaseCommand - +import xmltodict from bsyncviewer.lib.bedes.bedes_parser import BedesParser from bsyncviewer.models.attribute import Attribute -from bsyncviewer.models.bedes_models import BedesTerm, BedesMapping, BedesEnumeration, \ - BedesEnumerationMapping +from bsyncviewer.models.bedes_models import ( + BedesEnumeration, + BedesEnumerationMapping, + BedesMapping, + BedesTerm +) from bsyncviewer.models.enumeration import Enumeration from bsyncviewer.models.schema import Schema +from django.conf import settings +from django.core.management.base import BaseCommand # MATCH TYPES: # Term-to-List-Option Match -> use bedes_url col (will contain only 1 URL) diff --git a/bsyncviewer/management/commands/create_use_case.py b/bsyncviewer/management/commands/create_use_case.py index f478361c..93cf0ea4 100644 --- a/bsyncviewer/management/commands/create_use_case.py +++ b/bsyncviewer/management/commands/create_use_case.py @@ -1,12 +1,11 @@ import os +from bsyncviewer.models.schema import Schema +from bsyncviewer.models.use_case import UseCase from django.conf import settings from django.core.files.uploadedfile import SimpleUploadedFile from django.core.management.base import BaseCommand -from bsyncviewer.models.schema import Schema -from bsyncviewer.models.use_case import UseCase - DEFAULT_SCHEMA_VERSION = settings.DEFAULT_SCHEMA_VERSION diff --git a/bsyncviewer/management/commands/reset_schema.py b/bsyncviewer/management/commands/reset_schema.py index 35065d1c..d77850d3 100644 --- a/bsyncviewer/management/commands/reset_schema.py +++ b/bsyncviewer/management/commands/reset_schema.py @@ -1,9 +1,9 @@ import os from shutil import copyfile -from django.core.management.base import BaseCommand -from django.conf import settings from bsyncviewer.models.schema import Schema +from django.conf import settings +from django.core.management.base import BaseCommand class Command(BaseCommand): diff --git a/bsyncviewer/migrations/0001_initial.py b/bsyncviewer/migrations/0001_initial.py index 05108725..b1139986 100644 --- a/bsyncviewer/migrations/0001_initial.py +++ b/bsyncviewer/migrations/0001_initial.py @@ -1,10 +1,10 @@ # Generated by Django 2.1 on 2018-12-06 17:39 import bsyncviewer.models.schema -from django.conf import settings import django.contrib.postgres.fields -from django.db import migrations, models import django.db.models.deletion +from django.conf import settings +from django.db import migrations, models class Migration(migrations.Migration): diff --git a/bsyncviewer/migrations/0002_auto_20190501_2038.py b/bsyncviewer/migrations/0002_auto_20190501_2038.py index b3083f1d..371eee43 100644 --- a/bsyncviewer/migrations/0002_auto_20190501_2038.py +++ b/bsyncviewer/migrations/0002_auto_20190501_2038.py @@ -1,7 +1,7 @@ # Generated by Django 2.1.7 on 2019-05-01 20:38 -from django.db import migrations, models import django.db.models.deletion +from django.db import migrations, models class Migration(migrations.Migration): diff --git a/bsyncviewer/migrations/0005_auto_20190501_2111.py b/bsyncviewer/migrations/0005_auto_20190501_2111.py index f449fe9f..2dd9a4b1 100644 --- a/bsyncviewer/migrations/0005_auto_20190501_2111.py +++ b/bsyncviewer/migrations/0005_auto_20190501_2111.py @@ -1,7 +1,7 @@ # Generated by Django 2.1.7 on 2019-05-01 21:11 -from django.db import migrations, models import django.db.models.deletion +from django.db import migrations, models class Migration(migrations.Migration): diff --git a/bsyncviewer/models/enumeration.py b/bsyncviewer/models/enumeration.py index 557c180b..bc220c73 100644 --- a/bsyncviewer/models/enumeration.py +++ b/bsyncviewer/models/enumeration.py @@ -1,6 +1,5 @@ -from django.db import models - from bsyncviewer.models.enumeration_class import EnumerationClass +from django.db import models class Enumeration(models.Model): diff --git a/bsyncviewer/models/schema.py b/bsyncviewer/models/schema.py index c6831f77..08f33e35 100644 --- a/bsyncviewer/models/schema.py +++ b/bsyncviewer/models/schema.py @@ -1,12 +1,11 @@ import os +from bsyncviewer.lib.schema_parser import process_schema # from django.conf import settings from django.db import models -from django.db.models.signals import post_save, post_delete, pre_save +from django.db.models.signals import post_delete, post_save, pre_save from django.dispatch import receiver -from bsyncviewer.lib.schema_parser import process_schema - def rename_schema_file(instance, path): if instance.version: diff --git a/bsyncviewer/models/use_case.py b/bsyncviewer/models/use_case.py index a21d3c57..c42c594a 100644 --- a/bsyncviewer/models/use_case.py +++ b/bsyncviewer/models/use_case.py @@ -1,10 +1,10 @@ import os from django.contrib.auth.models import User +from django.core.validators import FileExtensionValidator from django.db import models -from django.db.models.signals import pre_save, post_delete +from django.db.models.signals import post_delete, pre_save from django.dispatch import receiver -from django.core.validators import FileExtensionValidator class UseCase(models.Model): diff --git a/bsyncviewer/static/images/arrow.svg b/bsyncviewer/static/images/arrow.svg index e981e1ab..2b0f54f8 100644 --- a/bsyncviewer/static/images/arrow.svg +++ b/bsyncviewer/static/images/arrow.svg @@ -20,20 +20,20 @@ - - - - + + + + - + website/arrow.svg at gh-pages · BuildingSync/website - + @@ -43,7 +43,7 @@ - + @@ -62,7 +62,7 @@ - + @@ -75,7 +75,7 @@ - + @@ -104,19 +104,19 @@ - +
Skip to content
- - - - + + + + - +
@@ -339,13 +339,13 @@
- - + + @@ -432,7 +432,7 @@
  • - +
    @@ -508,7 +508,7 @@
    - +
  • - +
    @@ -508,7 +508,7 @@
    - +
  • - +
    @@ -508,7 +508,7 @@
    - +
  • @@ -63,16 +63,16 @@

    My Use Cases

     
    - {% endif %} + {% endif %}

    Click the link below for more information on adding and validating use cases

    - - + + Use Case Help Page -
    +
    diff --git a/bsyncviewer/templates/validator_results.html b/bsyncviewer/templates/validator_results.html index 2fca7e8c..086d1e0b 100644 --- a/bsyncviewer/templates/validator_results.html +++ b/bsyncviewer/templates/validator_results.html @@ -73,7 +73,7 @@

    {# {{ name }} #}

    {% endif %} {% if uc.infos %} -

    Info{{ uc.infos|length }}

    +

    Info{{ uc.infos|length }}

    {% for item in uc.infos %} @@ -82,9 +82,9 @@

    Info{{ uc.infos|length }}

    {% endfor %}
    - {% endif %} + {% endif %} {% if uc.warnings %} -

    Warnings{{ uc.warnings|length }}

    +

    Warnings{{ uc.warnings|length }}

    {% for item in uc.warnings %} diff --git a/bsyncviewer/tests/test_api.py b/bsyncviewer/tests/test_api.py index d4caec82..5cbe71e9 100644 --- a/bsyncviewer/tests/test_api.py +++ b/bsyncviewer/tests/test_api.py @@ -1,12 +1,11 @@ import os +from bsyncviewer.models.schema import Schema from django.core.files.uploadedfile import SimpleUploadedFile from django.urls import reverse from rest_framework import status from rest_framework.test import APITestCase -from bsyncviewer.models.schema import Schema - # Use a custom version that is not an actual version to prevent overwriting saved BEDES mappings TEST_SCHEMA_VERSION = '0.0.1' diff --git a/bsyncviewer/tests/test_command.py b/bsyncviewer/tests/test_command.py index b413e326..1c4d9b85 100644 --- a/bsyncviewer/tests/test_command.py +++ b/bsyncviewer/tests/test_command.py @@ -1,15 +1,14 @@ import os from io import StringIO +from bsyncviewer.models.bedes_models import BedesEnumeration, BedesTerm +from bsyncviewer.models.schema import Schema +from bsyncviewer.models.use_case import UseCase from django.conf import settings from django.core.files.uploadedfile import SimpleUploadedFile from django.core.management import call_command from django.test import TestCase -from bsyncviewer.models.bedes_models import BedesTerm, BedesEnumeration -from bsyncviewer.models.schema import Schema -from bsyncviewer.models.use_case import UseCase - # For reset test only DEFAULT_SCHEMA_VERSION = settings.DEFAULT_SCHEMA_VERSION diff --git a/bsyncviewer/tests/test_schema.py b/bsyncviewer/tests/test_schema.py index f896dfcb..1a87f67b 100644 --- a/bsyncviewer/tests/test_schema.py +++ b/bsyncviewer/tests/test_schema.py @@ -1,11 +1,10 @@ import json import os -from django.core.files.uploadedfile import SimpleUploadedFile -from django.test import TestCase - from bsyncviewer.lib.tree_viewer import get_schema_jstree_data from bsyncviewer.models.schema import Schema +from django.core.files.uploadedfile import SimpleUploadedFile +from django.test import TestCase # Use a custom version that is not an actual version to prevent overwriting saved BEDES mappings TEST_SCHEMA_VERSION = '0.0.1' diff --git a/bsyncviewer/tests/test_use_case.py b/bsyncviewer/tests/test_use_case.py index a6002bb9..0ff107a8 100644 --- a/bsyncviewer/tests/test_use_case.py +++ b/bsyncviewer/tests/test_use_case.py @@ -1,10 +1,9 @@ import os -from django.core.files.uploadedfile import SimpleUploadedFile -from django.test import TestCase - from bsyncviewer.models.schema import Schema from bsyncviewer.models.use_case import UseCase +from django.core.files.uploadedfile import SimpleUploadedFile +from django.test import TestCase # Use a custom version that is not an actual version to prevent overwriting saved BEDES mappings TEST_SCHEMA_VERSION = '0.0.1' diff --git a/bsyncviewer/tests/test_validator.py b/bsyncviewer/tests/test_validator.py index c646aa89..31fa78b0 100644 --- a/bsyncviewer/tests/test_validator.py +++ b/bsyncviewer/tests/test_validator.py @@ -1,11 +1,10 @@ import os -from django.core.files.uploadedfile import SimpleUploadedFile -from django.test import Client, TestCase - -from bsyncviewer.forms import LoadXMLFile, LoadXMLExample +from bsyncviewer.forms import LoadXMLExample, LoadXMLFile from bsyncviewer.lib.validator.workflow import ValidationWorkflow from bsyncviewer.models.schema import Schema +from django.core.files.uploadedfile import SimpleUploadedFile +from django.test import Client, TestCase # Use a custom version that is not an actual version to prevent overwriting saved BEDES mappings TEST_SCHEMA_VERSION = '0.0.1' diff --git a/bsyncviewer/tests/test_views.py b/bsyncviewer/tests/test_views.py index e42dc9f9..83543df5 100644 --- a/bsyncviewer/tests/test_views.py +++ b/bsyncviewer/tests/test_views.py @@ -1,16 +1,18 @@ import os from io import StringIO -from django.core.files.uploadedfile import SimpleUploadedFile -from django.core.management import call_command -from django.test import Client -from django.test import TestCase -from django.urls import reverse - from bsyncviewer.models.attribute import Attribute -from bsyncviewer.models.bedes_models import BedesEnumeration, BedesTerm, BedesMapping +from bsyncviewer.models.bedes_models import ( + BedesEnumeration, + BedesMapping, + BedesTerm +) from bsyncviewer.models.schema import Schema from django.conf import settings +from django.core.files.uploadedfile import SimpleUploadedFile +from django.core.management import call_command +from django.test import Client, TestCase +from django.urls import reverse # Use a custom version that is not an actual version to prevent overwriting saved BEDES mappings TEST_SCHEMA_VERSION = '0.0.1' diff --git a/bsyncviewer/testsuitelib/contactElements.sch b/bsyncviewer/testsuitelib/contactElements.sch index a20ccdf5..f3bdba2a 100644 --- a/bsyncviewer/testsuitelib/contactElements.sch +++ b/bsyncviewer/testsuitelib/contactElements.sch @@ -1,9 +1,9 @@ - - diff --git a/bsyncviewer/testsuitelib/floorElements.sch b/bsyncviewer/testsuitelib/floorElements.sch index 851551d8..3cd2c287 100644 --- a/bsyncviewer/testsuitelib/floorElements.sch +++ b/bsyncviewer/testsuitelib/floorElements.sch @@ -1,10 +1,10 @@ - - @@ -214,7 +214,7 @@ - @@ -298,5 +298,5 @@ - + diff --git a/bsyncviewer/testsuitelib/occupancyElements.sch b/bsyncviewer/testsuitelib/occupancyElements.sch index bffa8be5..b241cde6 100644 --- a/bsyncviewer/testsuitelib/occupancyElements.sch +++ b/bsyncviewer/testsuitelib/occupancyElements.sch @@ -1,10 +1,10 @@ - - @@ -67,7 +67,7 @@ [ERROR] element 'auc:Report' is REQUIRED AT LEAST ONCE for: '' - diff --git a/bsyncviewer/testsuitelib/scenarioElements.sch b/bsyncviewer/testsuitelib/scenarioElements.sch index 06c9f5be..163e1b48 100644 --- a/bsyncviewer/testsuitelib/scenarioElements.sch +++ b/bsyncviewer/testsuitelib/scenarioElements.sch @@ -1,11 +1,11 @@ - @@ -22,7 +22,7 @@ - -

    HVAC System Examples

    +

    Modeling Level of Detail Definitions

    +

    The Modeling Level of Detail (MLOD) is similar in concept to the Model View Definitions (MVD) defined by IFC. MLODs define a subset of the overall BuildingSync schema necessary for a specific use case or workflow. +

    Level definitions are in alignment with the ASHRAE Standard 211 levels as defined below:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    MLODUse CaseAlignment to Std 211Std 211 Section
    Level 000AuditPreliminary AnalysisSection 5.2.3
    Level 100AuditLevel 1Section 6.1
    Level 200AuditLevel 2Section 6.2
    Level 300AuditLevel 3Section 6.3
    Level 400AuditNot ApplicableNot Applicable
    Level 500AuditNot ApplicableNot Applicable
    + + +

    HVAC System Examples

    +

    Where the System Type specified below does not exactly match the enumeration in the BSync XML file, check the mapping defined by map_primary_hvac_system_type_to_cbecs_system_type. Additionally, see the examples/HVACSystems directory for a tutorial and example files.

    + + + + + + + + + + + + + + + + - - - + + + + + + - - - - + + + + + + + + + - - - - + + + + + + + + + - - - - + + + + + + + + + - - - - + + + + + + + + + - - - - + + + + + + + + + - - - - + + + + + + + + +
    FileSpecified For System TypeLevel 000Level 100Level 200Translate TestedSimulate TestedMLODUse CaseValidates AgainstDescription
    PSZ SystemL100_Instance1.xmlL000_OpenStudio_Simulation_01.xmlBuildingVAV with reheatTRUETRUEL000OpenStudio_SimulationL000_OpenStudio_Simulation.schNo system-type actually declared. System inferred from OpenStudio Standards based on Building's OccupancyClassification and Gross floor area.
    VAVL100_Instance2.xmlL000_OpenStudio_Simulation_02.xmlBuildingPSZ-AC with gas reheatTRUETRUEL000OpenStudio_SimulationL000_OpenStudio_Simulation.schNo system-type actually declared. System inferred from OpenStudio Standards based on Building's OccupancyClassification and Gross floor area.
    Shared BoilerTODOL100_OpenStudio_Simulation_01.xmlSection-RetailPSZ-AC with gas reheatTRUETRUEL100OpenStudio_SimulationL100_OpenStudio_Simulation.schPackaged Rooftop Air Conditioner is mapped to PSZ-AC with gas reheat.
    DOAS & RadiantTODOL100_OpenStudio_Simulation_01.xmlSection-OfficePVAV with PFP boxesTRUETRUEL100OpenStudio_SimulationL100_OpenStudio_Simulation.schPackaged Rooftop VAV with Electric Reheat is mapped as PVAV with PFP boxes
    Inferred from OpenStudio StandardsL000_Instance1.xmlPSZ-AC-CDM-001.xmlSectionPSZ-ACN/AN/AL200AuditNoneExample of constructing more complex, L200 system.
    L000_Instance2.xmlPSZ-HP-CDM-001.xmlSectionPSZ-HPN/AN/AL200AuditNoneExample of constructing more complex, L200 system.
    -

    Lighting System Examples

    +

    Lighting System Examples

    @@ -75,7 +174,7 @@

    Lighting System Examples

    -

    Premise Examples

    +

    Premise Examples

    From 4b74c320f9322aa83799ad623898b2bb5b8ad19f Mon Sep 17 00:00:00 2001 From: kflemin Date: Fri, 27 Mar 2020 10:46:00 -0600 Subject: [PATCH 14/14] adding link to examples page --- bsyncviewer/templates/base.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bsyncviewer/templates/base.html b/bsyncviewer/templates/base.html index 49311d54..2b96f502 100644 --- a/bsyncviewer/templates/base.html +++ b/bsyncviewer/templates/base.html @@ -45,6 +45,12 @@

    Validator +
  • + + + Documentation + +