Skip to content

Commit

Permalink
Merge pull request #60 from azogue/minor-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
azogue authored Apr 12, 2024
2 parents d4d1026 + 7dc6a31 commit a663158
Show file tree
Hide file tree
Showing 10 changed files with 118 additions and 113 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exclude: >
)$
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.5
rev: v0.3.7
hooks:
- id: ruff
args:
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.11.1] - 🎨 Minor fixes and lint update - 2024-04-12

##### Changes

- 🎨 lint: pre-commit autoupdate + typing fixes
- 🐛 Fix label color for chart zones
- 🚀 Bump patch version and update CHANGELOG

## [0.11.0] - 📦️ Remove scipy dependency - 2024-04-08

##### Changes
Expand Down
180 changes: 90 additions & 90 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion psychrochart/chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def plot_legend(
markerscale: float = 0.9,
frameon: bool = True,
fancybox: bool = True,
edgecolor: str | Iterable = "darkgrey",
edgecolor: str | Iterable[float] = "darkgrey",
fontsize: float = 15.0,
labelspacing: float = 1.5,
**params,
Expand Down
1 change: 1 addition & 0 deletions psychrochart/plot_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ def plot_curve(
assert isinstance(curve.style, ZoneStyle)
if curve.annotation_style is not None:
style_params.update(curve.annotation_style.export_style())
style_params["color"] = mod_color(curve.style.edgecolor, -25)
reg_artist(
"label_" + gid_zone,
_annotate_label(
Expand Down
13 changes: 3 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,15 @@ plugins = ["pydantic.mypy"]
follow_imports = "silent"
warn_redundant_casts = true
warn_unused_ignores = true
#disallow_any_generics = true
disallow_any_generics = true
check_untyped_defs = true
no_implicit_reexport = true

# for strict mypy: (this is the tricky one :-))
# disallow_untyped_defs = true

[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true

#profile = "black"
#force_sort_within_sections = true
#combine_as_imports = true

[tool.coverage.run]
branch = true
source = ["psychrochart"]
Expand Down Expand Up @@ -62,7 +55,7 @@ log_date_format = "%Y-%m-%d %H:%M:%S"

[tool.poetry]
name = "psychrochart"
version = "0.11.0"
version = "0.11.1"
description = "A python 3 library to make psychrometric charts and overlay information on them"
authors = ["Eugenio Panadero <[email protected]>"]
packages = [
Expand Down Expand Up @@ -90,7 +83,7 @@ keywords=["psychrometrics", "moist", "humid air", "climate control", "matplotlib
include = ["CHANGELOG.md"]

[tool.poetry.dependencies]
python = ">=3.10,<3.13"
python = ">=3.10,<3.14"
matplotlib = ">=3.7"
psychrolib = ">=2.5"
pydantic = ">=2.3.0"
Expand Down
9 changes: 6 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
import re
from pathlib import Path
from time import time
from typing import Callable
from typing import Callable, ParamSpec, TypeVar

from matplotlib import rcParams

from psychrochart import PsychroChart

T = TypeVar("T")
P = ParamSpec("P")

_RG_SVGDATE = re.compile(r"(\s+?<dc:date>.*</dc:date>\s+?)")
RSC_EXAMPLES = Path(__file__).parent / "example-charts"
TEST_BASEDIR = Path(__file__).parent / "generated"
Expand All @@ -31,10 +34,10 @@ def store_test_chart(
chart.save(p_svg, metadata={"Date": None})


def timeit(msg_log: str) -> Callable:
def timeit(msg_log: str):
"""Wrap a method to print the execution time of a method call."""

def _real_deco(func) -> Callable:
def _real_deco(func: Callable[P, T]) -> Callable[P, T]:
def _wrapper(*args, **kwargs):
tic = time()
out = func(*args, **kwargs)
Expand Down
8 changes: 4 additions & 4 deletions tests/example-charts/chart_overlay_style_minimal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions tests/example-charts/test_default_psychrochart.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions tests/example-charts/test_ha_addon_psychrochart.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a663158

Please sign in to comment.