Skip to content

Improve test coverage of TransformProfile class#253

Merged
rouille merged 8 commits intodevelopfrom
ben/tests
Aug 14, 2020
Merged

Improve test coverage of TransformProfile class#253
rouille merged 8 commits intodevelopfrom
ben/tests

Conversation

@rouille
Copy link
Copy Markdown
Collaborator

@rouille rouille commented Aug 13, 2020

Purpose

Improve test coverage of the TransformProfile class.

What is the code doing

Tests the different transformation a profile (demand and renewable) can undergo:

  • demand profile is scaled by zone
  • renewable profiles are scaled by zone
  • renewable profiles are scaled by plant id
  • renewable profiles are scaled by zone and plant id
  • new plants are added to renewable profiles
  • profiles of new plants are not scaled when scaling renewable profiles by zone

Where to look

The code has been completely rewritten, so everywhere

Time estimate

30 min to 1h

@rouille rouille self-assigned this Aug 13, 2020
Comment thread powersimdata/input/tests/test_transform_profile.py
Comment thread powersimdata/input/tests/test_transform_profile.py Outdated
Comment thread powersimdata/input/tests/test_transform_profile.py Outdated


def get_change_table_for_zone_scaling(base_grid, resource):
n_zone = param["_".join(interconnect)]["n_zone_to_scale"]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This setup is saved for combinations of interconnects, such as "Western_Texas"?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes. I did not set the "Western_Texas" yet in the param dict. It can be done.

@BainanXia
Copy link
Copy Markdown
Collaborator

We are checking the new plants are added correctly and the profiles are not scaled for the new plants if we have scaling by zone_id and plant_id elsewhere in the grid. Do we have checks on the profiles of the new plants other than 'not scaled'?

@rouille
Copy link
Copy Markdown
Collaborator Author

rouille commented Aug 14, 2020

We are checking the new plants are added correctly and the profiles are not scaled for the new plants if we have scaling by zone_id and plant_id elsewhere in the grid. Do we have checks on the profiles of the new plants other than 'not scaled'?

No we don't. Good point, I will work on that.

@rouille
Copy link
Copy Markdown
Collaborator Author

rouille commented Aug 14, 2020

We are checking the new plants are added correctly and the profiles are not scaled for the new plants if we have scaling by zone_id and plant_id elsewhere in the grid. Do we have checks on the profiles of the new plants other than 'not scaled'?

No we don't. Good point, I will work on that.

@BainanXia, commit 646b64c encloses the tests.

Copy link
Copy Markdown
Collaborator

@BainanXia BainanXia left a comment

Choose a reason for hiding this comment

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

All tests passed. This is nice. The tests are more structural and the coverage is improved. Thanks for taking care of this tedious work.

@rouille rouille merged commit 35e8978 into develop Aug 14, 2020
@rouille rouille deleted the ben/tests branch August 14, 2020 21:55
@ahurli ahurli mentioned this pull request Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants