This repository has been archived by the owner on Aug 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Degree Days Indicators #154
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d2daf69
Add heating and cooling degree day indicators
3689175
Refactor filters into conditions
7a61653
Refactor YearlyCountIndicator to be a specialized aggregated indicator
1e2ca89
Refactor to distinguish between conditions and filters
62c13c0
Refactor unit converters to allow standalone converters
9414a8e
Add monthly degree day indicators
675a2cd
Add unit tests for standalone unit converters
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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,11 @@ | ||
class ConverterTestMixin(): | ||
def test_conversions(self): | ||
for units, tests in self.cases.iteritems(): | ||
converter = self.converter_class.get(*units) | ||
|
||
for start, expected in tests: | ||
value = converter(start) | ||
self.assertAlmostEqual(value, expected, | ||
places=3, | ||
msg='Failed assertion that %f %s = %f %s, got %f %s' % | ||
(start, units[0], expected, units[1], value, units[1])) |
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Including units here seems a little weird within the broader context, but it is, after all, a paremeter, so it might be the broader context that's weird. In any case, we have PR #158 to address such questions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The goal here is to allow the fallback when basetemp is given as a pure number... for instance, in
?basetemp=65
we'd interpret it as 65F, and?basetemp=20&units=C
would interpret it as 20C and also present the result in Centigrade as well.We can go the route that
basetemp
must always have a unit, but this felt more user friendly.