Skip to content

Commit

Permalink
Merge pull request #42 from Santiso-Group/issue_41
Browse files Browse the repository at this point in the history
Address reviewer comments Issue 41
  • Loading branch information
jaclark5 authored Dec 31, 2024
2 parents 19a3bab + 742c602 commit 88aea1b
Show file tree
Hide file tree
Showing 58 changed files with 916 additions and 2,972 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
- name: Flake8
shell: bash -l {0}
run: |
python -m flake8 despasito --count --ignore=E741,W503 --max-line-length=92 --show-source --statistics
python -m flake8 despasito --count --ignore=E741,W503 --max-line-length=120 --per-file-ignores="__init__.py:F401" --show-source --statistics
paper:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ __pycache__/
# C extensions
*.so

# VS Code extension
.vscode/*

# Distribution / packaging
.Python
env/
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"python.testing.pytestArgs": [],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
"python.testing.pytestEnabled": true,
"python.terminal.executeInFileDir": true
}
18 changes: 3 additions & 15 deletions despasito/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,7 @@
import os
import logging
import logging.handlers

# Handle versioneer
from ._version import get_versions

versions = get_versions()
__version__ = versions["version"]
__git_revision__ = versions["full-revisionid"]
del get_versions, versions
from ._version import __version__ as __version__

logger = logging.getLogger("despasito")
logger.setLevel(30)
Expand Down Expand Up @@ -60,9 +53,7 @@ def initiate_logger(console=None, log_file=None, verbose=30):
# Set up logging to console
if console and handler_console is None:
console_handler = logging.StreamHandler() # sys.stderr
console_handler.setFormatter(
logging.Formatter("[%(levelname)s](%(name)s): %(message)s")
)
console_handler.setFormatter(logging.Formatter("[%(levelname)s](%(name)s): %(message)s"))
console_handler.setLevel(verbose)
logger.addHandler(console_handler)
elif console:
Expand All @@ -82,10 +73,7 @@ def initiate_logger(console=None, log_file=None, verbose=30):

log_file_handler = logging.handlers.RotatingFileHandler(log_file)
log_file_handler.setFormatter(
logging.Formatter(
"%(asctime)s [%(levelname)s](%(name)s:%(funcName)s:%(lineno)d): "
+ "%(message)s"
)
logging.Formatter("%(asctime)s [%(levelname)s](%(name)s:%(funcName)s:%(lineno)d): " + "%(message)s")
)
log_file_handler.setLevel(verbose)
logger.addHandler(log_file_handler)
Expand Down
8 changes: 2 additions & 6 deletions despasito/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,15 @@
os.remove(args.logFile)
log_file_handler = logging.handlers.RotatingFileHandler(args.logFile)
log_file_handler.setFormatter(
logging.Formatter(
"%(asctime)s [%(levelname)s](%(name)s:%(funcName)s:%(lineno)d): %(message)s"
)
logging.Formatter("%(asctime)s [%(levelname)s](%(name)s:%(funcName)s:%(lineno)d): %(message)s")
)
log_file_handler.setLevel(args.verbose)
logger.addHandler(log_file_handler)

if args.console:
# Set up logging to console
console_handler = logging.StreamHandler() # sys.stderr
console_handler.setFormatter(
logging.Formatter("[%(levelname)s](%(name)s): %(message)s")
)
console_handler.setFormatter(logging.Formatter("[%(levelname)s](%(name)s): %(message)s"))
console_handler.setLevel(args.verbose)
logger.addHandler(console_handler)

Expand Down
Loading

0 comments on commit 88aea1b

Please sign in to comment.