Skip to content

Commit

Permalink
Temporarily set no_implicit_optional = false (#465)
Browse files Browse the repository at this point in the history
Satisfy mypy 0.990 in .base.Backend.get_log_level()
  • Loading branch information
khaeru committed Nov 9, 2022
1 parent 61e863c commit be0fb30
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ixmp/backend/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import logging
from abc import ABC, abstractmethod
from copy import copy
from os import PathLike
Expand Down Expand Up @@ -92,7 +93,9 @@ def set_log_level(self, level: int) -> None:
def get_log_level(self) -> str:
"""OPTIONAL: Get logging level for the backend and other code.
The default implementation has no effect.
The default implementation returns the effective level of the
"ixmp.backend.base" logger; usually the same as "ixmp" or "ixmp.backend" (if
set).
Returns
-------
Expand All @@ -103,6 +106,7 @@ def get_log_level(self) -> str:
--------
set_log_level
"""
return logging.getLevelName(logging.getLogger(__name__).getEffectiveLevel())

@abstractmethod
def set_doc(self, domain: str, docs) -> None:
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ omit = [
[tool.isort]
profile = "black"

[tool.mypy]
no_implicit_optional = false

[[tool.mypy.overrides]]
# Packages/modules for which no type hints are available.
module = [
Expand Down

0 comments on commit be0fb30

Please sign in to comment.