Skip to content

Commit

Permalink
Merge pull request #29 from open205/fix-web-content-examples-markdown
Browse files Browse the repository at this point in the history
Add web content from markdown source and fix multiple example files
  • Loading branch information
nealkruis authored May 29, 2020
2 parents a1a7ef0 + 25faa5c commit 813b84a
Show file tree
Hide file tree
Showing 15 changed files with 182 additions and 135 deletions.
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pipenv = "*"
atomicwrites = "*"
Jinja2 = "*"
gitpython = "*"
markdown = "*"

[packages]
click = "*"
Expand Down
94 changes: 51 additions & 43 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions test/test_tk205_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ def test_get_schema_node():
assert('ASHRAE 205' not in node['description'])

def test_get_representation_node_and_rs_selections():
rep = tk205.load('schema-205/examples/RS0002/RS0002SimpleExampleFile.a205.json')
rep = tk205.load('schema-205/examples/RS0002/Unitary-Constant-Efficiency.RS0002.a205.json')
node, rs_selections = tk205.util.get_representation_node_and_rs_selections(rep, ['RS_instance','performance','DX_system_representation','RS_instance','performance','performance_map_cooling','grid_variables'])
assert(len(node) == 6)
assert(rs_selections[0] == tk205.util.get_rs_index('RS0002'))
assert(rs_selections[3] == tk205.util.get_rs_index('RS0004'))

def test_create_grid_set():
rep = tk205.load('schema-205/examples/RS0004/RS0004SimpleExampleFile.a205.json')
rep = tk205.load('schema-205/examples/RS0004/DX-Constant-Efficiency.RS0004.a205.json')
schema = tk205.A205Schema(os.path.join(os.path.dirname(__file__),'..','schema-205',"schema","ASHRAE205.schema.json"))
grid_set = schema.create_grid_set(rep, ['RS_instance','performance','performance_map_cooling','grid_variables'])
table_length = 1
Expand Down Expand Up @@ -94,7 +94,7 @@ def test_get_grid_variable_order():
assert(order == grid_vars_names)

def test_process_grid_set():
rep = tk205.load('schema-205/examples/RS0004/RS0004SimpleExampleFile.a205.json')
rep = tk205.load('schema-205/examples/RS0004/DX-Constant-Efficiency.RS0004.a205.json')
grid_vars = rep['RS_instance']['performance']['performance_map_cooling']['grid_variables']
schema = tk205.A205Schema(os.path.join(os.path.dirname(__file__),'..','schema-205',"schema","ASHRAE205.schema.json"))
grid_set = schema.create_grid_set(rep, ['RS_instance','performance','performance_map_cooling','grid_variables'])
Expand Down
33 changes: 33 additions & 0 deletions web/markdown-content/about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# ASHRAE Standard 205P: Representation of Performance Data for HVAC&R and Other Facility Equipment

## Purpose

To facilitate automated sharing of equipment performance characteristics by defining data models and data serialization formats.

## Scope

This standard applies to performance data for any HVAC&R or other facility system, equipment, or component.

## About ASHRAE Standard 205P

ASHRAE Standard 205P defines common data models and serialization formats for facility equipment performance data needed for engineering applications such as energy simulation. The formats allow automated exchange among data sources (manufacturers), simulation models, and other engineering applications. The formats and procedures specified in the standard are developed by SPC (Standard Project Committee) 205 under ASHRAE and ANSI consensus processes. SPC-205 membership includes equipment manufacturers, application software developers, and engineering practitioners.

Review copies of Standard 205P are available until July 29, 2020 at [ASHRAE’s online review portal](https://osr.ashrae.org/default.aspx).

Standard 205 defines the term *representation* to mean a Concise Binary Object Representation (CBOR) file conforming to a JSON schema defined by a human-readable (text) document called a *representation specification*. Representation specifications are included in Standard 205P appended as an open-ended set.

Standard 205 structure and application can be visualized as follows:

![Visualization of Standard 205 structure and application](assets/images/standard-205-diagram.svg)

This web site hosts supporting material for each representation specification, including:

- [***JSON schema***](schema.html) files are the software-readable equivalent of the data model portion of each representation specification. The files are a normative portion of Standard 205.

- [***Examples files***](examples.html) provide illustrative examples of each representation. Several file formats are provided.

- [***XLSX templates***](templates.html) can be downloaded, populated by hand, and then process with [Toolkit 205](tk205.html) procedures to convert to a standard CBOR representation.

All representations have common structures and elements. An open source project, [open205](https://github.com/open205), is underway to provide software components for use by data publishers and application developers.

SPC 205 is developing representation specifications for additional equipment types. These will be published in future revisions of the standard.
8 changes: 8 additions & 0 deletions web/markdown-content/examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Examples provided here are for illustrative purposes only. While CBOR is the official representation format defined by ASHRAE Standard 205P, it is sometime convenient to view and edit representation data in other formats. All other file formats must be translated to CBOR for use in application software. Routines for converting between the file formats are included in [Toolkit 205](tk205.html).

Each example represntation is provided in four formats:

- **[CBOR](https://cbor.io/):** CBOR is machine-readable, but not human-readable.
- **[XLSX](https://wiki.fileformat.com/spreadsheet/xlsx/):** Convenient spreadsheet format for viewing and editing representation data (see [XLSX Templates](templates.html) for empty examples for creating new representations).
- **[JSON](https://www.json.org/):** A common, human-and-machine-readable data exchange format.
- **[YAML](https://yaml.org/):** An alterntaive common, human-and-machine-readable data exchange format.
1 change: 1 addition & 0 deletions web/markdown-content/schema.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
***Informative note:*** The schema is maintained in the [schema-205](https://github.com/open205/schema-205) GitHub repository.
1 change: 1 addition & 0 deletions web/markdown-content/templates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Templates set up in the XLSX format for users to generate 205 compliant data. These templates will need to be translated into CBOR, but can be validated directly using [Toolkit 205](tk205.html).
1 change: 1 addition & 0 deletions web/markdown-content/tk205.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A software toolkit to facilitate the adoption of the ASHRAE Standard 205P data exchange specification.
9 changes: 1 addition & 8 deletions web/templates/about_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,7 @@
<div class="main">
<div class="section">
<div class="contained">
<h1>ASHRAE Standard 205P</h1>
<hr>
<h2>Representation of Performance Data for HVAC&R and Other Facility Equipment</h2>
<h3>Purpose</h3>
<p>To facilitate automated sharing of equipment performance characteristics by defining data models and data serialization formats.</p>
<h3>Scope</h3>
<p>This standard applies to performance data for any HVAC&R or other facility system, equipment, or component.</p>

{{markdown}}
<hr>
<div class="footer"><p>Generated: {{timestamp}}</p></div>
</div>
Expand Down
54 changes: 13 additions & 41 deletions web/templates/examples_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,58 +6,30 @@
<div class="contained">
<h2>{{headline}}</h2>
<hr>
{{markdown}}
<hr>
<ul class="accordion">
{% for key, item in content.items() %}
{% for RS in content %}
<li class="is-active">
<span id="RS" >{{key}}</span>
<span id="RS" >{{RS}}: {{content[RS]['title']}}</span>
{% for file in content[RS]['files'] %}
<div class="accordion-content">
<div style="display: flex; justify-content: space-around; padding-top: 20px" class="row">
<div class="col-md-4">
<h4><a id="personal"></a>{{item['description']}}
{% if 'cbor' in file %}
cbor
{% elif 'json' in file %}
json
{% elif 'xlsx' in file %}
xlsx
{% elif 'yaml' in file %}
yaml
{% elif 'yml' in file %}
yaml
{% endif %}
<div class="col-md-5">
<h4><a id="personal"></a>
{{file}}
</h4>
</div>
{% for file in item['file_list'] %}
<div class="col-md-2">
<a class="btn btn--hexagon-secondary" href="assets/examples/
{% if 'cbor' in file %}
cbor
{% elif 'json' in file %}
json
{% elif 'xlsx' in file %}
xlsx
{% elif 'yaml' in file %}
yaml
{% elif 'yml' in file %}
yaml
{% endif %}
/{{ file }}">
{% if 'cbor' in file %}
cbor
{% elif 'json' in file %}
json
{% elif 'xlsx' in file %}
xlsx
{% elif 'yaml' in file %}
yaml
{% elif 'yml' in file %}
yaml
{% endif %}
{% for file_type in content[RS]['files'][file] %}
<div class="col-md-1.25">
<a class="btn btn--hexagon-secondary" href="assets/examples/{{ file_type }}/{{RS}}/{{ content[RS]['files'][file][file_type] }}">
{{ file_type }}
</a>
</div>
{% endfor %}
</div>
</div>
{% endfor %}
</li>
{% endfor %}
<li></li>
Expand Down
5 changes: 3 additions & 2 deletions web/templates/schema_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@

<h2>{{headline}}</h2>
<hr>

{% for key, item in content.items() %}
{{markdown}}
<hr>
{% for key, item in content.items() %}
<div class="row">
<div class="column lg-12">
<h3 class="featureBlock-subHeading" style="margin-top: 6.5px;">{{item['title']}}</h3>
Expand Down
Loading

0 comments on commit 813b84a

Please sign in to comment.