Skip to content

Commit

Permalink
chore: bump requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfikl committed Jan 20, 2024
1 parent d6d28ed commit 3a5f0d9
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 72 deletions.
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ help: ## Show this help

# {{{ linting

format: black pyproject ## Run all formatting scripts
format: black isort pyproject ## Run all formatting scripts
.PHONY: format

fmt: format
Expand All @@ -23,10 +23,15 @@ pyproject: ## Run pyproject-fmt over the configuration

black: ## Run ruff format over the source code
ruff format src tests examples docs drivers
ruff check --fix --select=I src tests examples docs
@echo -e "\e[1;32mruff format clean!\e[0m"
.PHONY: black

isort: ## Run ruff isort fixes over the source code
ruff check --fix --select=I src tests examples docs
ruff check --fix --select=RUF022 src
@echo -e "\e[1;32mruff isort clean!\e[0m"
.PHONY: isort

lint: ruff mypy doc8 codespell reuse manifest ## Run linting checks
.PHONY: lint

Expand Down
62 changes: 31 additions & 31 deletions src/pyshocks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,46 +84,46 @@
# }}}

__all__ = (
"T",
"BlockTimer",
"Boundary",
"BoundaryType",
"CombineConservationLawScheme",
"CombineScheme",
"ConservationLawScheme",
"EOCRecorder",
"FiniteDifferenceSchemeBase",
"FiniteVolumeSchemeBase",
"Grid",
"IterationTimer",
"P",
"Quadrature",
"ScalarFunction",
"VectorFunction",
"SchemeBase",
"SchemeT",
"SpatialFunction",
"T",
"TemporalFunction",
"Grid",
"TimeResult",
"UniformGrid",
"make_uniform_cell_grid",
"make_uniform_point_grid",
"make_uniform_ssweno_grid",
"SchemeT",
"SchemeBase",
"CombineScheme",
"FiniteVolumeSchemeBase",
"FiniteDifferenceSchemeBase",
"bind",
"apply_operator",
"predict_timestep",
"ConservationLawScheme",
"CombineConservationLawScheme",
"flux",
"numerical_flux",
"Boundary",
"BoundaryType",
"VectorFunction",
"apply_boundary",
"apply_operator",
"bind",
"cell_average",
"estimate_order_of_convergence",
"evaluate_boundary",
"Quadrature",
"flux",
"get_logger",
"make_leggauss_quadrature",
"cell_average",
"make_uniform_cell_grid",
"make_uniform_point_grid",
"make_uniform_ssweno_grid",
"norm",
"rnorm",
"EOCRecorder",
"estimate_order_of_convergence",
"TimeResult",
"BlockTimer",
"IterationTimer",
"timeit",
"repeatit",
"numerical_flux",
"predict_timestep",
"profileit",
"get_logger",
"repeatit",
"rnorm",
"set_recommended_matplotlib",
"timeit",
)
12 changes: 6 additions & 6 deletions src/pyshocks/advection/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ def make_scheme_from_name(name: str, **kwargs: Any) -> Scheme:
# }}}

__all__ = (
"Scheme",
"FiniteVolumeScheme",
"FiniteDifferenceScheme",
"Godunov",
"Upwind",
"ESWENO32",
"SBPSAT",
"FiniteDifferenceScheme",
"FiniteVolumeScheme",
"FluxSplitGodunov",
"scheme_ids",
"Godunov",
"Scheme",
"Upwind",
"make_scheme_from_name",
"scheme_ids",
)
16 changes: 8 additions & 8 deletions src/pyshocks/burgers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,17 @@ def make_scheme_from_name(name: str, **kwargs: Any) -> Scheme:


__all__ = (
"Scheme",
"FiniteVolumeScheme",
"FiniteDifferenceScheme",
"Godunov",
"Rusanov",
"LaxFriedrichs",
"EngquistOsher",
"ESWENO32",
"SSMUSCL",
"SSWENO242",
"EngquistOsher",
"FiniteDifferenceScheme",
"FiniteVolumeScheme",
"FluxSplitRusanov",
"scheme_ids",
"Godunov",
"LaxFriedrichs",
"Rusanov",
"Scheme",
"make_scheme_from_name",
"scheme_ids",
)
8 changes: 4 additions & 4 deletions src/pyshocks/continuity/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ def check_oslc(grid: Grid, velocity: SpatialFunction, *, n: int = 512) -> Scalar


__all__ = (
"Scheme",
"FiniteVolumeScheme",
"FiniteDifferenceScheme",
"FiniteVolumeScheme",
"Godunov",
"scheme_ids",
"make_scheme_from_name",
"Scheme",
"check_oslc",
"make_scheme_from_name",
"scheme_ids",
)
10 changes: 5 additions & 5 deletions src/pyshocks/diffusion/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ def make_scheme_from_name(name: str, **kwargs: Any) -> Scheme:
# }}}

__all__ = (
"Scheme",
"FiniteVolumeScheme",
"FiniteDifferenceScheme",
"CenteredScheme",
"SBPSAT",
"scheme_ids",
"CenteredScheme",
"FiniteDifferenceScheme",
"FiniteVolumeScheme",
"Scheme",
"make_scheme_from_name",
"scheme_ids",
)
23 changes: 7 additions & 16 deletions src/pyshocks/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,26 @@
from __future__ import annotations

import logging
import os


def get_logger(
module: str,
level: int | str | None = None,
) -> logging.Logger:
if level is None:
level = logging.INFO
level = os.environ.get("PYSHOCKS_LOGGING_LEVEL", "INFO").upper()

if isinstance(level, str):
level = getattr(logging, level.upper())

assert isinstance(level, int)

logger = logging.getLogger(module)
logger.propagate = False
logger.setLevel(level)

try:
root = logging.getLogger("pyshocks")
if not root.handlers:
from rich.logging import RichHandler

logger.addHandler(RichHandler())
except ImportError:
# NOTE: rich is vendored by pip since November 2021
try:
from pip._vendor.rich.logging import RichHandler # type: ignore

logger.addHandler(RichHandler())
except ImportError:
logger.addHandler(logging.StreamHandler())
root.setLevel(level)
root.addHandler(RichHandler())

return logger
return logging.getLogger(module)

0 comments on commit 3a5f0d9

Please sign in to comment.