Skip to content

Commit 121a934

Browse files
committed
Updated version 0.3.0 with unit tests and gitignore files
1 parent 936849b commit 121a934

9 files changed

+498
-62
lines changed

.gitignore

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# Distribution / packaging
7+
build/
8+
dist/
9+
*.egg-info/
10+
.eggs/
11+
wheels/
12+
*.egg
13+
14+
# Installation directories
15+
downloads/
16+
parts/
17+
sdist/
18+
var/
19+
*.tar.gz
20+
*.zip
21+
22+
# Pytest cache and coverage reports
23+
.pytest_cache/
24+
.coverage
25+
.coverage.*
26+
htmlcov/
27+
coverage.xml
28+
nosetests.xml
29+
30+
# Virtual environment folders (common names)
31+
venv/
32+
.venv/
33+
env/
34+
.env/
35+
ENV/
36+
env.bak/
37+
venv.bak/
38+
39+
# Jupyter Notebook Checkpoints
40+
.ipynb_checkpoints
41+
42+
# Log files
43+
*.log
44+
45+
# Editor directories and files (optional, but common)
46+
.vscode/
47+
.idea/
48+
*.sublime-project
49+
*.sublime-workspace
50+
*.swp
51+
*~
52+
53+
# OS generated files (optional, but common)
54+
.DS_Store
55+
Thumbs.db
56+
57+
# Secrets (IMPORTANT - add any local secret files if you have them)
58+
*.env
59+
secrets.yaml

CONTRIBUTING.md

