Skip to content

Commit

Permalink
Merge pull request #25 from martinvonk/dev
Browse files Browse the repository at this point in the history
Update main to v0.3.4
  • Loading branch information
martinvonk authored May 3, 2023
2 parents f8e204e + 0f3d8d7 commit 3883f51
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
python: "3.9"
os: ubuntu-latest
toxenv: format
- name: Linting with flake8
- name: Linting with flake8 + ruff
python: "3.9"
os: ubuntu-latest
toxenv: lint
Expand Down
2 changes: 1 addition & 1 deletion doc/_static/make_logo.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import matplotlib.pyplot as plt
from numpy import meshgrid, linspace
from numpy import linspace, meshgrid

fig, ax = plt.subplots(figsize=(27, 9))
x, y = meshgrid((0, 100), linspace(0, 0.1, 1000))
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ classifiers = [
'Intended Audience :: Science/Research',
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Typing :: Typed",
]

[project.urls]
Expand Down
2 changes: 1 addition & 1 deletion src/spei/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# flake8: noqa
from . import plot, si, utils
from ._version import __version__
from ._version import __version__, show_versions
from .si import sgi, spei, spi, ssfi
17 changes: 16 additions & 1 deletion src/spei/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
__version__ = "0.3.3"
from importlib import metadata
from platform import python_version

__version__ = "0.3.4"


def show_versions() -> None:
msg = f"Versions\npython: {python_version()}\nspei: {__version__}\n"

requirements = metadata.requires("spei")
if requirements:
deps = [x for x in requirements if "extra" not in x]
for dep in deps:
msg += f"{dep}: {metadata.version(dep)}\n"

print(msg)
File renamed without changes.
6 changes: 3 additions & 3 deletions tests/test_dist_utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from spei.utils import dists_test
from pandas import Series

from .fixtures import head
from spei.utils import dists_test


def test_dists_test(head) -> None:
def test_dists_test(head: Series) -> None:
_ = dists_test(head)
2 changes: 0 additions & 2 deletions tests/test_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
from spei.plot import dist, monthly_density
from spei.plot import si as plot_si

from .fixtures import prec, si

mpl.use("Agg") # prevent _tkinter.TclError: Can't find a usable tk.tcl error


Expand Down
2 changes: 0 additions & 2 deletions tests/test_si.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

from spei import sgi, spei, spi, ssfi

from .fixtures import evap, head, prec


def test_spi(prec: Series) -> None:
spi(prec.rolling("30D", min_periods=30).sum().dropna(), prob_zero=True)
Expand Down
3 changes: 2 additions & 1 deletion tests/test_validate.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pytest
import logging

import pytest
from pandas import DataFrame, Series, to_datetime

from spei.utils import validate_index, validate_series
Expand Down
10 changes: 10 additions & 0 deletions tests/test_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import spei as si


def test_version() -> None:
assert isinstance(si.__version__, str)
assert si.__version__.count(".") == 2


def test_show_versions():
si.show_versions()

0 comments on commit 3883f51

Please sign in to comment.