-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from jbusecke/beam-refactor
Start refactor to beam-refactor branch of pgf-recipes
- Loading branch information
Showing
8 changed files
with
530 additions
and
416 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,32 @@ | ||
from .recipe_inputs import generate_recipe_inputs_from_iids | ||
from .recipe_inputs import get_urls_from_esgf | ||
import logging | ||
import backoff #noqa #https://github.com/litl/backoff/issues/71 | ||
|
||
logging.getLogger('backoff').setLevel(logging.FATAL) | ||
# not sure if this is needed, but I want to avoid the many backoff messages | ||
|
||
def setup_logging(level: str = "INFO"): | ||
"""A convenience function that sets up logging for developing and debugging recipes in Jupyter, | ||
iPython, or another interactive context. | ||
:param level: One of (in decreasing level of detail) ``"DEBUG"``, ``"INFO"``, or ``"WARNING"``. | ||
Defaults to ``"INFO"``. | ||
""" | ||
import logging | ||
|
||
try: | ||
from rich.logging import RichHandler | ||
|
||
handler = RichHandler() | ||
handler.setFormatter(logging.Formatter("%(message)s")) | ||
except ImportError: | ||
import sys | ||
|
||
handler = logging.StreamHandler(stream=sys.stdout) | ||
handler.setFormatter(logging.Formatter("%(name)s - %(levelname)s - %(message)s")) | ||
|
||
logger = logging.getLogger("pangeo_forge_esgf") | ||
if logger.hasHandlers(): | ||
logger.handlers.clear() | ||
logger.setLevel(getattr(logging, level)) | ||
logger.addHandler(handler) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.