+50-14
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,50 @@
1-
# Contributing
2-
3-
We welcome contributions from anyone beginner or advanced. Please before working on some features:
4-
5-
* Search through the past issues, your concern may have been raised by others in the past. Check through the
6-
closed issues as well.
7-
* If there is no open issue for your feature request, please open one up to coordinate all collaborators.
8-
* Write your feature.
9-
* Submit a pull request on this repo with:
10-
* A brief description
11-
* **Detail of the expected change(s) in behavior**
12-
* How to test it (if it's not obvious)
13-
14-
Ask someone to test it.
1+
# ./CONTRIBUTING.md (Updated)
2+
3+
# Contributing to featurewiz_polars
4+
5+
First off, thank you for considering contributing! We welcome contributions from everyone. Whether it's reporting a bug, proposing a feature, or writing code, your help is appreciated.
6+
7+
## How Can I Contribute?
8+
9+
### Reporting Bugs
10+
* Ensure the bug was not already reported by searching on GitHub under [Issues](https://github.com/AutoViML/featurewiz_polars/issues).
11+
* If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/AutoViML/featurewiz_polars/issues/new). Be sure to include a **title and clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring.
12+
13+
### Suggesting Enhancements
14+
* Open a new issue to discuss your enhancement suggestion. Clearly describe the proposed feature, why it's needed, and provide examples if possible.
15+
16+
### Pull Requests
17+
We actively welcome your pull requests!
18+
19+
1. **Fork the repo** and create your branch from `main`.
20+
2. **Set up your development environment:**
21+
```bash
22+
git clone <your-fork-url>
23+
cd featurewiz_polars
24+
python -m venv venv
25+
source venv/bin/activate # On Windows use `venv\Scripts\activate`
26+
pip install -e ".[dev]" # Install in editable mode with dev dependencies
27+
pre-commit install # Optional, but recommended: install pre-commit hooks
28+
```
29+
3. **Make your changes.** Add features or fix bugs.
30+
4. **Add Tests:** If you've added code that should be tested, add tests to the `tests/` directory.
31+
5. **Ensure Code Quality:**
32+
* Format your code using Ruff/Black: `ruff format .` or `black .`
33+
* Lint your code using Ruff: `ruff check .`
34+
* Run type checks using MyPy: `mypy featurewiz_polars`
35+
* Run the test suite using Pytest: `pytest tests/ --cov=featurewiz_polars`
36+
* Ensure tests pass and coverage meets requirements (aim for high coverage).
37+
6. **Update Documentation:** If your changes affect documentation (docstrings, README, etc.), please update them accordingly.
38+
7. **Commit your changes** using a clear commit message.
39+
8. **Push** to your fork and submit a **Pull Request (PR)** to the `main` branch of the `AutoViML/featurewiz_polars` repository.
40+
9. **Link the PR to an issue** if it resolves one (e.g., "Closes #123").
41+
10. **Wait for review.** Address any comments or feedback from the maintainers.
42+
43+
## Coding Standards
44+
* Follow PEP 8 style guidelines.
45+
* Use `ruff` for linting and `black` or `ruff format` for code formatting (configuration is in `pyproject.toml` or `.ruff.toml` if added).
46+
* Write clear, understandable code with meaningful variable names.
47+
* Add type hints to function signatures.
48+
* Write comprehensive docstrings for public modules, classes, and functions (NumPy or Google style).
49+
50+
Thank you for contributing!
File renamed without changes.

featurewiz_polars/polars_sulov_mrmr.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def sulov_mrmr(self, X: pl.DataFrame, y: pl.Series) -> List[str]:
103103
print("="*40)
104104

105105
# Separate numeric and categorical features
106-
numeric_cols = X.select(pl.col(pl.NUMERIC_DTYPES)).columns
106+
numeric_cols = X.select(cs.numeric()).columns
107107
cat_cols = X.select(pl.col(pl.String, pl.Categorical)).columns
108108
features = sorted(numeric_cols + cat_cols)
109109

@@ -187,8 +187,8 @@ def _calculate_correlations(self, X: pl.DataFrame) -> pl.DataFrame:
187187
return (
188188
corr_matrix
189189
.with_columns(feature_a=pl.Series(numeric_df.columns))
190-
.melt(
191-
id_vars="feature_a",
190+
.unpivot(
191+
index="feature_a",
192192
variable_name="feature_b",
193193
value_name="correlation"
194194
)

pyproject.toml

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "featurewiz_polars"
7+
version = "0.3.0"
8+
authors = [
9+
{ name = "Ram Seshadri" },
10+
]
11+
description = "Perform feature engineering and selection fast using Polars"
12+
readme = "README.md"
13+
requires-python = ">=3.8"
14+
classifiers = [
15+
"Development Status :: 5 - Pre-Production", # Be honest about maturity
16+
"License :: OSI Approved :: Apache Software 2.0 License",
17+
"Operating System :: OS Independent",
18+
"Programming Language :: Python :: 3",
19+
"Programming Language :: Python :: 3.8",
20+
"Programming Language :: Python :: 3.9",
21+
"Programming Language :: Python :: 3.10",
22+
"Programming Language :: Python :: 3.11",
23+
"Intended Audience :: Developers",
24+
"Intended Audience :: Science/Research",
25+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
26+
"Topic :: Software Development :: Libraries :: Python Modules",
27+
]
28+
# Add keywords for better searchability on PyPI
29+
keywords = ["feature engineering", "feature selection", "polars", "machine learning", "automl", "SULOV"]
30+
dependencies = [
31+
"numpy<2.0",
32+
"pandas>=1.2.4",
33+
"scipy",
34+
"scikit-learn>=1.2.2",
35+
"xgboost>=1.6",
36+
"polars>=1.23.0",
37+
"pyarrow",
38+
"kneed",
39+
"joblib", # For potential parallel processing
40+
"logging", # Standard library, but good practice
41+
"typing", # Standard library
42+
# Add any other direct dependencies
43+
]
44+
45+
# Add Project URLs
46+
[project.urls]
47+
Homepage = "https://github.com/AutoViML/featurewiz_polars"
48+
Repository = "https://github.com/AutoViML/featurewiz_polars"
49+
Documentation = "https://autoviml.github.io/featurewiz_polars/" # Example: Use GitHub Pages or ReadTheDocs
50+
Bug_Tracker = "https://github.com/AutoViML/featurewiz_polars/issues"
51+
52+
# Define Optional Dependencies for Development and Documentation
53+
[project.optional-dependencies]
54+
dev = [
55+
"pytest>=7.0",
56+
"pytest-cov>=4.0",
57+
"ruff>=0.1", # Linter and formatter
58+
"black>=23.0", # Formatter (optional if using ruff format)
59+
"mypy>=1.0", # Static type checker
60+
"pre-commit>=3.0", # For running checks automatically before commits
61+
]
62+
docs = [
63+
"Sphinx>=6.0", # Or MkDocs
64+
"sphinx-rtd-theme", # Example theme
65+
"myst-parser", # For Markdown support in Sphinx
66+
# Add other documentation build dependencies
67+
]

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="featurewiz_polars",
8-
version="0.2.3",
8+
version="0.3.0",
99
author="Ram Seshadri",
1010
# author_email="[email protected]",
1111
description="Fast feature selection using MRMR algorithm and Polars for large datasets.",

0 commit comments

Comments
 (0)