-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: NEM12 headers and exporting (#85)
### Added * Ability to output a valid NEM12 file from a single, or an array of, `AEMO::NEM12` with `to_nem12_csv`. * `AEMO::Time` for customised formatting, parsing, and validating in `NEMTIME`. * Github actions for tests and lints. ### Changed * Correctly set `AEMO::NEM12` header value set at parsing.
- Loading branch information
Showing
41 changed files
with
1,359 additions
and
761 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
name: Test + lint | ||
on: | ||
pull_request: | ||
push: | ||
tags-ignore: | ||
- '*' | ||
paths-ignore: | ||
- '*.md' | ||
workflow_dispatch: | ||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: '3.2' | ||
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | ||
- name: Run lints | ||
run: bundle exec rubocop | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
continue-on-error: ${{ matrix.experimental }} | ||
strategy: | ||
matrix: | ||
ruby-version: ['3.1', '3.2'] | ||
experimental: [false] | ||
include: | ||
- ruby-version: 'head' | ||
experimental: true | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby-version }} | ||
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | ||
- name: Run tests | ||
env: | ||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | ||
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | ||
run: bundle exec rspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,52 @@ | ||
--- | ||
inherit_from: .rubocop_todo.yml | ||
|
||
require: | ||
- rubocop-minitest | ||
- rubocop-rspec | ||
|
||
AllCops: | ||
NewCops: enable | ||
Exclude: | ||
- 'vendor/**/*' | ||
DefaultFormatter: progress | ||
DisplayCopNames: true | ||
DisplayStyleGuide: true | ||
ExtraDetails: true | ||
TargetRubyVersion: 2.6 | ||
|
||
Style/StringLiterals: | ||
EnforcedStyle: single_quotes | ||
SupportedStyles: | ||
- single_quotes | ||
- double_quotes | ||
ExtraDetails: 3.2 | ||
|
||
# Metrics/AbcSize: | ||
# # Target: 15 | ||
# Max: 175 | ||
Metrics/LineLength: | ||
# Overrides. | ||
Layout/LineLength: | ||
AllowHeredoc: true | ||
AllowURI: true | ||
Exclude: | ||
- 'spec/**/*_spec.rb' | ||
URISchemes: | ||
- http | ||
- https | ||
# Target: 80 | ||
# Max: 210 | ||
# Metrics/MethodLength: | ||
# # Target 10 | ||
# Max: 80 | ||
# Metrics/ClassLength: | ||
# Max: 600 | ||
# Metrics/CyclomaticComplexity: | ||
# # Target 6 | ||
# Max: 29 | ||
# Metrics/PerceivedComplexity: | ||
# # Target 7 | ||
# Max: 29 | ||
Max: 210 | ||
Metrics/AbcSize: | ||
# Target: 15 | ||
Max: 190 | ||
Metrics/BlockLength: | ||
Exclude: | ||
- 'spec/**/*' | ||
- 'aemo.gemspec' | ||
# Target: 25 | ||
Max: 40 | ||
Metrics/ClassLength: | ||
Max: 600 | ||
Metrics/CyclomaticComplexity: | ||
# Target 6 | ||
Max: 40 | ||
Metrics/MethodLength: | ||
# Target 10 | ||
Max: 80 | ||
Metrics/PerceivedComplexity: | ||
# Target 7 | ||
Max: 38 | ||
Style/StringLiterals: | ||
EnforcedStyle: single_quotes | ||
SupportedStyles: | ||
- single_quotes | ||
- double_quotes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,55 @@ | ||
--- | ||
# This configuration was generated by | ||
# `rubocop --auto-gen-config` | ||
# on 2018-05-01 11:12:22 +1000 using RuboCop version 0.50.0. | ||
# on 2023-12-19 05:58:24 UTC using RuboCop version 1.59.0. | ||
# The point is for the user to remove these configuration records | ||
# one by one as the offenses are removed from the code base. | ||
# Note that changes in the inspected code, or installation of new | ||
# versions of RuboCop, may require this file to be generated again. | ||
|
||
# Offense count: 18 | ||
Metrics/AbcSize: | ||
Max: 165 | ||
# Offense count: 8 | ||
# Configuration parameters: Prefixes, AllowedPatterns. | ||
# Prefixes: when, with, without | ||
RSpec/ContextWording: | ||
Exclude: | ||
- 'spec/lib/aemo/nem12_spec.rb' | ||
- 'spec/lib/aemo/nmi/allocation_spec.rb' | ||
- 'spec/lib/aemo/nmi_spec.rb' | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: CountComments, ExcludedMethods. | ||
Metrics/BlockLength: | ||
Max: 35 | ||
# Offense count: 6 | ||
# Configuration parameters: CountAsOne. | ||
RSpec/ExampleLength: | ||
Max: 23 | ||
|
||
# Offense count: 3 | ||
# Configuration parameters: CountComments. | ||
Metrics/ClassLength: | ||
Max: 499 | ||
# Offense count: 44 | ||
# Configuration parameters: AssignmentOnly. | ||
RSpec/InstanceVariable: | ||
Exclude: | ||
- 'spec/lib/aemo/market/interval_spec.rb' | ||
- 'spec/lib/aemo/market/node_spec.rb' | ||
- 'spec/lib/aemo/nmi_spec.rb' | ||
- 'spec/lib/aemo/region_spec.rb' | ||
|
||
# Offense count: 8 | ||
Metrics/CyclomaticComplexity: | ||
Max: 29 | ||
# Offense count: 6 | ||
RSpec/MultipleExpectations: | ||
Max: 5 | ||
|
||
# Offense count: 191 | ||
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. | ||
# URISchemes: http, https | ||
Metrics/LineLength: | ||
Max: 192 | ||
# Offense count: 10 | ||
# Configuration parameters: AllowedGroups. | ||
RSpec/NestedGroups: | ||
Max: 4 | ||
|
||
# Offense count: 14 | ||
# Configuration parameters: CountComments. | ||
Metrics/MethodLength: | ||
Max: 51 | ||
# Offense count: 2 | ||
# Configuration parameters: AllowedPatterns. | ||
# AllowedPatterns: ^expect_, ^assert_ | ||
RSpec/NoExpectationExample: | ||
Exclude: | ||
- 'spec/lib/aemo/msats_spec.rb' | ||
|
||
# Offense count: 7 | ||
Metrics/PerceivedComplexity: | ||
Max: 29 | ||
# Offense count: 17 | ||
RSpec/RepeatedDescription: | ||
Exclude: | ||
- 'spec/lib/aemo/market/interval_spec.rb' | ||
- 'spec/lib/aemo/msats_spec.rb' | ||
- 'spec/lib/aemo/nem12_spec.rb' | ||
- 'spec/lib/aemo/nmi_spec.rb' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.