Skip to content

Commit d9f294d

Browse files
authored
Merge pull request #176 from BuildingSync/task/small-fixes
Updated Onboarding & Collaborators
2 parents aaf4fe3 + bf333d7 commit d9f294d

27 files changed

+499
-182
lines changed

README.md

+58-60
Original file line numberDiff line numberDiff line change
@@ -7,55 +7,54 @@ This is the repository for the BuildingSync Validator web application.
77
## Installation
88

99
1. Clone the repository.
10-
1. Setup python 3. You can use a virtual environment:
10+
1. Setup python 3. You can use a virtual environment:
1111
```bash
1212
pyenv install 3.6.5
1313
pyenv virtualenv 3.6.5 bsync-validator-3.6.5
1414
pyenv local bsync-validator-3.6.5
1515
```
1616
1. Install PostgreSQL server for local development (if desired)
17-
* Once installed, create your local database and user:
18-
```bash
19-
psql -c 'DROP DATABASE bsync_validator;'
20-
psql -c 'CREATE DATABASE bsync_validator;'
21-
psql -c "CREATE USER bsync_validator WITH ENCRYPTED PASSWORD 'bsync_validator';"
22-
psql -c 'GRANT ALL PRIVILEGES ON DATABASE bsync_validator TO bsync_validator;'
23-
psql -c 'ALTER USER bsync_validator CREATEDB;'
24-
```
17+
* Once installed, create your local database and user:
18+
```bash
19+
psql -c 'DROP DATABASE bsync_validator;'
20+
psql -c 'CREATE DATABASE bsync_validator;'
21+
psql -c "CREATE USER bsync_validator WITH ENCRYPTED PASSWORD 'bsync_validator';"
22+
psql -c 'GRANT ALL PRIVILEGES ON DATABASE bsync_validator TO bsync_validator;'
23+
psql -c 'ALTER USER bsync_validator CREATEDB;'
24+
```
2525
1. Install Django and associated requirements:
26-
```bash
27-
pip install -r requirements.txt
28-
```
29-
1. Initialize the database:
30-
```bash
31-
python manage.py migrate
32-
```
33-
1. Create a superuser:
34-
```bash
35-
python manage.py createsuperuser
36-
```
26+
```bash
27+
pip install -r requirements.txt
28+
```
29+
1. Initialize the database:
30+
```bash
31+
python manage.py migrate
32+
```
33+
1. Create a superuser:
34+
```bash
35+
python manage.py createsuperuser
36+
```
3737
1. Start the app:
38-
```bash
39-
python manage.py runserver
40-
```
41-
38+
```bash
39+
python manage.py runserver
40+
```
4241

4342
## Local Development
4443

4544
* When making changes to models, run the following command to make migrations:
46-
```bash
47-
python manage.py makemigrations
48-
python manage.py migrate
49-
```
45+
```bash
46+
python manage.py makemigrations
47+
python manage.py migrate
48+
```
5049

5150
* To test schema import, you can run this command:
52-
```bash
53-
python manage.py reset_schema --schema_version=1.0.0
54-
```
51+
```bash
52+
python manage.py reset_schema --schema_version=1.0.0
53+
```
5554

56-
**NOTE**: You will need to be off the NREL VPN to import a schema, otherwise you'll get an error related to http://www.gbxml.org/schema}Area' as the gbxml schema cannot be imported when on the NREL VPN.
55+
**NOTE**: You will need to be _off_ the NREL VPN to import a schema, otherwise you'll get an error related to http://www.gbxml.org/schema}Area' as the gbXML schema cannot be imported when on the NREL VPN.
5756

58-
### Precommit
57+
### Pre-commit
5958

6059
This project used `pre-commit <https://pre-commit.com/>`_ to ensure code consistency. To enable pre-commit, run the following from the command line.
6160

@@ -73,9 +72,9 @@ pre-commit run --all-files
7372
### Testing
7473

7574
* To run test:
76-
```bash
77-
./manage.py test
78-
```
75+
```bash
76+
./manage.py test
77+
```
7978

8079
* To calculate coverage:
8180
```bash
@@ -85,7 +84,7 @@ pre-commit run --all-files
8584

8685
### Pep
8786

88-
* Run the following command to clean-up your code before committing:
87+
* Run the following command to clean up your code before committing:
8988
```bash
9089
autopep8 --in-place --aggressive --aggressive --recursive --max-line-length 100 --ignore E501,E402,W503,E731 --exclude=conf.py,structure.py .
9190
@@ -96,26 +95,26 @@ tox -e flake8
9695

9796
### BuildingSync Schema
9897

99-
The BuildingSync Schema Viewer can support multiple versions of the BuildingSync schema. Admin users can manage schemas from the Django Administration console. Click on the 'Admin' link in the top navigation bar to access the Django Administration pages.
98+
The BuildingSync Schema Viewer can support multiple versions of the BuildingSync schema. Admin users can manage schemas from the Django Administration console. Click on the 'Admin' link in the top navigation bar to access the Django Administration pages.
10099

101-
To add a schema, specify the name, version, and schema file (XSD) to parse and save the record. The schema file will be parsed automatically. **NOTE**: You will need to be off the NREL VPN to import a schema, otherwise you'll get an error related to http://www.gbxml.org/schema}Area' as the gbxml schema cannot be imported when on the NREL VPN.
100+
To add a schema, specify the name, version, and schema file (XSD) to parse and save the record. The schema file will be parsed automatically. **NOTE**: You will need to be _off_ the NREL VPN to import a schema, otherwise you'll get an error related to http://www.gbxml.org/schema}Area' as the gbXML schema cannot be imported when on the NREL VPN.
102101

103-
To modify an existing schema, click on the edit link. If changes are made to the uploaded XSD schema file and re-uploaded, ensure that the 'schema parsed' checkbox is unchecked before saving the record. This will trigger the automatic schema parsing.
102+
To modify an existing schema, click on the edit link. If changes are made to the uploaded XSD schema file and re-uploaded, ensure that the 'schema parsed' checkbox is unchecked before saving the record. This will trigger the automatic schema parsing.
104103

105104
### Use Cases
106105

107-
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.
106+
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.
108107

109108
To add a use case, click on the 'Use Case' link in the top navigation bar, then click on the '+ New Use Case' button.
110-
Select a name and a BuildingSync schema version. Select your use case definitions schematron file and upload, then click 'Submit'.
109+
Select a name and a BuildingSync schema version. Select your use case definitions schematron file and upload, then click 'Submit'.
111110

112111
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.
113112

114-
Admin users: Find the use case in the Django Administration console and click the edit button. Check the 'Make public' checkbox and save.
113+
Admin users: Find the use case in the Django Administration console and click the edit button. Check the 'Make public' checkbox and save.
115114

116115
### Validator
117116

118-
The validator page allows users to validate XMLs against the BuildingSync schema and its public use cases. It can be tried with selected example files, or custom XML files can be uploaded for validation.
117+
The validator page allows users to validate XMLs against the BuildingSync schema and its public use cases. It can be tried with selected example files, or custom XML files can be uploaded for validation.
119118

120119
#### Validator API
121120

@@ -124,7 +123,7 @@ There is also a validator endpoint to validate XML files against the BuildingSyn
124123
#### SINGLE XML
125124

126125
Request: POST to https://buildingsync.net/api/validate
127-
Use form-data to specify the following parameters for schema version and XML file: ```schema_version``` and ```file```.
126+
Use form-data to specify the following parameters for schema version and XML file: `schema_version` and `file`.
128127

129128
Example Response:
130129
```json
@@ -165,7 +164,7 @@ Example Response:
165164
#### ZIP with multiple XMLs
166165

167166
Request: POST to https://buildingsync.net/api/validate
168-
Use form-data to specify the following parameters for schema version and XML file: ```schema_version``` and ```file```.
167+
Use form-data to specify the following parameters for schema version and XML file: `schema_version` and `file`.
169168

170169
Example Response:
171170
```json
@@ -236,25 +235,24 @@ Example Response:
236235
}
237236
```
238237
239-
240238
### BEDES
241239
242240
BEDES parsing and mapping to the BuildingSync schema is not an automated process, due to the manual inspections/corrections required.
243241
244242
To parse and map a new BEDES version:
245243
246-
1. Download the ```bedes_online_dictionary_uuid-lo.xml``` and the ```bedes_online_dictionary_uuid-terms.xml``` files from the BEDES website.
244+
1. Download the bedes_online_dictionary_uuid-lo.xml` and the `bedes_online_dictionary_uuid-terms.xml` files from the BEDES website.
247245
248-
1. Place these new BEDES XMLs in the lib/bedes/vX.X directory. vX.X refers to the BEDES version here.
246+
1. Place these new BEDES XMLs in the lib/bedes/vX.X directory. vX.X refers to the BEDES version here.
249247
250248
1. Parse the BEDES XMLs into a JSON file and map the BEDES terms to the BuildingSync attributes:
251249
```bash
252250
python manage.py bedes --schema_version=X.X.X --bedes_version=X.X
253251
```
254252
Note that the bedes_version contains a v, ex: v2.2.
255-
This will create a ```bedes_vX.X.json``` file in the lib/bedes/vX.X directory. It will also create 2 CSV files: ```bedes-mappings-enumerations.csv``` and ```bedes-mappings-terms.csv``` in the lib/bedes/vX.X/schemaX.X directory.
253+
This will create a bedes_vX.X.json` file in the lib/bedes/vX.X directory. It will also create 2 CSV files: `bedes-mappings-enumerations.csv` and `bedes-mappings-terms.csv` in the lib/bedes/vX.X/schemaX.X directory.
256254
257-
*Note* &mdash; The BEDES terms must be mapped for each version of the BuildingSync schema by calling the ```python manage.py bedes``` command above.
255+
_Note_ &mdash; The BEDES terms must be mapped for each version of the BuildingSync schema by calling the python manage.py bedes` command above.
258256
259257
1. Review these mapping files and make changes as needed.
260258
@@ -273,8 +271,8 @@ Admin interface is available at `/admin`
273271
274272
Follow these steps to add a new schema version to the selection tool:
275273
276-
1. Add the schema file in the admin interface. Must have admin privileges. The schema will get automatically parsed.
277-
1. Convert existing use cases schematron files to the new schema. Add the new use cases.
274+
1. Add the schema file in the admin interface. Must have admin privileges. The schema will get automatically parsed.
275+
1. Convert existing use cases schematron files to the new schema. Add the new use cases.
278276
1. When the use cases have been reviewed, make them public in the admin interface.
279277
1. Create XML example files and place them in the `lib/validator/examples/schema<VERSION>` directory.
280278
1. Test the validator with the new XML example files.
@@ -287,14 +285,14 @@ Follow these steps to add new example tables from the TestSuite repo
287285
1. Clone the [TestSuite](https://github.com/BuildingSync/TestSuite) repo
288286
2. Install [pandoc](https://pandoc.org/installing.html)
289287
3. Convert the TestSuite README to html:
290-
``` pandoc README.md -s -o README.html ```
291-
4. Copy the tables part of the README.html and paste to replace the old content in ```bsyncviewer/templates/examples.html```.
288+
`pandoc README.md -s -o README.html`
289+
4. Copy the tables part of the README.html and paste to replace the old content in `bsyncviewer/templates/examples.html`.
292290
293291
### Adding an OpenStudio Simulation Use Case from the TestSuite repo
294292
295-
1. The relevant files are currently on the `develop` branch of the [TestSuite](https://github.com/BuildingSync/TestSuite/tree/develop) repo. Clone the repo locally.
296-
1. OpenStudio Simulation use case schematron files include patterns from a [library of schematron files](https://github.com/BuildingSync/TestSuite/tree/develop/lib). Copy these files from the TestSuite repo into the selection-tool at the following location: ```bsyncviewer/testsuitelib```.
297-
1. Open the relevant use case file from the TestSuite repo. For example: [L00_OpenStudio_Simulation.sch](https://github.com/BuildingSync/TestSuite/blob/develop/schematron/v2.2.0/v2-2-0_L000_OpenStudio_Simulation.sch). Edit the include statements at the top of the file with relative paths to the buildingsync-website testsuitelib directory. Save the file.
293+
1. The relevant files are currently on the `develop` branch of the [TestSuite](https://github.com/BuildingSync/TestSuite/tree/develop) repo. Clone the repo locally.
294+
1. OpenStudio Simulation use case schematron files include patterns from a [library of schematron files](https://github.com/BuildingSync/TestSuite/tree/develop/lib). Copy these files from the TestSuite repo into the selection-tool at the following location: `bsyncviewer/testsuitelib`.
295+
1. Open the relevant use case file from the TestSuite repo. For example: [L00_OpenStudio_Simulation.sch](https://github.com/BuildingSync/TestSuite/blob/develop/schematron/v2.2.0/v2-2-0_L000_OpenStudio_Simulation.sch). Edit the include statements at the top of the file with relative paths to the buildingsync-website testsuitelib directory. Save the file.
298296
```bash
299297
<include href="../../testsuitelib/rootElements.sch#root.oneOfEachUntilBuilding"/>
300298
<include href="../../testsuitelib/rootElements.sch#root.oneOfEachFacilityUntilScenario"/>
@@ -305,10 +303,10 @@ Follow these steps to add new example tables from the TestSuite repo
305303
<include href="../../testsuitelib/floorElements.sch#fa.oneOfType"/>
306304
<include href="../../testsuitelib/floorElements.sch#fa.haveTypeAndValue"/>
307305
```
308-
1. Add the use case to the selection-tool by browsing to the ```/use_cases``` URL and clicking the *New Use Case* button.
306+
1. Add the use case to the selection-tool by browsing to the `/use_cases` URL and clicking the _New Use Case_ button.
309307
1. Fill out the name, description, and schema version
310308
1. Upload the file that was modified in the previous step
311309
1. Save
312310
1. Make the use case public from the selection-tool admin interface.
313-
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/develop/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.
311+
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/develop/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.
314312
1. You can now validate XMLs against the new use case.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import os
2+
import subprocess
3+
4+
from django.core.management.base import BaseCommand
5+
6+
7+
class Command(BaseCommand):
8+
help = 'Generate onboarding html and pdf'
9+
10+
def handle(self, *args, **options):
11+
subprocess.check_output('pandoc --wrap=none ../../docs/onboarding.md -o onboarding_content.html',
12+
cwd='bsyncviewer/templates').decode()
13+
subprocess.check_output('pandoc ../../docs/onboarding.md -o documents/BuildingSync-on-boarding.pdf',
14+
cwd='bsyncviewer/static').decode()
Binary file not shown.
12.4 KB
Loading

bsyncviewer/static/images/cerl.png

90.8 KB
Loading

bsyncviewer/static/images/doee.jpg

94.3 KB
Loading
-185 KB
Binary file not shown.
-188 KB
Binary file not shown.
-23.1 KB
Binary file not shown.
44.8 KB
Loading
-91.1 KB
Binary file not shown.
180 KB
Loading

bsyncviewer/templates/about.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ <h6>Leverage expert support from DOE and the National Renewable Energy Laborator
110110
</div>
111111
</section>
112112

113-
<p>Get started by downloading the <a href="https://github.com/BuildingSync/schema/releases" target="_blank" rel="noopener">BuildingSync schema</a> or
113+
<p>Get started by downloading the <a href="https://github.com/BuildingSync/schema/releases/latest" target="_blank" rel="noopener">BuildingSync schema</a> or
114114
<a href="https://buildingsync.net/validator" target="_blank" rel="noopener">validating</a> your use case.</p>
115115
</div>
116116

bsyncviewer/templates/adopters.html

+11-19
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@
1313
<div class="serv-row text-center">
1414
<div class="col-md-4">
1515
<div class="serv-item">
16-
<a href="https://www.pnnl.gov/" target="_blank" rel="noopener"><img class="collab-image" src="{% static 'images/pnnl.png' %}" alt="PNNL logo"></a>
16+
<a href="https://www.erdc.usace.army.mil/Locations/CERL/" target="_blank" rel="noopener"><img class="collab-image-sf" src="{% static 'images/cerl.png' %}" alt="CERL logo"></a>
1717
</div>
1818
</div>
1919

2020
<div class="col-md-4">
2121
<div class="serv-item">
22-
<a href="https://psdconsulting.com/" target="_blank" rel="noopener"><img class="collab-image" src="{% static 'images/psd.png' %}" alt="PSD logo"></a>
22+
<a href="https://doee.dc.gov/" target="_blank" rel="noopener"><img class="collab-image-sf" src="{% static 'images/doee.jpg' %}" alt="DOEE logo"></a>
2323
</div>
2424
</div>
2525

2626
<div class="col-md-4">
2727
<div class="serv-item">
28-
<a href="https://buildee.com/" target="_blank" rel="noopener"><img class="collab-image" src="{% static 'images/buildee.png' %}" alt="Buildee logo"></a>
28+
<a href="https://openstudio.net/" target="_blank" rel="noopener"><img class="collab-image" src="{% static 'images/openstudio.png' %}" alt="OpenStudio logo"></a>
2929
</div>
3030
</div>
3131
</div>
@@ -35,43 +35,35 @@
3535
<div class="serv-row text-center">
3636
<div class="col-md-4">
3737
<div class="serv-item">
38-
<a href="https://www.brightpower.com/" target="_blank" rel="noopener"><img class="collab-image" src="{% static 'images/bright_power.png' %}" alt="Bright Power logo"></a>
38+
<a href="https://www.pnnl.gov/" target="_blank" rel="noopener"><img class="collab-image" src="{% static 'images/pnnl.png' %}" alt="PNNL logo"></a>
3939
</div>
4040
</div>
4141

4242
<div class="col-md-4">
4343
<div class="serv-item">
44-
<a href="https://aecom.com/" target="_blank" rel="noopener"><img class="collab-image" src="{% static 'images/aecom.png' %}" alt="AECOM logo"></a>
44+
<a href="https://psdconsulting.com/" target="_blank" rel="noopener"><img class="collab-image" src="{% static 'images/psd.png' %}" alt="PSD logo"></a>
4545
</div>
4646
</div>
4747

4848
<div class="col-md-4">
49-
<div class="serv-item">
50-
<a href="https://brandnewbox.com/" target="_blank" rel="noopener"><img class="collab-image" src="{% static 'images/brand_new_box.png' %}" alt="Brand New Box logo"></a>
49+
<div class="serv-item-sf">
50+
<a href="https://sfenvironment.org/" target="_blank" rel="noopener"><img class="collab-image-sf" src="{% static 'images/sf_environment.png' %}" alt="SF Environment logo"></a>
5151
</div>
5252
</div>
5353
</div>
5454
</div>
5555

5656
<div class="row">
5757
<div class="serv-row text-center">
58-
<div class="col-md-4">
59-
<div class="serv-item">
60-
<a href="https://www.lbl.gov/" target="_blank" rel="noopener"><img class="collab-image" src="{% static 'images/berkley_lab_logo.svg' %}" alt="LBL logo"></a>
61-
</div>
62-
</div>
63-
64-
<div class="col-md-4">
65-
<div class="serv-item-sf">
66-
<a href="https://sfenvironment.org/" target="_blank" rel="noopener"><img class="collab-image-sf" src="{% static 'images/sf_environment.png' %}" alt="SF Environment logo"></a>
67-
</div>
68-
</div>
58+
<div class="col-md-4"></div>
6959

7060
<div class="col-md-4">
7161
<div class="serv-item">
72-
<a href="https://audette.io/" target="_blank" rel="noopener"><img class="collab-image" src="{% static 'images/audette-logo.png' %}" alt="Audette logo"></a>
62+
<a href="https://buildee.com/" target="_blank" rel="noopener"><img class="collab-image" src="{% static 'images/buildee.png' %}" alt="Buildee logo"></a>
7363
</div>
7464
</div>
65+
66+
<div class="col-md-4"></div>
7567
</div>
7668
</div>
7769
</div>

0 commit comments

Comments
 (0)