urbanopt-geojson 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7613399a7562744b442496ca2e1f504ea799dcbeb53aa4f70b3515c91d9cdd00
4
- data.tar.gz: d93fde6bdd9ad432bc560dc0f76ee17e5c67bd2c79be13e4521a944f6e28aa75
3
+ metadata.gz: 4106ba555afeedb72ee9af421850a0d26226136d64b85c60143fe9cffdab2848
4
+ data.tar.gz: dda42f59468fa27eb9e532f4a2e35bd0fa397ce5d929bdcda0a49f26bd701461
5
5
  SHA512:
6
- metadata.gz: d07deae4e780938602afdee97570444d68c48373343437728d793ac6962bd5f50e0c2112190d05f435e6bb381ade777e3e4d563cca61a5dafa6f834d24ef35f4
7
- data.tar.gz: dd481e3f4dce7716c2dd7f8f9950678d24b53bfb21a61d76459cfccdef0dde2330040b0d974d7f1782905f80538ffc012877d32e28c2fc086e76bd96c5c957ac
6
+ metadata.gz: 70855197e712c96b458553b469840ac6607e1d60dc255b6558470b5fc4225f5561d33b0043972e158b00625c1e257883595c3b327762d9b3cb7e747ec5d33ef5
7
+ data.tar.gz: 125d45fe2a4ca9641145a2625870b50bf23ef6b2e876e10e4e655adcd1c68692eaed87dd03976b7b2f7ab44c10fa671b9576d9184fd13be9b3d213053b028c19
data/CHANGELOG.md CHANGED
@@ -1,7 +1,12 @@
1
1
  # URBANopt GeoJSON Gem
2
2
 
