Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
amaiya committed Sep 3, 2020
2 parents 2bd430e + 719aa0d commit ffbb4e3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ Most recent releases are shown at the top. Each release shows:
- **Changed**: Additional parameters, changes to inputs or outputs, etc
- **Fixed**: Bug fixes that don't change documented behaviour

## 0.21.2 (2020-09-03)

### New:
- N/A

### Changed
- `SUPPRESS_KTRAIN_WARNINGS` environment variable changed to `SUPPRESS_DEP_WARNINGS`

### Fixed:
- N/A


## 0.21.1 (2020-09-03)

### New:
Expand Down
4 changes: 2 additions & 2 deletions ktrain/imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@


# Suppress Warnings
SUPPRESS_KTRAIN_WARNINGS = strtobool(os.environ.get('SUPPRESS_KTRAIN_WARNINGS', '1'))
SUPPRESS_DEP_WARNINGS = strtobool(os.environ.get('SUPPRESS_DEP_WARNINGS', '1'))
def set_global_logging_level(level=logging.ERROR, prefices=[""]):
"""
Override logging levels of different modules based on their name as a prefix.
Expand All @@ -253,7 +253,7 @@ def set_global_logging_level(level=logging.ERROR, prefices=[""]):
for name in logging.root.manager.loggerDict:
if re.match(prefix_re, name):
logging.getLogger(name).setLevel(level)
if SUPPRESS_KTRAIN_WARNINGS:
if SUPPRESS_DEP_WARNINGS:
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"
warnings.simplefilter(action='ignore', category=FutureWarning)
# elevate warnings to errors for debugging dependencies
Expand Down
4 changes: 2 additions & 2 deletions ktrain/text/shallownlp/imports.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import os, logging, warnings
#os.environ['DISABLE_V2_BEHAVIOR'] = '1'

from ...imports import SUPPRESS_KTRAIN_WARNINGS
if SUPPRESS_KTRAIN_WARNINGS:
from ...imports import SUPPRESS_DEP_WARNINGS
if SUPPRESS_DEP_WARNINGS:
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"
logging.getLogger("tensorflow").setLevel(logging.ERROR)
logging.getLogger("tensorflow_hub").setLevel(logging.ERROR)
Expand Down
2 changes: 1 addition & 1 deletion ktrain/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__all__ = ['__version__']
__version__ = '0.21.1'
__version__ = '0.21.2'

0 comments on commit ffbb4e3

Please sign in to comment.