-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow unit only for the quantity metric
This is implemented the same way time_unit is implemented for others: The specific metric class takes the argument, not the generic one. Because the schema enforces `unit` to be required for `quantity` we can just `pop` it with the guarantee it's there. The error message for other metrics if they do set `unit` is less nice: Metric.__init__() got an unexpected keyword argument 'unit' But that's in line with what `time_unit` also does.
- Loading branch information
Showing
3 changed files
with
21 additions
and
3 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
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