aemo 0.5.1 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e0610b36dd8ee2549a4214175e18005c9527efa0b1b3a9fc42e1666042c28560
4
- data.tar.gz: 4617933ec303a04c5af67ebe63a5f26f4b2f9744121b9c1744d8352e450002de
3
+ metadata.gz: e034dcfeaf28060aa39be81b16e66a689ba571d7c5394f668665b2a9a2f0d0bf
4
+ data.tar.gz: aaaeef50ee4cdbf78d33b4ce992ac8aa268e03e4ad33d272c4e2e7d784a54db2
5
5
  SHA512:
6
- metadata.gz: 17ef64a9d15e03c8b54327e7f17b3704246ebf33439dc0990847be905819ca50d7f1fc2b13e944eacb42448017c6ce550d6e883a1a12bbff43a28ab326af114a
7
- data.tar.gz: 1d10696ae1bcc46f40d660454cfea20b8ddbb4f0ec4d03476090225e832d781f47abae09482ab3a1c0de6ace27080932c4c5195675a73af842428078aa2aa7a5
6
+ metadata.gz: 5fca44605b1d54f5199bfd8ba8e078703c74a9fb5c62628f1a9570508b64f2057187955842dadc764d7bc0d03c5851657ded9820fa79ee8ac962036377de3729
7
+ data.tar.gz: e0af286ab7bef3952a4159c0765389bdba82669b8f7c43c3fd03a4fdfff184e5480f0aad2f26d1850675ee94958e66cc36af94a5352e6929decb8555b39d5f73
@@ -3,7 +3,7 @@
3
3
  module AEMO
4
4
  class Region
5
5
  DISPATCH_TYPE = ['Generator', 'Load Norm Off', 'Network Service Provider'].freeze
6
- CATEGORY = ['Market', 'Non-Market'].freeze
7
- CLASSIFICATION = ['Scheduled', 'Semi-Scheduled', 'Non-Scheduled'].freeze
6
+ CATEGORY = %w[Market Non-Market].freeze
7
+ CLASSIFICATION = %w[Scheduled Semi-Scheduled Non-Scheduled].freeze
8
8
  end
9
9
  end
@@ -8,7 +8,7 @@ module AEMO
8
8
  # @since 0.3.0
9
9
  class InvalidNMIAllocationType < ArgumentError
10
10
  DEFAULT_MESSAGE = 'Not a valid allocation type, try one of ' \
11
- "#{AEMO::NMI::Allocation::SUPPORTED_TYPES.join(' |')}"
11
+ "#{AEMO::NMI::Allocation::SUPPORTED_TYPES.join(' |')}".freeze
12
12
 
13
13
  # Initialize an InvalidNMIAllocationType
14
14
  #
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AEMO
4
+ # AEMO::TimeError
5
+ #
6
+ # @author Joel Courtney
7
+ # @abstract An exception for time errors.
8
+ # @since 0.6.0
9
+ class TimeError < ArgumentError
10
+ DEFAULT_MESSAGE = 'Not a valid time'
11
+
12
+ # Initialize an TimeError
13
+ #
14
+ # @param [String] msg the error message
15
+ # @return [AEMO::TimeError]
16
+ def initialize(msg: DEFAULT_MESSAGE)
17
+ super
18
+ end
19
+ end
20
+ end
@@ -22,7 +22,7 @@ module AEMO
22
22
  # @param [Hash] options Hash of optional data values
23
23
  # @return [AEMO::Market::Interval]
24
24
  def initialize(datetime, options = {})
25
- @datetime = Time.parse("#{datetime} +1000")
25
+ @datetime = ::Time.parse("#{datetime} +1000")
26
26
  @region = options['REGION']
27
27
  @total_demand = options['TOTALDEMAND']
28
28
  @rrp = options['RRP']
@@ -35,7 +35,7 @@ module AEMO
35
35
  # All AEMO Data aggregates to the trailing edge of the period (this makes it difficult to do daily aggregations :( )
36
36
  # @param [Boolean] trailing_edge selection of either the trailing edge of the period or the rising edge of the period for the date time
37
37
  # @return [Time] a time object of the trailing edge of the interval
38
- def datetime(trailing_edge = true)
38
+ def datetime(trailing_edge: true)
39
39
  t = @datetime
40
40
  # If the datetime requested is the trailing edge, offset as per interval requirement
41
41
  unless trailing_edge
@@ -51,7 +51,7 @@ module AEMO
51
51
 
52
52
  # @return [Time] the time of the
53
53
  def interval_length
54
- Time.at(300)
54
+ ::Time.at(300)
55
55
  end
56
56
 
57
57
  # @return [Symbol] :dispatch or :trading
@@ -72,7 +72,7 @@ module AEMO
72
72
  # @return [Float] the value of the interval in Australian Dollars
73
73
  def value
74
74
  @value ||= Float::NAN
75
- @value = (@total_demand * @rrp).round(2) if @total_demand.class == Float && @rrp.class == Float
75
+ @value = (@total_demand * @rrp).round(2) if @total_demand.instance_of?(Float) && @rrp.instance_of?(Float)
76
76
  @value
77
77
  end
78
78
  end
@@ -13,7 +13,11 @@ module AEMO
13
13
  attr_accessor :identifier
14
14
 
15
15
  def initialize(identifier)
16
- raise ArgumentError, "Node Identifier '#{identifier}' is not valid." unless IDENTIFIERS.include?(identifier.upcase)
16
+ unless IDENTIFIERS.include?(identifier.upcase)
17
+ raise ArgumentError,
18
+ "Node Identifier '#{identifier}' is not valid."
19
+ end
20
+
17
21
  @identifier = identifier
18
22
  @current_trading = []
19
23
  @current_dispatch = []
@@ -23,7 +27,7 @@ module AEMO
23
27
  #
24
28
  # @return [Array<AEMO::Market::Interval>]
25
29
  def current_dispatch
26
- @current_dispatch = AEMO::Market.current_dispatch(@identifier) if @current_dispatch.empty? || @current_dispatch.last.datetime != (Time.now - Time.now.to_i % 300)
30
+ @current_dispatch = AEMO::Market.current_dispatch(@identifier) if @current_dispatch.empty? || @current_dispatch.last.datetime != (::Time.now - (::Time.now.to_i % 300))
27
31
  @current_dispatch
28
32
  end
29
33
 
@@ -31,7 +35,9 @@ module AEMO
31
35
  #
32
36
  # @return [Array<AEMO::Market::Interval>]
33
37
  def current_trading
34
- if @current_trading.empty? || @current_trading.select { |i| i.period_type == 'TRADE' }.last.datetime != (Time.now - Time.now.to_i % 300)
38
+ if @current_trading.empty? || @current_trading.select do |i|
39
+ i.period_type == 'TRADE'
40
+ end.last.datetime != (::Time.now - (::Time.now.to_i % 300))
35
41
  @current_trading = AEMO::Market.current_trading(@identifier)
36
42
  end
37
43
  @current_trading
data/lib/aemo/market.rb CHANGED
@@ -20,8 +20,7 @@ module AEMO
20
20
  region = AEMO::Region.new(region) if region.is_a?(String)
21
21
 
22
22
  response = get "/mms.GRAPHS/GRAPHS/GRAPH_5#{region}1.csv"
23
- values = parse_response(response)
24
- values
23
+ parse_response(response)
25
24
  end
26
25
 
27
26
  # Description of method
@@ -32,8 +31,7 @@ module AEMO
32
31
  region = AEMO::Region.new(region) if region.is_a?(String)
33
32
 
34
33
  response = get "/mms.GRAPHS/GRAPHS/GRAPH_30#{region}1.csv"
35
- values = parse_response(response)
36
- values
34
+ parse_response(response)
37
35
  end
38
36
 
39
37
  # Return an array of historic trading values based on a start and finish
data/lib/aemo/msats.rb CHANGED
@@ -13,9 +13,9 @@ module AEMO
13
13
  class MSATS
14
14
  # Globally set request headers
15
15
  HEADERS = {
16
- 'User-Agent' => 'Ruby.AEMO.MSATS.Api',
17
- 'Accept' => 'text/xml',
18
- 'Content-Type' => 'text/xml'
16
+ 'User-Agent' => 'Ruby.AEMO.MSATS.Api',
17
+ 'Accept' => 'text/xml',
18
+ 'Content-Type' => 'text/xml'
19
19
  }.freeze
20
20
 
21
21
  # We like to party
