Skip to content

sciait-learn-contrib application guidelines applied #20

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

Merged
merged 6 commits into from
Jun 18, 2025
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
Binary file added .coverage
Binary file not shown.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ docs/build/

# env and caches

mdsenv/
mds-env/
**/__pycache__/
.pytest_cache/
.ruff_cache/
Expand All @@ -25,5 +25,8 @@ docs/source/modules/generated/
**/emos.c
**/mds.cpp

# MAC OS files
.DS_Store

# Reportings
reporting/
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Changelog

## [1.3.0] - 2025-06-18

### Added

- Full test coverage for the entire codebase.
- Badge for test coverage in the README.
- Added `radius` parameter to the `RadiusClustering` class, allowing users to specify the radius for clustering.

### Deprecated

- Deprecated the `threshold` parameter in the `RadiusClustering` class. Use `radius` instead.

### Changed

- Updated all the attributes in the `RadiusClustering` class to fit `scikit-learn` standards and conventions.
- Updated the tests cases to reflect the changes in the `RadiusClustering` class.
- Updated README and documentation to reflect the new `radius` parameter and the deprecation of `threshold`.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
project = "Radius Clustering"
copyright = "2024, Haenn Quentin, Chardin Brice, Baron Mickaël"
author = "Haenn Quentin, Chardin Brice, Baron Mickaël"
release = "1.0"
release = "1.3.0"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
4 changes: 3 additions & 1 deletion docs/source/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ Here's a basic example of how to use Radius Clustering:
X = np.random.rand(100, 2)

# Create an instance of MdsClustering
rad = RadiusClustering(manner="approx", threshold=0.5)
rad = RadiusClustering(manner="approx", radius=0.5)
# Attention: the 'threshold' parameter is deprecated by version 1.3.0
# and will be removed in a future version. Use 'radius' instead.

# Fit the model to the data
rad.fit(X)
Expand Down
4 changes: 2 additions & 2 deletions examples/plot_iris_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
# We create an instance of the `RadiusClustering` class and fit it to the Iris dataset.
import time

rad = RadiusClustering(manner="exact", threshold=1.43)
rad = RadiusClustering(manner="exact", radius=1.43)
t0 = time.time()
rad.fit(X)
t_rad = time.time() - t0
Expand Down Expand Up @@ -242,7 +242,7 @@ def get_order_labels(kmeans, rad, data):

# Compute clustering with MDS

rad = RadiusClustering(manner="exact", threshold=232.09)
rad = RadiusClustering(manner="exact", radius=232.09)
t0 = time.time()
rad.fit(X)
t_rad = time.time() - t0
Expand Down
21 changes: 18 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ documentation = "https://lias-laboratory.github.io/radius_clustering/"
[project.optional-dependencies]
dev = [
"pytest>=8.3.3",
"pytest-cov>=5.0.0",
"pandas",
"cython>=3.0",
"setuptools>= 61.0",
Expand Down Expand Up @@ -80,8 +81,22 @@ pythonpath = "src"
testpaths = ["tests"]
addopts = [
"--import-mode=importlib",
"--cov=src/radius_clustering",
"--cov-report=term-missing",
"--cov-report=html:coverage_html_report",
]

[tool.coverage.run]
source = ["src/radius_clustering"]
branch = true

[tool.coverage.report]
show_missing = true

[tool.coverage.html]
directory = "coverage_html_report"
title = "Coverage Report"

[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [
Expand All @@ -105,14 +120,14 @@ exclude = [

# Same as Black.
line-length = 88
indent-width = 4
target-version = "py310"

[tool.ruff.lint]
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
# McCabe complexity (`C901`) by default.
select = ["E", "F"]
ignore = []
select = ["E", "F", "W", "I"]
ignore = ["E203", "E731", "E741"]

# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
Expand Down
10 changes: 7 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import platform
from setuptools import setup, Extension
from Cython.Build import cythonize

import numpy as np
from Cython.Build import cythonize
from setuptools import Extension, setup

SYSTEM = platform.system()
CPU = platform.processor()
Expand All @@ -21,7 +22,10 @@
extensions = [
Extension(
"radius_clustering.utils._emos",
["src/radius_clustering/utils/emos.pyx", "src/radius_clustering/utils/main-emos.c"],
[
"src/radius_clustering/utils/emos.pyx",
"src/radius_clustering/utils/main-emos.c"
],
include_dirs=[np.get_include(), "src/radius_clustering/utils"],
extra_compile_args=C_COMPILE_ARGS,
),
Expand Down
4 changes: 1 addition & 3 deletions src/radius_clustering/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@
from .radius_clustering import RadiusClustering

__all__ = ["RadiusClustering"]

# Optionally, you can set a version number for your package
__version__ = "1.2.2"
__version__ = "1.3.0"
Loading
Loading