Skip to content

Comments

Add new model and test scaffolds#373

Merged
cc-a merged 3 commits intonew-data-inputfrom
new-input-tests
Jun 27, 2024
Merged

Add new model and test scaffolds#373
cc-a merged 3 commits intonew-data-inputfrom
new-input-tests

Conversation

@cc-a
Copy link
Collaborator

@cc-a cc-a commented Jun 25, 2024

Description

This PR adds the data files for the planned changes to the data input (created by @tsmbland) as a new example model and scaffolds several tests that cover the commodities section of the planned data schema (also created by @tsmbland).

It's expected that the test functions will have to be customised slightly based on the different implementations we try but the datastructures they check shouldn't change much.

Putting this against the new-data-input branch in lieu of develop so we have somewhere to collate our experimentation before attempting to put anything into develop.

Fixes # (issue)

Type of change

Please add a line in the relevant section of
CHANGELOG.md to
document the change (include PR #) - note reverse order of PR #s.

  • New feature (non-breaking change which adds functionality)
  • Optimization (non-breaking, back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (whatever its nature)

Key checklist

  • All tests pass: $ python -m pytest
  • The documentation builds and looks OK: $ python -m sphinx -b html docs docs/build

Further checks

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@cc-a cc-a requested review from alexdewar and tsmbland June 25, 2024 20:37
@codecov
Copy link

codecov bot commented Jun 25, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 4 lines in your changes missing coverage. Please review.

Project coverage is 71.38%. Comparing base (e09a23d) to head (eb68180).

Current head eb68180 differs from pull request most recent head 935b3e2

Please upload reports for the commit 935b3e2 to get more accurate results.

Files Patch % Lines
src/muse/examples.py 33.33% 4 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                 @@
##           new-data-input     #373      +/-   ##
==================================================
- Coverage           71.39%   71.38%   -0.01%     
==================================================
  Files                  44       44              
  Lines                5887     5892       +5     
  Branches             1162     1163       +1     
==================================================
+ Hits                 4203     4206       +3     
- Misses               1364     1367       +3     
+ Partials              320      319       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@alexdewar alexdewar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, modulo a couple of comments.

"CO2f",
}

assert data.sel(year="2020", commodity="electricity", region="R1", timeslice=0) == 1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is year a string here?

Comment on lines +969 to +970
- 14.81481,
abs=1e-4,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we just use the default value for abs?

Suggested change
- 14.81481,
abs=1e-4,
- 14.81481

@cc-a cc-a merged commit 630fa27 into new-data-input Jun 27, 2024
@cc-a cc-a deleted the new-input-tests branch June 27, 2024 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants