Skip to content

Commit

Permalink
init repository from sklearn contrib template
Browse files Browse the repository at this point in the history
  • Loading branch information
balins committed Aug 28, 2024
1 parent 37431d8 commit 5c2d4ad
Show file tree
Hide file tree
Showing 23 changed files with 4,505 additions and 5,098 deletions.
4 changes: 2 additions & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

[run]
branch = True
source = skltemplate
include = */skltemplate/*
source = fsvm
include = */fsvm/*
2 changes: 1 addition & 1 deletion .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ jobs:
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: scikit-learn-contrib/project-template
slug: balins/fsvm
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ target/
.LSOverride

# auto-generated files
skltemplate/_version.py
fsvm/_version.py
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ modification, are permitted provided that the following conditions are met:
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of project-template nor the names of its
* Neither the name of fsvm nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
project-template - A template for scikit-learn contributions
============================================================

![tests](https://github.com/scikit-learn-contrib/project-template/actions/workflows/python-app.yml/badge.svg)
[![codecov](https://codecov.io/gh/scikit-learn-contrib/project-template/graph/badge.svg?token=L0XPWwoPLw)](https://codecov.io/gh/scikit-learn-contrib/project-template)
![doc](https://github.com/scikit-learn-contrib/project-template/actions/workflows/deploy-gh-pages.yml/badge.svg)
![tests](https://github.com/balins/fsvm/actions/workflows/python-app.yml/badge.svg)
[![codecov](https://codecov.io/gh/balins/fsvm/graph/badge.svg?token=L0XPWwoPLw)](https://codecov.io/gh/balins/fsvm)
![doc](https://github.com/balins/fsvm/actions/workflows/deploy-gh-pages.yml/badge.svg)

**project-template** is a template project for [scikit-learn](https://scikit-learn.org)
compatible extensions.
Expand Down
8 changes: 4 additions & 4 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,17 @@ qthelp:
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/project-template.qhcp"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/fsvm.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/project-template.qhc"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/fsvm.qhc"

devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/project-template"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/project-template"
@echo "# mkdir -p $$HOME/.local/share/devhelp/fsvm"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/fsvm"
@echo "# devhelp"

epub:
Expand Down
2 changes: 1 addition & 1 deletion doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ API Reference

This is an example on how to document the API of your own project.

.. currentmodule:: skltemplate
.. currentmodule:: fsvm

Estimator
=========
Expand Down
14 changes: 7 additions & 7 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
project = "Scikit-learn Project Template"
copyright = "2016, V. Birodkar"
author = "V. Birodkar"
release = get_version('skltemplate')
release = get_version('fsvm')
version = ".".join(release.split(".")[:3])

# -- General configuration ---------------------------------------------------
Expand Down Expand Up @@ -44,11 +44,11 @@

html_theme = "pydata_sphinx_theme"
html_static_path = ["_static"]
html_style = "css/project-template.css"
html_style = "css/fsvm.css"
html_logo = "_static/img/logo.png"
# html_favicon = "_static/img/favicon.ico"
html_css_files = [
"css/project-template.css",
"css/fsvm.css",
]
html_sidebars = {
"quick_start": [],
Expand All @@ -58,7 +58,7 @@

html_theme_options = {
"external_links": [],
"github_url": "https://github.com/scikit-learn-contrib/project-template",
"github_url": "https://github.com/balins/fsvm",
# "twitter_url": "https://twitter.com/pandas_dev",
"use_edit_page_button": True,
"show_toc_level": 1,
Expand All @@ -67,7 +67,7 @@

html_context = {
"github_user": "scikit-learn-contrib",
"github_repo": "project-template",
"github_repo": "fsvm",
"github_version": "master",
"doc_path": "doc",
}
Expand Down Expand Up @@ -106,9 +106,9 @@
plot_gallery = True

sphinx_gallery_conf = {
"doc_module": "skltemplate",
"doc_module": "fsvm",
"backreferences_dir": os.path.join("generated"),
"examples_dirs": "../examples",
"gallery_dirs": "auto_examples",
"reference_url": {"skltemplate": None},
"reference_url": {"fsvm": None},
}
4 changes: 2 additions & 2 deletions doc/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ if "%1" == "qthelp" (
echo.
echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in %BUILDDIR%/qthelp, like this:
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\project-template.qhcp
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\fsvm.qhcp
echo.To view the help file:
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\project-template.ghc
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\fsvm.ghc
goto end
)

Expand Down
4 changes: 2 additions & 2 deletions examples/plot_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
Plotting Template Classifier
============================
An example plot of :class:`skltemplate.template.TemplateClassifier`
An example plot of :class:`fsvm.template.TemplateClassifier`
"""

# %%
# Train our classifier on very simple dataset
from skltemplate import TemplateClassifier
from fsvm import TemplateClassifier

X = [[0, 0], [1, 1]]
y = [0, 1]
Expand Down
4 changes: 2 additions & 2 deletions examples/plot_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
Plotting Template Estimator
===========================
An example plot of :class:`skltemplate.template.TemplateEstimator`
An example plot of :class:`fsvm.template.TemplateEstimator`
"""
import numpy as np
from matplotlib import pyplot as plt

from skltemplate import TemplateEstimator
from fsvm import TemplateEstimator

X = np.arange(100).reshape(100, 1)
y = np.zeros((100,))
Expand Down
4 changes: 2 additions & 2 deletions examples/plot_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
Plotting Template Transformer
=============================
An example plot of :class:`skltemplate.template.TemplateTransformer`
An example plot of :class:`fsvm.template.TemplateTransformer`
"""
import numpy as np
from matplotlib import pyplot as plt

from skltemplate import TemplateTransformer
from fsvm import TemplateTransformer

X = np.arange(50, dtype=np.float64).reshape(-1, 1)
X /= 50
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions skltemplate/_template.py → fsvm/_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class TemplateEstimator(BaseEstimator):
Examples
--------
>>> from skltemplate import TemplateEstimator
>>> from fsvm import TemplateEstimator
>>> import numpy as np
>>> X = np.arange(100).reshape(100, 1)
>>> y = np.zeros((100, ))
Expand Down Expand Up @@ -138,7 +138,7 @@ class TemplateClassifier(ClassifierMixin, BaseEstimator):
Examples
--------
>>> from sklearn.datasets import load_iris
>>> from skltemplate import TemplateClassifier
>>> from fsvm import TemplateClassifier
>>> X, y = load_iris(return_X_y=True)
>>> clf = TemplateClassifier().fit(X, y)
>>> clf.predict(X)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from sklearn.utils.estimator_checks import parametrize_with_checks

from skltemplate.utils.discovery import all_estimators
from fsvm.utils.discovery import all_estimators


# parametrize_with_checks allows to get a generator of check that is more fine-grained
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from sklearn.datasets import load_iris
from sklearn.utils._testing import assert_allclose, assert_array_equal

from skltemplate import TemplateClassifier, TemplateEstimator, TemplateTransformer
from fsvm import TemplateClassifier, TemplateEstimator, TemplateTransformer

# Authors: scikit-learn-contrib developers
# License: BSD 3 clause
Expand Down
File renamed without changes.
30 changes: 15 additions & 15 deletions skltemplate/utils/discovery.py → fsvm/utils/discovery.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
The :mod:`skltemplate.utils.discovery` module includes utilities to discover
objects (i.e. estimators, displays, functions) from the `skltemplate` package.
The :mod:`fsvm.utils.discovery` module includes utilities to discover
objects (i.e. estimators, displays, functions) from the `fsvm` package.
"""

# Adapted from scikit-learn
Expand All @@ -26,7 +26,7 @@


def all_estimators(type_filter=None):
"""Get a list of all estimators from `skltemplate`.
"""Get a list of all estimators from `fsvm`.
This function crawls the module and gets all classes that inherit
from `BaseEstimator`. Classes that are defined in test-modules are not
Expand All @@ -50,7 +50,7 @@ def all_estimators(type_filter=None):
Examples
--------
>>> from skltemplate.utils.discovery import all_estimators
>>> from fsvm.utils.discovery import all_estimators
>>> estimators = all_estimators()
>>> type(estimators)
<class 'list'>
Expand All @@ -64,12 +64,12 @@ def is_abstract(c):
return True

all_classes = []
root = str(Path(__file__).parent.parent) # skltemplate package
root = str(Path(__file__).parent.parent) # fsvm package
# Ignore deprecation warnings triggered at import time and from walking
# packages
with ignore_warnings(category=FutureWarning):
for _, module_name, _ in pkgutil.walk_packages(
path=[root], prefix="skltemplate."
path=[root], prefix="fsvm."
):
module_parts = module_name.split(".")
if any(part in _MODULE_TO_IGNORE for part in module_parts):
Expand Down Expand Up @@ -126,7 +126,7 @@ def is_abstract(c):


def all_displays():
"""Get a list of all displays from `skltemplate`.
"""Get a list of all displays from `fsvm`.
Returns
-------
Expand All @@ -136,16 +136,16 @@ def all_displays():
Examples
--------
>>> from skltemplate.utils.discovery import all_displays
>>> from fsvm.utils.discovery import all_displays
>>> displays = all_displays()
"""
all_classes = []
root = str(Path(__file__).parent.parent) # skltemplate package
root = str(Path(__file__).parent.parent) # fsvm package
# Ignore deprecation warnings triggered at import time and from walking
# packages
with ignore_warnings(category=FutureWarning):
for _, module_name, _ in pkgutil.walk_packages(
path=[root], prefix="skltemplate."
path=[root], prefix="fsvm."
):
module_parts = module_name.split(".")
if any(part in _MODULE_TO_IGNORE for part in module_parts):
Expand All @@ -170,14 +170,14 @@ def _is_checked_function(item):
return False

mod = item.__module__
if not mod.startswith("skltemplate.") or mod.endswith("estimator_checks"):
if not mod.startswith("fsvm.") or mod.endswith("estimator_checks"):
return False

return True


def all_functions():
"""Get a list of all functions from `skltemplate`.
"""Get a list of all functions from `fsvm`.
Returns
-------
Expand All @@ -187,16 +187,16 @@ def all_functions():
Examples
--------
>>> from skltemplate.utils.discovery import all_functions
>>> from fsvm.utils.discovery import all_functions
>>> functions = all_functions()
"""
all_functions = []
root = str(Path(__file__).parent.parent) # skltemplate package
root = str(Path(__file__).parent.parent) # fsvm package
# Ignore deprecation warnings triggered at import time and from walking
# packages
with ignore_warnings(category=FutureWarning):
for _, module_name, _ in pkgutil.walk_packages(
path=[root], prefix="skltemplate."
path=[root], prefix="fsvm."
):
module_parts = module_name.split(".")
if any(part in _MODULE_TO_IGNORE for part in module_parts):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import pytest

from skltemplate.utils.discovery import all_displays, all_estimators, all_functions
from fsvm.utils.discovery import all_displays, all_estimators, all_functions


def test_all_estimators():
Expand Down
Loading

0 comments on commit 5c2d4ad

Please sign in to comment.