3
+ ## Version 0.8.1
4
+ Date Range: 05/11/22 - 06/27/22
5
+
6
+ - Fixed [#233]( https://github.com//urbanopt/urbanopt-geojson-gem/pull/233 ), Emissions workflow enhancements
7
+
3
8
  ## Version 0.8.0
4
- Date Range: 11/23/21 - 05/10/21
9
+ Date Range: 11/23/21 - 05/10/22
5
10
  - Fixed [#205]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/205 ), adding RNM result fields
6
11
  - Fixed [#206]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/206 ), Bump follow-redirects from 1.13.3 to 1.14.7 in /docs
7
12
  - Fixed [#207]( https://github.com/urbanopt/urbanopt-geojson-gem/pull/207 ), Bump follow-redirects from 1.13.3 to 1.14.8 in /docs
@@ -82,6 +82,7 @@ module URBANopt
82
82
  symbolize_names: true
83
83
  )
84
84
 
85
+
85
86
  # validate geojson file against schema
86
87
  geojson_errors = validate(@@geojson_schema, geojson_file)
87
88
  unless geojson_errors.empty?
@@ -91,6 +92,15 @@ module URBANopt
91
92
  # initialize @@logger
92
93
  @@logger ||= URBANopt::GeoJSON.logger
93
94
 
95
+ # validate project section first
96
+ if geojson_file.key?(:project)
97
+ errors = validate(@@site_schema, geojson_file[:project])
98
+
99
+ unless errors.empty?
100
+ raise "Project section does not adhere to schema: \n #{errors.join('\n ')}"
101
+ end
102
+ end
103
+
94
104
  # validate each feature against schema
95
105
  geojson_file[:features].each do |feature|
96
106
  properties = feature[:properties]
@@ -213,12 +223,12 @@ module URBANopt
213
223
  { site: :weather_filename, feature: :weather_filename },
214
224
  { site: :tariff_filename, feature: :tariff_filename },
215
225
  { site: :emissions, feature: :emissions },
216
- { site: :emissions_future_subregion, feature: :emissions_future_subregion },
217
- { site: :emissions_hourly_historical_subregion, feature: :emissions_hourly_historical_subregion },
218
- { site: :emissions_annual_historical_subregion, feature: :emissions_annual_historical_subregion },
219
- { site: :emissions_future_year, feature: :emissions_future_year },
220
- { site: :emissions_hourly_historical_year, feature: :emissions_hourly_historical_year },
221
- { site: :emissions_annual_historical_year, feature: :emissions_annual_historical_year }
226
+ { site: :electricity_emissions_future_subregion, feature: :electricity_emissions_future_subregion },
227
+ { site: :electricity_emissions_hourly_historical_subregion, feature: :electricity_emissions_hourly_historical_subregion },
228
+ { site: :electricity_emissions_annual_historical_subregion, feature: :electricity_emissions_annual_historical_subregion },
229
+ { site: :electricity_emissions_future_year, feature: :electricity_emissions_future_year },
230
+ { site: :electricity_emissions_hourly_historical_year, feature: :electricity_emissions_hourly_historical_year },
231
+ { site: :electricity_emissions_annual_historical_year, feature: :electricity_emissions_annual_historical_year }
222
232
  ]
223
233
 
224
234
  add_props.each do |prop|
@@ -295,6 +305,19 @@ module URBANopt
295
305
  return result
296
306
  end
297
307
 
308
+ def self.get_site_schema(strict)
309
+ result = nil
310
+ File.open(File.dirname(__FILE__) + '/schema/site_properties.json') do |f|
311
+ result = JSON.parse(f.read)
312
+ end
313
+ if strict
314
+ result['additionalProperties'] = true
315
+ else
316
+ result['additionalProperties'] = false
317
+ end
318
+ return result
319
+ end
320
+
298
321
  def self.get_electrical_connector_schema(strict)
299
322
  result = nil
300
323
  File.open(File.dirname(__FILE__) + '/schema/electrical_connector_properties.json') do |f|
@@ -356,6 +379,7 @@ module URBANopt
356
379
  @@electrical_junction_schema = get_electrical_junction_schema(strict)
357
380
  @@thermal_connector_schema = get_thermal_connector_schema(strict)
358
381
  @@thermal_junction_schema = get_thermal_junction_schema(strict)
382
+ @@site_schema = get_site_schema(strict)
359
383
  end
360
384
  end
361
385
  end
@@ -283,141 +283,16 @@
283
283
  "ev_curtailment_frac": {
284
284
  "description": "Fraction between 0 and 1 that denotes curtailment of EV charging load to better align EV charging with expected energy production from a solar PV system",
285
285
  "type": "number"
286
- },
287
- "emissions": {
288
- "description": "Should be set to true to calculate emissions for the associated building.",
289
- "type": "boolean"
290
- },
291
- "emissions_future_subregion": {
292
- "description": "Future subregion. Options: AZNMc, CAMXc, ERCTc, FRCCc, MROEc, MROWc, NEWEc, NWPPc, NYSTc, RFCEc, RFCMc, RFCWc, RMPAc, SPNOc, SPSOc, SRMVc, SRMWc, SRSOc, SRTVc, and SRVCc",
293
- "type": "string",
294
- "enum": [
295
- "AZNMc",
296
- "CAMXc",
297
- "ERCTc",
298
- "FRCCc",
299
- "MROEc",
300
- "MROWc",
301
- "NEWEc",
302
- "NWPPc",
303
- "NYSTc",
304
- "RFCEc",
305
- "RFCMc",
306
- "RFCWc",
307
- "RMPAc",
308
- "SPNOc",
309
- "SPSOc",
310
- "SRMVc",
311
- "SRMWc",
312
- "SRSOc",
313
- "SRTVc",
314
- "SRVCc"
315
- ]
316
- },
317
- "emissions_hourly_historical_subregion": {
318
- "description": "Historical hourly subregion. Options: California, Carolinas, Central, Florida, Mid-Atlantic, Midwest, New England, New York, Northwest, Rocky Mountains, Southeast, Southwest, Tennessee, and Texas",
319
- "type": "string",
320
- "enum": [
321
- "California",
322
- "Carolinas",
323
- "Central",
324
- "Florida",
325
- "Mid-Atlantic",
326
- "Midwest",
327
- "New England",
328
- "New York",
329
- "Northwest",
330
- "Rocky Mountains",
331
- "Southeast",
332
- "Southwest",
333
- "Tennessee",
334
- "Texas"
335
- ]
336
- },
337
- "emissions_annual_historical_subregion": {
338
- "description": "Historical annual subregion. Options: AKGD, AKMS, AZNM, CAMX, ERCT, FRCC, HIMS, HIOA, MROE, MROW, NEWE, NWPP, NYCW, NYLI, NYUP, RFCE, RFCM, RFCW, RMPA, SPNO, SPSO, SRMV, SRMW, SRSO, SRTV, and SRVC",
339
- "type": "string",
340
- "enum": [
341
- "AKGD",
342
- "AKMS",
343
- "AZNM",
344
- "CAMX",
345
- "ERCT",
346
- "FRCC",
347
- "HIMS",
348
- "HIOA",
349
- "MROE",
350
- "MROW",
351
- "NEWE",
352
- "NWPP",
353
- "NYCW",
354
- "NYLI",
355
- "NYUP",
356
- "RFCE",
357
- "RFCM",
358
- "RFCW",
359
- "RMPA",
360
- "SPNO",
361
- "SPSO",
362
- "SRMV",
363
- "SRMW",
364
- "SRSO",
365
- "SRTV",
366
- "SRVC"
367
- ]
368
- },
369
- "emissions_future_year": {
370
- "description": "Future Year. Options: 2020 to 2050 in two year increments",
371
- "type": "string",
372
- "enum": [
373
- "2020",
374
- "2022",
375
- "2024",
376
- "2026",
377
- "2028",
378
- "2030",
379
- "2032",
380
- "2034",
381
- "2036",
382
- "2038",
383
- "2040",
384
- "2042",
385
- "2044",
386
- "2046",
387
- "2048",
388
- "2050"
389
- ]
390
- },
391
- "emissions_hourly_historical_year": {
392
- "description": "Hourly Historical Year. Options: 2019.",
393
- "type": "string",
394
- "enum": [
395
- "2019"
396
- ]
397
- },
398
- "emissions_annual_historical_year": {
399
- "description": "Annual Historical Year. Options: 2007, 2009, 2010, 2012, 2014, 2016, 2018, and 2019.",
400
- "type": "string",
401
- "enum": [
402
- "2007",
403
- "2009",
404
- "2010",
405
- "2012",
406
- "2014",
407
- "2016",
408
- "2018",
409
- "2019"
410
- ]
411
286
  }
412
287
  },
413
- "required": [
414
- "building_type",
415
- "floor_area",
416
- "footprint_area",
288
+ "required": [
417
289
  "id",
290
+ "type",
418
291
  "name",
292
+ "floor_area",
419
293
  "number_of_stories",
420
- "type"
294
+ "footprint_area",
295
+ "building_type"
421
296
  ],
422
297
  "definitions": {
423
298
  "buildingType": {
@@ -640,4 +515,4 @@
640
515
  ]
641
516
  }
642
517
  }
643
- }
518
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-04/schema#",
3
- "id": "http://json-schema.org/openstudio-urban-modeling/taxlot_properties.json#",
3
+ "id": "http://json-schema.org/openstudio-urban-modeling/site_properties.json#",
4
4
  "title": "URBANopt Site",
