jufemaiz/aemo

AEMO::NEM12 » 300 row » IntervalValue1 . . . IntervalValueN with nil value not raising an error

jufemaiz opened this issue · 1 comments

NEM12 file was parsed raising:

NoMethodError: undefined method `match' for nil:NilClass Did you mean? catch

This was caused due to a 300 row with the following representative data:

300,20180529,0.001,0.0,0.0,0.001,0.0,0.0,0.001,0.0,0.001,0.0,0.0,0.001,0.005,0.01,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.001,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,,,,,,,,,,,,,,,,,A,,,20180529160239,

The empty values should not have been empty but rather 0, with a flag of N raised for them. This is due to NEM12 export functionality being used on a dataset that was for the present day.

What should happen is that an exception is raised during the parsing of the dataset as the value present is not valid.

A valid dataset would look like:

300,20180529,0.001,0.0,0.0,0.001,0.0,0.0,0.001,0.0,0.001,0.0,0.0,0.001,0.005,0.01,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.001,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,A,,,20180529160239,
400,1,32,A,,
400,33,48,N,,

This would signify no value for the last 16 elements of the 48 provided here (30 minute interval data).

Likewise, 0 could be a valid value and be without the subsequent 400 rows (but not for the example above)