@@ -31,8 +31,7 @@ module AEMO
31
31
 
32
32
  # Class Methods
33
33
  class << self
34
- attr_accessor :auth
35
- attr_accessor :participant_id
34
+ attr_accessor :auth, :participant_id
36
35
 
37
36
  # Single NMI Master (C4) Report
38
37
  # /C4/PARTICIPANT_IDENTIFIER?transactionId=XXX&nmi=XXX&checksum=X&type=XXX&reason=XXX
@@ -52,22 +51,23 @@ module AEMO
52
51
  options[:inittransId] ||= nil
53
52
 
54
53
  query = {
55
- transactionId: transaction_id,
56
- # Note: AEMO has case sensitivity but no consistency across requests.
57
- NMI: nmi.nmi,
58
- fromDate: from_date,
59
- toDate: to_date,
60
- asatDate: as_at_date,
61
- participantId: @participant_id,
62
- roleId: options[:role_id],
63
- inittransId: options[:init_trans_id]
54
+ transactionId: transaction_id,
55
+ # NOTE: AEMO has case sensitivity but no consistency across requests.
56
+ NMI: nmi.nmi,
57
+ fromDate: from_date,
58
+ toDate: to_date,
59
+ asatDate: as_at_date,
60
+ participantId: @participant_id,
61
+ roleId: options[:role_id],
62
+ inittransId: options[:init_trans_id]
64
63
  }
65
64
 
66
- response = get("/C4/#{@participant_id}", basic_auth: @auth, headers: HEADERS, query: query, verify: (options[:verify_ssl] != false))
67
- if response.response.code != '200'
68
- response
69
- else
65
+ response = get("/C4/#{@participant_id}", basic_auth: @auth, headers: HEADERS, query:,
66
+ verify: (options[:verify_ssl] != false))
67
+ if response.response.code == '200'
70
68
  response.parsed_response['aseXML']['Transactions']['Transaction']['ReportResponse']['ReportResults']
69
+ else
70
+ response
71
71
  end
72
72
  end
73
73
 
@@ -77,13 +77,14 @@ module AEMO
77
77
  # @return [Hash] The report results from the MSATS Limits web service query
78
78
  def msats_limits(options = {})
79
79
  query = {
80
- transactionId: transaction_id
80
+ transactionId: transaction_id
81
81
  }
82
- response = get("/MSATSLimits/#{@participant_id}", basic_auth: @auth, headers: HEADERS, query: query, verify: (options[:verify_ssl] != false))
83
- if response.response.code != '200'
84
- response
85
- else
82
+ response = get("/MSATSLimits/#{@participant_id}", basic_auth: @auth, headers: HEADERS, query:,
83
+ verify: (options[:verify_ssl] != false))
84
+ if response.response.code == '200'
86
85
  response.parsed_response['aseXML']['Transactions']['Transaction']['ReportResponse']['ReportResults']
86
+ else
87
+ response
87
88
  end
88
89
  end
89
90
 
@@ -93,21 +94,30 @@ module AEMO
93
94
  # @param [Integer] delivery_point_identifier Delivery Point Identifier
94
95
  # @return [Hash] The response
95
96
  def nmi_discovery_by_delivery_point_identifier(jurisdiction_code, delivery_point_identifier, options = {})
96
- raise ArgumentError, 'jurisdiction_code is not valid' unless %w[ACT NEM NSW QLD SA VIC TAS].include?(jurisdiction_code)
97
- raise ArgumentError, 'delivery_point_identifier is not valid' unless delivery_point_identifier.respond_to?('to_i')
98
- raise ArgumentError, 'delivery_point_identifier is not valid' if delivery_point_identifier.to_i < 10_000_000 || delivery_point_identifier.to_i > 99_999_999
97
+ raise ArgumentError, 'jurisdiction_code is not valid' unless %w[ACT NEM NSW QLD SA VIC
98
+ TAS].include?(jurisdiction_code)
99
+
100
+ unless delivery_point_identifier.respond_to?('to_i')
101
+ raise ArgumentError,
102
+ 'delivery_point_identifier is not valid'
103
+ end
104
+ if delivery_point_identifier.to_i < 10_000_000 || delivery_point_identifier.to_i > 99_999_999
105
+ raise ArgumentError,
106
+ 'delivery_point_identifier is not valid'
107
+ end
99
108
 
100
109
  query = {
101
- transactionId: transaction_id,
110
+ transactionId: transaction_id,
102
111
  jurisdictionCode: jurisdiction_code,
103
112
  deliveryPointIdentifier: delivery_point_identifier.to_i
104
113
  }
105
114
 
106
- response = get("/NMIDiscovery/#{@participant_id}", basic_auth: @auth, headers: HEADERS, query: query, verify: (options[:verify_ssl] != false))
107
- if response.response.code != '200'
108
- response
109
- else
115
+ response = get("/NMIDiscovery/#{@participant_id}", basic_auth: @auth, headers: HEADERS, query:,
116
+ verify: (options[:verify_ssl] != false))
117
+ if response.response.code == '200'
110
118
  response.parsed_response['aseXML']['Transactions']['Transaction']['NMIDiscoveryResponse']['NMIStandingData']
119
+ else
120
+ response
111
121
  end
112
122
  end
113
123
 
@@ -117,19 +127,21 @@ module AEMO
117
127
  # @param [Integer] meter_serial_number The meter's serial number
118
128
  # @return [Hash] The response
119
129
  def nmi_discovery_by_meter_serial_number(jurisdiction_code, meter_serial_number, options = {})
120
- raise ArgumentError, 'jurisdiction_code is not valid' unless %w[ACT NEM NSW QLD SA VIC TAS].include?(jurisdiction_code)
130
+ raise ArgumentError, 'jurisdiction_code is not valid' unless %w[ACT NEM NSW QLD SA VIC
131
+ TAS].include?(jurisdiction_code)
121
132
 
122
133
  query = {
123
- transactionId: transaction_id,
134
+ transactionId: transaction_id,
124
135
  jurisdictionCode: jurisdiction_code,
125
136
  meterSerialNumber: meter_serial_number.to_i
126
137
  }
127
138
 
128
- response = get("/NMIDiscovery/#{@participant_id}", basic_auth: @auth, headers: HEADERS, query: query, verify: (options[:verify_ssl] != false))
129
- if response.response.code != '200'
130
- response
131
- else
139
+ response = get("/NMIDiscovery/#{@participant_id}", basic_auth: @auth, headers: HEADERS, query:,
140
+ verify: (options[:verify_ssl] != false))
141
+ if response.response.code == '200'
132
142
  response.parsed_response['aseXML']['Transactions']['Transaction']['NMIDiscoveryResponse']['NMIStandingData']
143
+ else
144
+ response
133
145
  end
134
146
  end
135
147
 
@@ -139,7 +151,8 @@ module AEMO
139
151
  # @param [Integer] meter_serial_number The meter's serial number
140
152
  # @return [Hash] The response
141
153
  def nmi_discovery_by_address(jurisdiction_code, options = {})
142
- raise ArgumentError, 'jurisdiction_code is not valid' unless %w[ACT NEM NSW QLD SA VIC TAS].include?(jurisdiction_code)
154
+ raise ArgumentError, 'jurisdiction_code is not valid' unless %w[ACT NEM NSW QLD SA VIC
155
+ TAS].include?(jurisdiction_code)
143
156
 
144
157
  options[:building_or_property_name] ||= nil
145
158
  options[:location_descriptor] ||= nil
@@ -158,7 +171,7 @@ module AEMO
158
171
  options[:state_or_territory] ||= jurisdiction_code
159
172
 
160
173
  query = {
161
- transactionId: transaction_id,
174
+ transactionId: transaction_id,
162
175
  jurisdictionCode: jurisdiction_code,
163
176
  buildingOrPropertyName: options[:building_or_property_name],
164
177
  locationDescriptor: options[:location_descriptor],
@@ -177,12 +190,13 @@ module AEMO
177
190
  stateOrTerritory: options[:state_or_territory]
178
191
  }
179
192
 
180
- response = get("/NMIDiscovery/#{@participant_id}", basic_auth: @auth, headers: HEADERS, query: query, verify: (options[:verify_ssl] != false))
181
- if response.response.code != '200'
182
- response
183
- else
193
+ response = get("/NMIDiscovery/#{@participant_id}", basic_auth: @auth, headers: HEADERS, query:,
194
+ verify: (options[:verify_ssl] != false))
195
+ if response.response.code == '200'
184
196
  myresponse = response.parsed_response['aseXML']['Transactions']['Transaction']['NMIDiscoveryResponse']['NMIStandingData']
185
197
  myresponse.is_a?(Hash) ? [myresponse] : myresponse
198
+ else
199
+ response
186
200
  end
187
201
  end
188
202
 
@@ -204,11 +218,12 @@ module AEMO
204
218
  reason: options[:reason]
205
219
  }
206
220
 
207
- response = get("/NMIDetail/#{@participant_id}", basic_auth: @auth, headers: HEADERS, query: query, verify: (options[:verify_ssl] != false))
208
- if response.response.code != '200'
209
- response
210
- else
221
+ response = get("/NMIDetail/#{@participant_id}", basic_auth: @auth, headers: HEADERS, query:,
222
+ verify: (options[:verify_ssl] != false))
223
+ if response.response.code == '200'
211
224
  response.parsed_response['aseXML']['Transactions']['Transaction']['NMIStandingDataResponse']['NMIStandingData']
225
+ else
226
+ response
212
227
  end
213
228
  end
214
229
 
@@ -218,13 +233,14 @@ module AEMO
218
233
  # @return [Hash] The report results from the Participant System Status web service query
219
234
  def system_status(options = {})
220
235
  query = {
221
- transactionId: transaction_id
236
+ transactionId: transaction_id
222
237
  }
223
- response = get("/ParticipantSystemStatus/#{@participant_id}", basic_auth: @auth, headers: HEADERS, query: query, verify: (options[:verify_ssl] != false))
224
- if response.response.code != '200'
225
- response
226
- else
238
+ response = get("/ParticipantSystemStatus/#{@participant_id}", basic_auth: @auth, headers: HEADERS,
239
+ query:, verify: (options[:verify_ssl] != false))
240
+ if response.response.code == '200'
227
241
  response.parsed_response['aseXML']['Transactions']['Transaction']['ReportResponse']['ReportResults']
242
+ else
243
+ response
228
244
  end
229
245
  end
230
246
 
@@ -235,7 +251,7 @@ module AEMO
235
251
  # @return [Hash] authentication credentials
236
252
  def authorize(participant_id, username, password)
237
253
  @participant_id = participant_id
238
- @auth = { username: username, password: password }
254
+ @auth = { username:, password: }
239
255
  end
240
256
 
241
257
  # Check if credentials are available to use
@@ -249,7 +265,7 @@ module AEMO
249
265
  #
250
266
  # @return [String] the transaction id
251
267
  def transaction_id
252
- Digest::SHA1.hexdigest(Time.now.to_s)[0..35]
268
+ Digest::SHA1.hexdigest(::Time.now.to_s)[0..35]
253
269
  end
254
270
  end
255
271
 
@@ -29,7 +29,7 @@ module AEMO
29
29
  'U' => { stream: 'Check', description: '', units: 'kVAh' },
30
30
  'Y' => { stream: 'Check', description: 'Q Metering', units: 'Qh' },
31
31
  'W' => { stream: 'Check', description: 'Par Metering Path', units: '' },
32
- 'Z' => { stream: 'Check', description: 'Volts or V2h or Amps or A2h', units: '' },
32
+ 'Z' => { stream: 'Check', description: 'Volts or V2h or Amps or A2h', units: '' }
33
33
  # Net Meter Streams
34
34
  # AEMO: NOTE THAT D AND J ARE PREVIOUSLY DEFINED
35
35
  # 'D' => { stream: 'Net', description: 'Net', units: 'kWh' },
@@ -5,12 +5,12 @@ module AEMO
5
5
  # @since 0.1.4
6
6
  class NEM12
7
7
  QUALITY_FLAGS = {
8
- 'A' => 'Actual Data',
9
- 'E' => 'Forward Estimated Data',
10
- 'F' => 'Final Substituted Data',
11
- 'N' => 'Null Data',
12
- 'S' => 'Substituted Data',
13
- 'V' => 'Variable Data'
8
+ 'A' => 'Actual Data',
9
+ 'E' => 'Forward Estimated Data',
10
+ 'F' => 'Final Substituted Data',
11
+ 'N' => 'Null Data',
12
+ 'S' => 'Substituted Data',
13
+ 'V' => 'Variable Data'
14
14
  }.freeze
15
15
 
16
16
  METHOD_FLAGS = {
@@ -23,17 +23,21 @@ module AEMO
23
23
  17 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Linear', description: '' },
24
24
  18 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Alternate', description: '' },
25
25
  19 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Zero', description: '' },
26
- 20 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Churn Correction (Like Day)', description: '' },
27
- 21 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Five-minute No Historical Data', description: '' },
26
+ 20 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Churn Correction (Like Day)',
27
+ description: '' },
28
+ 21 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Five-minute No Historical Data',
29
+ description: '' },
28
30
  51 => { type: %w[EST SUB], installation_type: 5, short_descriptor: 'Previous Year', description: '' },
29
31
  52 => { type: %w[EST SUB], installation_type: 5, short_descriptor: 'Previous Read', description: '' },
30
32
  53 => { type: %w[SUB], installation_type: 5, short_descriptor: 'Revision', description: '' },
31
33
  54 => { type: %w[SUB], installation_type: 5, short_descriptor: 'Linear', description: '' },
32
34
  55 => { type: %w[SUB], installation_type: 5, short_descriptor: 'Agreed', description: '' },
33
- 56 => { type: %w[EST SUB], installation_type: 5, short_descriptor: 'Prior to First Read - Agreed', description: '' },
35
+ 56 => { type: %w[EST SUB], installation_type: 5, short_descriptor: 'Prior to First Read - Agreed',
36
+ description: '' },
34
37
  57 => { type: %w[EST SUB], installation_type: 5, short_descriptor: 'Customer Class', description: '' },
35
38
  58 => { type: %w[EST SUB], installation_type: 5, short_descriptor: 'Zero', description: '' },
36
- 59 => { type: %w[EST SUB], installation_type: 5, short_descriptor: 'Five-minute No Historical Data', description: '' },
39
+ 59 => { type: %w[EST SUB], installation_type: 5, short_descriptor: 'Five-minute No Historical Data',
40
+ description: '' },
37
41
  61 => { type: %w[EST SUB], installation_type: 6, short_descriptor: 'Previous Year', description: '' },
38
42
  62 => { type: %w[EST SUB], installation_type: 6, short_descriptor: 'Previous Read', description: '' },
39
43
  63 => { type: %w[EST SUB], installation_type: 6, short_descriptor: 'Customer Class', description: '' },
@@ -5,55 +5,55 @@ module AEMO
5
5
  # @since 0.1.4
6
6
  class NEM12
7
7
  UOM = {
8
- 'MWh' => { name: 'Megawatt Hour', multiplier: 1e6 },
9
- 'kWh' => { name: 'Kilowatt Hour', multiplier: 1e3 },
10
- 'Wh' => { name: 'Watt Hour', multiplier: 1 },
11
- 'MW' => { name: 'Megawatt', multiplier: 1e6 },
12
- 'kW' => { name: 'Kilowatt', multiplier: 1e3 },
13
- 'W' => { name: 'Watt', multiplier: 1 },
8
+ 'MWh' => { name: 'Megawatt Hour', multiplier: 1e6 },
9
+ 'kWh' => { name: 'Kilowatt Hour', multiplier: 1e3 },
10
+ 'Wh' => { name: 'Watt Hour', multiplier: 1 },
11
+ 'MW' => { name: 'Megawatt', multiplier: 1e6 },
12
+ 'kW' => { name: 'Kilowatt', multiplier: 1e3 },
13
+ 'W' => { name: 'Watt', multiplier: 1 },
14
14
  'MVArh' => { name: 'Megavolt Ampere Reactive Hour', multiplier: 1e6 },
15
15
  'kVArh' => { name: 'Kilovolt Ampere Reactive Hour', multiplier: 1e3 },
16
- 'VArh' => { name: 'Volt Ampere Reactive Hour', multiplier: 1 },
17
- 'MVAr' => { name: 'Megavolt Ampere Reactive', multiplier: 1e6 },
18
- 'kVAr' => { name: 'Kilovolt Ampere Reactive', multiplier: 1e3 },
19
- 'VAr' => { name: 'Volt Ampere Reactive', multiplier: 1 },
20
- 'MVAh' => { name: 'Megavolt Ampere Hour', multiplier: 1e6 },
21
- 'kVAh' => { name: 'Kilovolt Ampere Hour', multiplier: 1e3 },
22
- 'VAh' => { name: 'Volt Ampere Hour', multiplier: 1 },
23
- 'MVA' => { name: 'Megavolt Ampere', multiplier: 1e6 },
24
- 'kVA' => { name: 'Kilovolt Ampere', multiplier: 1e3 },
25
- 'VA' => { name: 'Volt Ampere', multiplier: 1 },
26
- 'kV' => { name: 'Kilovolt', multiplier: 1e3 },
27
- 'V' => { name: 'Volt', multiplier: 1 },
28
- 'kA' => { name: 'Kiloampere', multiplier: 1e3 },
29
- 'A' => { name: 'Ampere', multiplier: 1 },
30
- 'pf' => { name: 'Power Factor', multiplier: 1 }
16
+ 'VArh' => { name: 'Volt Ampere Reactive Hour', multiplier: 1 },
17
+ 'MVAr' => { name: 'Megavolt Ampere Reactive', multiplier: 1e6 },
18
+ 'kVAr' => { name: 'Kilovolt Ampere Reactive', multiplier: 1e3 },
19
+ 'VAr' => { name: 'Volt Ampere Reactive', multiplier: 1 },
20
+ 'MVAh' => { name: 'Megavolt Ampere Hour', multiplier: 1e6 },
21
+ 'kVAh' => { name: 'Kilovolt Ampere Hour', multiplier: 1e3 },
22
+ 'VAh' => { name: 'Volt Ampere Hour', multiplier: 1 },
23
+ 'MVA' => { name: 'Megavolt Ampere', multiplier: 1e6 },
24
+ 'kVA' => { name: 'Kilovolt Ampere', multiplier: 1e3 },
25
+ 'VA' => { name: 'Volt Ampere', multiplier: 1 },
26
+ 'kV' => { name: 'Kilovolt', multiplier: 1e3 },
27
+ 'V' => { name: 'Volt', multiplier: 1 },
28
+ 'kA' => { name: 'Kiloampere', multiplier: 1e3 },
29
+ 'A' => { name: 'Ampere', multiplier: 1 },
30
+ 'pf' => { name: 'Power Factor', multiplier: 1 }
31
31
  }.freeze
32
32
 
33
33
  UOM_NON_SPEC_MAPPING = {
34
- 'MWH' => 'MWh',
35
- 'KWH' => 'kWh',
36
- 'WH' => 'Wh',
37
- 'MW' => 'MW',
38
- 'KW' => 'kW',
39
- 'W' => 'W',
34
+ 'MWH' => 'MWh',
35
+ 'KWH' => 'kWh',
36
+ 'WH' => 'Wh',
37
+ 'MW' => 'MW',
38
+ 'KW' => 'kW',
39
+ 'W' => 'W',
40
40
  'MVARH' => 'MVArh',
41
41
  'KVARH' => 'kVArh',
42
- 'VARH' => 'VArh',
43
- 'MVAR' => 'MVAr',
44
- 'KVAR' => 'kVAr',
45
- 'VAR' => 'VAr',
46
- 'MVAH' => 'MVAh',
47
- 'KVAH' => 'kVAh',
48
- 'VAH' => 'VAh',
49
- 'MVA' => 'MVA',
50
- 'KVA' => 'kVA',
51
- 'VA' => 'VA',
52
- 'KV' => 'kV',
53
- 'V' => 'V',
54
- 'KA' => 'kA',
55
- 'A' => 'A',
56
- 'PF' => 'pf'
42
+ 'VARH' => 'VArh',
43
+ 'MVAR' => 'MVAr',
44
+ 'KVAR' => 'kVAr',
45
+ 'VAR' => 'VAr',
46
+ 'MVAH' => 'MVAh',
47
+ 'KVAH' => 'kVAh',
48
+ 'VAH' => 'VAh',
49
+ 'MVA' => 'MVA',
50
+ 'KVA' => 'kVA',
51
+ 'VA' => 'VA',
52
+ 'KV' => 'kV',
53
+ 'V' => 'V',
54
+ 'KA' => 'kA',
55
+ 'A' => 'A',
56
+ 'PF' => 'pf'
57
57
  }.freeze
58
58
  end
59
59
  end