Skip to content

Commit

Permalink
Update to support FY17 TNI Loss Factors, bugfix AEMO::NEM12.parse_nem…
Browse files Browse the repository at this point in the history
…12 CSV parsing
  • Loading branch information
jufemaiz committed Jul 1, 2016
1 parent f8eaa41 commit 3389bf5
Show file tree
Hide file tree
Showing 11 changed files with 594 additions and 577 deletions.
14 changes: 10 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
# AEMO Gem Changelog

## 0.1.33

* Rubocop lint bugfix (AEMO::NEM12.parse_nem12 not breaking up rows correctly)
* Timecop added to deal with RSpec failures for unpublished TNI Data
* FY17 Marginal Loss Factors added from http://www.aemo.com.au/Electricity/Market-Operations/Loss-Factors-and-Regional-Boundaries/Distribution-Loss-Factors-for-the-2016_17-Financial-Year

## 0.1.32

Nokogiri security flaw patched (Ref: https://github.com/sparklemotion/nokogiri/issues/1374 )
* Nokogiri security flaw patched (Ref: https://github.com/sparklemotion/nokogiri/issues/1374 )

## 0.1.31

AEMO::Market#historic_trading
AEMO::Market#historic_trading_by_range
* AEMO::Market#historic_trading
* AEMO::Market#historic_trading_by_range

## 0.1.30

AEMO::NMI#current_annual_load
* AEMO::NMI#current_annual_load
4 changes: 3 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
aemo (0.1.32)
aemo (0.1.33)
activesupport (~> 4.2, >= 4.2.0)
httparty (~> 0.13, >= 0.13.1)
json (~> 1.8)
Expand Down Expand Up @@ -152,6 +152,7 @@ GEM
tins (~> 1.0)
thor (0.19.1)
thread_safe (0.3.5)
timecop (0.8.1)
tins (1.6.0)
tzinfo (1.2.2)
thread_safe (~> 0.1)
Expand All @@ -178,6 +179,7 @@ DEPENDENCIES
rspec (~> 3.4, >= 3.4.0)!
rubocop (~> 0.41, >= 0.41.1)!
simplecov (~> 0.11, >= 0.11.2)!
timecop (~> 0.8, >= 0.8.1)!
webmock (~> 2.1, >= 2.1.0)!
yard (~> 0.8.7, >= 0.8.7.6)!

Expand Down
1 change: 1 addition & 0 deletions aemo.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ Gem::Specification.new do |s|
s.add_development_dependency 'guard-yard', '~> 2.1', '>= 2.1.3'
s.add_development_dependency 'webmock', '~> 2.1', '>= 2.1.0'
s.add_development_dependency 'rubocop', '~> 0.41', '>= 0.41.1'
s.add_development_dependency 'timecop', '~> 0.8', '>= 0.8.1'
end
4 changes: 2 additions & 2 deletions lib/aemo/nem12.rb
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ def to_csv
row
end).map do |row|
row.join(', ')
end.join('\n')
end.join("\n")
end

# @param [String] path_to_file the path to a file
Expand All @@ -517,7 +517,7 @@ def self.parse_nem12_file(path_to_file, strict = false)
# @param [Boolean] strict
# @return [Array<AEMO::NEM12>] An array of NEM12 objects
def self.parse_nem12(contents, strict = false)
file_contents = contents.tr('\r', '\n').tr('\n\n', '\n').split('\n').delete_if(&:empty?)
file_contents = contents.tr("\r", "\n").tr("\n\n", "\n").split("\n").delete_if(&:empty?)
raise ArgumentError, 'First row should be have a RecordIndicator of 100 and be of type Header Record' unless file_contents.first.parse_csv[0] == '100'

nem12s = []
Expand Down
2 changes: 1 addition & 1 deletion lib/aemo/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# @author Joel Courtney <[email protected]>
module AEMO
# aemo version
VERSION = '0.1.32'.freeze
VERSION = '0.1.33'.freeze

# aemo version split amongst different revisions
MAJOR_VERSION, MINOR_VERSION, REVISION = VERSION.split('.').map(&:to_i)
Expand Down
Loading

0 comments on commit 3389bf5

Please sign in to comment.