Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Numpy 2.x compatibility #49

Merged
merged 5 commits into from
Aug 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Change Log
==========

[1.4.1] - 2024-08-04
--------------------
- [ADDED] Numpy 2 compatibility

[1.4.0] - 2024-03-29
--------------------
- [ADDED] Official support for Python 3.12.
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors:
given-names: Felix M.
orcid: https://orcid.org/0000-0003-0596-9585
title: "SuSi: SUpervised Self-organIzing maps in Python"
version: 1.4.0
version: 1.4.1
doi: "10.5281/zenodo.2609130"
date-released: 2021-12-11
repository-code: https://github.com/felixriese/susi
Expand Down
4 changes: 2 additions & 2 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
-r docs/requirements.txt
-r test-requirements.txt

mypy==1.9.0
pre-commit==3.6.2
mypy==1.11.1
pre-commit==3.8.0
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# The short X.Y version
version = ""
# The full version, including alpha/beta/rc tags
release = "1.4.0"
release = "1.4.1"


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion guide/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "susi-self-organizing-maps-with-python",
"version": "1.4.0",
"version": "1.4.1",
"description": "Susi is a Python package for unsupervised, supervised and semi-supervised self-organizing maps (SOM).",
"main": "index.js",
"authors": {
Expand Down
2 changes: 1 addition & 1 deletion meta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set name = "susi" %}
{% set version = "1.4.0" %}
{% set version = "1.4.1" %}


package:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ numpy>=1.18.5
scikit-learn>=0.21.1
scipy>=1.3.1
tqdm>=4.45.0
matplotlib==3.7.2
matplotlib>=3.9.0

# for the examples
notebook>=6.0.0
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

setuptools.setup(
name="susi",
version="1.4.0",
version="1.4.1",
author="Felix M. Riese",
author_email="github@felixriese.de",
description=(
Expand Down
2 changes: 1 addition & 1 deletion susi/SOMClassifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def _set_placeholder(self) -> None:
self.placeholder_ = self.placeholder_dict_["str"]
elif self.class_dtype_ in [int, np.uint8, np.int64]:
self.placeholder_ = self.placeholder_dict_["int"]
elif self.class_dtype_ in [float, np.float_, np.float64]:
elif self.class_dtype_ in [float, np.float64]:
self.placeholder_ = self.placeholder_dict_["float"]
else:
raise ValueError(
Expand Down
10 changes: 2 additions & 8 deletions susi/SOMPlots.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,7 @@ def plot_som_histogram(

ax.set_xlabel("SOM columns", fontsize=fontsize)
ax.set_ylabel("SOM rows", fontsize=fontsize)
for tick in ax.xaxis.get_major_ticks():
tick.label.set_fontsize(fontsize)
for tick in ax.yaxis.get_major_ticks():
tick.label.set_fontsize(fontsize)
ax.tick_params(labelsize=fontsize)

# to be compatible with plt.imshow:
ax.invert_yaxis()
Expand Down Expand Up @@ -172,10 +169,7 @@ def plot_umatrix(
ax.set_yticklabels(np.arange(0, n_rows + 1, 10))

# ticks and labels
for tick in ax.xaxis.get_major_ticks():
tick.label.set_fontsize(fontsize)
for tick in ax.yaxis.get_major_ticks():
tick.label.set_fontsize(fontsize)
ax.tick_params(labelsize=fontsize)
ax.set_ylabel("SOM rows", fontsize=fontsize)
ax.set_xlabel("SOM columns", fontsize=fontsize)

Expand Down
2 changes: 1 addition & 1 deletion susi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

"""

__version__ = "1.4.0"
__version__ = "1.4.1"

from .SOMClassifier import SOMClassifier
from .SOMClustering import SOMClustering
Expand Down
8 changes: 4 additions & 4 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
black==24.3.0
black==24.8.0
codecov>=2.1.13
coverage>=7.4.4
flake8==7.0.0
coverage>=7.6.0
flake8==7.1.0
isort==5.13.2
nbval>=0.11.0
pytest>=8.1.1
pytest>=8.3.2
pytest-cov>=4.1.0
pytest_mock==3.14.0
Loading