5
5
  "description": "Schema for an URBANopt Site object",
6
6
  "type": "object",
@@ -35,11 +35,11 @@
35
35
  },
36
36
  "surface_elevation": {
37
37
  "description": "The surface elevation (above NAVD88 datum) of the project (ft). ",
38
- "type": "number"
38
+ "type": ["number", "null"]
39
39
  },
40
40
  "import_surrounding_buildings_as_shading": {
41
41
  "description": "If true, import geometry from surrounding buildings when performing energy calculations.",
42
- "type": "boolean"
42
+ "type": ["boolean", "null"]
43
43
  },
44
44
  "timesteps_per_hour": {
45
45
  "description": "Number of timesteps per hour for energy simulations.",
@@ -57,11 +57,11 @@
57
57
  },
58
58
  "climate_zone": {
59
59
  "description": "ASHRAE 169 climate zone.",
60
- "type": "string"
60
+ "type": ["string", "null"]
61
61
  },
62
62
  "cec_climate_zone": {
63
63
  "description": "CEC Title24 climate zone.",
64
- "type": "string"
64
+ "type": ["string", "null"]
65
65
  },
66
66
  "default_template": {
67
67
  "description": "Default OpenStudio Standards template.",
@@ -73,7 +73,7 @@
73
73
  },
74
74
  "tariff_filename": {
75
75
  "description": "Name of utility tariff file in IDF or URDB format.",
76
- "type": "string"
76
+ "type": ["string", "null"]
77
77
  },
78
78
  "underground_cables_ratio": {
79
79
  "description": "Ratio of overall cables that are underground vs. overhead for RNM analysis.",
@@ -88,40 +88,132 @@
88
88
  "type": "number"
89
89
  },
90
90
  "emissions": {
91
- "description": "Should be set to true to calculate emissions for the associated building.",
91
+ "description": "Should be set to true to calculate electricity emissions for the associated building.",
92
92
  "type": "boolean"
93
93
  },
94
- "emissions_future_subregion": {
95
- "description": "Future subregion. Options are: AZNMc, CAMXc, ERCTc, FRCCc, MROEc, MROWc, NEWEc, NWPPc, NYSTc, RFCEc, RFCMc, RFCWc, RMPAc, SPNOc, SPSOc, SRMVc, SRMWc, SRSOc, SRTVc, and SRVCc",
96
- "type": "string"
97
- },
98
- "emissions_hourly_historical_subregion": {
99
- "description": "Historical hourly subregion. Options are: California, Carolinas, Central, Florida, Mid-Atlantic, Midwest, New England, New York, Northwest, Rocky Mountains, Southeast, Southwest, Tennessee, and Texas",
100
- "type": "string"
101
- },
102
- "emissions_annual_historical_subregion": {
103
- "description": "Historical annual subregion. Options are: AKGD, AKMS, AZNM, CAMX, ERCT, FRCC, HIMS, HIOA, MROE, MROW, NEWE, NWPP, NYCW, NYLI, NYUP, RFCE, RFCM, RFCW, RMPA, SPNO, SPSO, SRMV, SRMW, SRSO, SRTV, and SRVC",
104
- "type": "string"
105
- },
106
- "emissions_future_year": {
107
- "description": "Future Year. Options are: 2020 to 2050 in two year increments",
108
- "type": "string"
109
- },
110
- "emissions_hourly_historical_year": {
111
- "description": "Hourly Historical Year. Options are: 2019.",
112
- "type": "string"
113
- },
114
- "emissions_annual_historical_year": {
115
- "description": "Annual Historical Year. Options are: 2007, 2009, 2010, 2012, 2014, 2016, 2018, and 2019.",
116
- "type": "string"
117
- },
118
- "user_data": {
119
- "description": "Arbitrary user data"
94
+ "electricity_emissions_future_subregion": {
95
+ "description": "Future subregion for electricity emssions. Options: AZNMc, CAMXc, ERCTc, FRCCc, MROEc, MROWc, NEWEc, NWPPc, NYSTc, RFCEc, RFCMc, RFCWc, RMPAc, SPNOc, SPSOc, SRMVc, SRMWc, SRSOc, SRTVc, and SRVCc",
96
+ "type": "string",
97
+ "enum": [
98
+ "AZNMc",
99
+ "CAMXc",
100
+ "ERCTc",
101
+ "FRCCc",
102
+ "MROEc",
103
+ "MROWc",
104
+ "NEWEc",
105
+ "NWPPc",
106
+ "NYSTc",
107
+ "RFCEc",
108
+ "RFCMc",
109
+ "RFCWc",
110
+ "RMPAc",
111
+ "SPNOc",
112
+ "SPSOc",
113
+ "SRMVc",
114
+ "SRMWc",
115
+ "SRSOc",
116
+ "SRTVc",
117
+ "SRVCc"
118
+ ]
119
+ },
120
+ "electricity_emissions_hourly_historical_subregion": {
121
+ "description": "Historical hourly subregion for electricity emissions. Options: California, Carolinas, Central, Florida, Mid-Atlantic, Midwest, New England, New York, Northwest, Rocky Mountains, Southeast, Southwest, Tennessee, and Texas",
122
+ "type": "string",
123
+ "enum": [
124
+ "California",
125
+ "Carolinas",
126
+ "Central",
127
+ "Florida",
128
+ "Mid-Atlantic",
129
+ "Midwest",
130
+ "New England",
131
+ "New York",
132
+ "Northwest",
133
+ "Rocky Mountains",
134
+ "Southeast",
135
+ "Southwest",
136
+ "Tennessee",
137
+ "Texas"
138
+ ]
139
+ },
140
+ "electricity_emissions_annual_historical_subregion": {
141
+ "description": "Historical annual subregion for electricity emissions. Options: AKGD, AKMS, AZNM, CAMX, ERCT, FRCC, HIMS, HIOA, MROE, MROW, NEWE, NWPP, NYCW, NYLI, NYUP, RFCE, RFCM, RFCW, RMPA, SPNO, SPSO, SRMV, SRMW, SRSO, SRTV, and SRVC",
142
+ "type": "string",
143
+ "enum": [
144
+ "AKGD",
145
+ "AKMS",
146
+ "AZNM",
147
+ "CAMX",
148
+ "ERCT",
149
+ "FRCC",
150
+ "HIMS",
151
+ "HIOA",
152
+ "MROE",
153
+ "MROW",
154
+ "NEWE",
155
+ "NWPP",
156
+ "NYCW",
157
+ "NYLI",
158
+ "NYUP",
159
+ "RFCE",
160
+ "RFCM",
161
+ "RFCW",
162
+ "RMPA",
163
+ "SPNO",
164
+ "SPSO",
165
+ "SRMV",
166
+ "SRMW",
167
+ "SRSO",
168
+ "SRTV",
169
+ "SRVC"
170
+ ]
171
+ },
172
+ "electricity_emissions_future_year": {
173
+ "description": "Future Year for electricity emissions. Options: 2020 to 2050 in two year increments",
174
+ "type": "string",
175
+ "enum": [
176
+ "2020",
177
+ "2022",
178
+ "2024",
179
+ "2026",
180
+ "2028",
181
+ "2030",
182
+ "2032",
183
+ "2034",
184
+ "2036",
185
+ "2038",
186
+ "2040",
187
+ "2042",
188
+ "2044",
189
+ "2046",
190
+ "2048",
191
+ "2050"
192
+ ]
193
+ },
194
+ "electricity_emissions_hourly_historical_year": {
195
+ "description": "Hourly Historical Year for elecrtricity emissions. Options: 2019.",
196
+ "type": "string",
197
+ "enum": [
198
+ "2019"
199
+ ]
200
+ },
201
+ "electricity_emissions_annual_historical_year": {
202
+ "description": "Annual Historical Year for electricity emissions. Options: 2007, 2009, 2010, 2012, 2014, 2016, 2018, and 2019.",
203
+ "type": "string",
204
+ "enum": [
205
+ "2007",
206
+ "2009",
207
+ "2010",
208
+ "2012",
209
+ "2014",
210
+ "2016",
211
+ "2018",
212
+ "2019"
213
+ ]
120
214
  }
121
215
  },
122
216
  "required": [
123
- "latitude",
124
- "longitude"
125
217
  ],
126
218
  "additionalProperties": false
127
- }
219
+ }
@@ -40,6 +40,6 @@
40
40
 
41
41
  module URBANopt
42
42
  module GeoJSON
43
- VERSION = '0.8.0'.freeze
43
+ VERSION = '0.8.1'.freeze
44
44
  end
45
45
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: urbanopt-geojson
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tanushree Charan
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2022-05-13 00:00:00.000000000 Z
13
+ date: 2022-06-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler