-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added HABApp.util.functions with min/max - Reworked small parts of the file watcher - Doc improvements - Dependency updates
- Loading branch information
1 parent
26c3b86
commit 301afae
Showing
30 changed files
with
749 additions
and
163 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 |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '0.20.1' | ||
__version__ = '0.20.2' |
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
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
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 |
---|---|---|
@@ -1,8 +1,9 @@ | ||
from . import functions | ||
from .counter_item import CounterItem | ||
from .period_counter import PeriodCounter | ||
from .threshold import Threshold | ||
from .statistics import Statistics | ||
from . import multimode | ||
|
||
# 27.04.2020 - this can be removed in some time | ||
from .multimode import MultiModeItem | ||
from .multimode import MultiModeItem |
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 @@ | ||
from .min_max import min, max |
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,30 @@ | ||
from builtins import max as _max | ||
from builtins import min as _min | ||
|
||
|
||
def max(*args, default=None): | ||
"""Behaves like the built in max function but ignores any ``None`` values. e.g. ``max([1, None, 2]) == 2``. | ||
If the iterable is empty ``default`` will be returned. | ||
:param args: Single iterable or 1..n arguments | ||
:param default: Value that will be returned if the iterable is empty | ||
:return: max value | ||
""" | ||
return _max( | ||
filter(lambda x: x is not None, args[0] if len(args) == 1 else args), | ||
default=default | ||
) | ||
|
||
|
||
def min(*args, default=None): | ||
"""Behaves like the built in min function but ignores any ``None`` values. e.g. ``min([1, None, 2]) == 1``. | ||
If the iterable is empty ``default`` will be returned. | ||
:param args: Single iterable or 1..n arguments | ||
:param default: Value that will be returned if the iterable is empty | ||
:return: min value | ||
""" | ||
return _min( | ||
filter(lambda x: x is not None, args[0] if len(args) == 1 else args), | ||
default=default | ||
) |
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.