Skip to content

Commit fd76672

Browse files
committed
DOC v0.30 part 1 (index, dev, install, quickstart, changelog)
1 parent ecc529d commit fd76672

File tree

8 files changed

+154
-120
lines changed

8 files changed

+154
-120
lines changed

CONTRIBUTING.rst

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Contributing
1111
Contributions from the community are highly appreciated.
1212
Even small contributions improve the software's quality.
1313

14-
Even if you are not familiar with programming languages and tools,
14+
If you are not familiar with programming languages and tools,
1515
you may contribute by filing bugs or any problems as a
1616
`GitHub issue <https://github.com/VarIr/scikit-hubness/issues>`_.
1717

@@ -25,13 +25,14 @@ If you are not familiar with git, there are lots of tutorials on
2525
All the important basics are covered in the
2626
`GitHub Git handbook <https://guides.github.com/introduction/git-handbook/>`_.
2727

28-
Development of `scikit-hubness` (mostly) follows the
29-
`git flow branching model <https://nvie.com/posts/a-successful-git-branching-model/>`_.
30-
There are two main branches: master and develop.
28+
There is one main branches: ``main``.
3129
For any changes, a new branch should be created.
32-
If you want to add a new feature, fix a noncritical bug, etc. one should
33-
branch off `develop`.
34-
Only if you want to fix a critical bug, branch off `master`.
30+
If you want to add a new feature, fix a noncritical bug, fix a critical bug,
31+
branch off ``main``, introduce your changes, and create a pull request.
32+
33+
(Previously, development of `scikit-hubness` (mostly) followed the
34+
`git flow branching model <https://nvie.com/posts/a-successful-git-branching-model/>`_.
35+
This was found to be unnecessarily complicated for a project of this size).
3536

3637

3738
Workflow
@@ -55,10 +56,10 @@ you can - of course - directly submit a pull request (PR).
5556

5657
#. Create feature/bugfix branch.
5758
In case of feature or noncritical bugfix:
58-
$ ``git checkout develop && git checkout -b featureXYZ develop``
59+
$ ``git checkout main && git checkout -b featureXYZ``
5960

6061
In case of critical bug:
61-
$ ``git checkout -b bugfix123 master``
62+
$ ``git checkout -b bugfix123 main``
6263

6364
#. Implement feature/fix bug/fix typo/...
6465
Happy coding!
@@ -76,13 +77,13 @@ you can - of course - directly submit a pull request (PR).
7677

7778
#. Wait...
7879
Several devops checks will be performed automatically
79-
(e.g. continuous integration (CI) with Travis, AppVeyor).
80+
(e.g. continuous integration (CI) with Github Actions).
8081

8182
The authors will get in contact with you,
8283
and may ask for changes.
8384

8485
#. Respond to code review.
85-
If there were issues with continous integration,
86+
If there were issues with continuous integration,
8687
or the authors asked for changes, please create a new commit locally,
8788
and simply push again to GitHub as you did before.
8889
The PR will be updated automatically.
@@ -123,9 +124,9 @@ Code style and further guidelines
123124
Testing
124125
=======
125126

126-
In `scikit-hubness`, we aim for high code coverage. As of September 2019,
127-
between 98% and 99% of all code lines are visited at least once when
128-
running the complete test suite. This is primarily to ensure:
127+
In `scikit-hubness`, we aim for high code coverage. Between 90% and 100% of all code lines
128+
should be visited at least once when running the complete test suite.
129+
This is primarily to ensure:
129130

130131
* correctness of the code (to some extent) and
131132
* maintainability (new changes don't break old code).

docs/changelog.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,48 @@
33
## [Next release]
44
...
55

6+
7+
## [0.30.0] - 2022-04-xx
8+
9+
### Major changes
10+
- Compatibility with up-to-date scikit-learn versions
11+
- Building upon the KNeighborsTransformer API as outlined in
12+
[our paper's Outlook section](https://joss.theoj.org/papers/10.21105/joss.01957).
13+
- `skhubness.neighbors` rewritten from scratch. Previously, this was a drop-in
14+
replacement for `sklearn.neighbors` heavily relying on a specific scikit-learn
15+
version. This was hard to maintain. Now, this package only contains lightweight
16+
wrappers for approximate nearest neighbor search tools (`nmslib`, `ngt`, etc.)
17+
that return `KNeighborsTransformer`-compatible k-neighbors graphs. These can be
18+
reused in numerous scikit-learn classes and functions.
19+
- `skhubness.analysis` uses `KNeighborsTransformer`-compatible k-neighbors graphs.
20+
- `skhubness.reduction` uses `KNeighborsTransformer`-compatible k-neighbors graphs.
21+
622
### Added or enhanced
23+
- Python 3.9 and Python 3.10 support
24+
- Additional metrics available for ANN search with `nmslib` #87
25+
- Additional metrics available for ANN search with `ngtpy` #95
726
- Lower memory footprint for sparse targets in multilabel classification
827
(previously converted to dense arrays) #61
928

29+
### Removed
30+
- `falconn` removed (not maintained for 5+ years; index structures cannot be serialized; no Windows support) #94
31+
- Radius neighbor search. Few ANN packages provide radius search. No currently supported
32+
ANN package supports this on Windows. Radius search is not of particular interest to
33+
hubness research. Thus, we decided to drop radius search for the time being to speed up
34+
development. Later releases might re-introduce radius search. Users interested in this
35+
are asked to file an Issue at Github
36+
1037
### Fixes
1138
- Hubness estimation could fail when ANN does not return enough neighbors #59
1239
- Heuristic to choose memory for Puffinn LSH.
1340

1441
### Maintenance
1542
- Switch to modern Python packaging with `pyproject.toml` and `setup.cfg`
1643
- Switch to Github Actions, dropping Travis CI and AppVeyor
44+
- Renamed 0.22 to 0.30. Previous versions reflected the compatibility with specific
45+
scikit-learn versions by matching version numbers. The bump to 0.30 indicates that
46+
this tight coupling is gone and future scikit-hubness releases should be compatible
47+
with multiple scikit-learn versions.
1748

1849

1950
## [0.21.2] - 2020-01-14
@@ -100,7 +131,8 @@ It already contains the following features:
100131
* HNSW provided by [nmslib](https://github.com/nmslib/nmslib)
101132
* LSH provided by [falconn](https://github.com/FALCONN-LIB/FALCONN)
102133

103-
[Next release]: https://github.com/VarIr/scikit-hubness/compare/v0.21.2...HEAD
134+
[Next release]: https://github.com/VarIr/scikit-hubness/compare/v0.30.0...HEAD
135+
[0.30.0]: https://github.com/VarIr/scikit-hubness/releases/tag/v0.30.0
104136
[0.21.2]: https://github.com/VarIr/scikit-hubness/releases/tag/v0.21.2
105137
[0.21.1]: https://github.com/VarIr/scikit-hubness/releases/tag/v0.21.1
106138
[0.21.0]: https://github.com/VarIr/scikit-hubness/releases/tag/v0.21.0

docs/conf.py

Lines changed: 50 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,22 @@
1414
import sys
1515
sys.path.insert(0, os.path.abspath('../'))
1616

17-
import mock
18-
MOCK_MODULES = ['falconn',
19-
'nmslib',
20-
'annoy',
21-
'ngt',
22-
'ngtpy',
23-
'puffinn',
24-
]
17+
from unittest.mock import Mock
18+
MOCK_MODULES = [
19+
'nmslib',
20+
'annoy',
21+
'ngt',
22+
'ngtpy',
23+
'numba',
24+
'puffinn',
25+
]
2526
for mod_name in MOCK_MODULES:
26-
sys.modules[mod_name] = mock.Mock()
27+
sys.modules[mod_name] = Mock()
2728

2829
# -- Project information -----------------------------------------------------
2930

3031
project = 'scikit-hubness'
31-
copyright = '2020, Roman Feldbauer'
32+
copyright = '2022, Roman Feldbauer'
3233
author = 'Roman Feldbauer'
3334

3435
# The full version, including alpha/beta/rc tags
@@ -41,24 +42,25 @@
4142
# Add any Sphinx extension module names here, as strings. They can be
4243
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
4344
# ones.
44-
extensions = ['recommonmark',
45-
'numpydoc',
46-
'sphinx_automodapi.automodapi',
47-
'sphinx.ext.autodoc',
48-
'sphinx.ext.autosectionlabel',
49-
'sphinx.ext.autosummary',
50-
'sphinx.ext.graphviz',
51-
'sphinx.ext.inheritance_diagram',
52-
'sphinx.ext.todo',
53-
'sphinx.ext.napoleon',
54-
'sphinx.ext.githubpages',
55-
'sphinx.ext.mathjax',
56-
'sphinx.ext.doctest',
57-
'sphinx.ext.intersphinx',
58-
'sphinx.ext.linkcode',
59-
'sphinx_gallery.gen_gallery', # to automatically generate example pages from scripts
60-
'sphinx_search.extension', # readthedocs-sphinx-search with ElasticSearch
61-
]
45+
extensions = [
46+
'recommonmark',
47+
'numpydoc',
48+
'sphinx_automodapi.automodapi',
49+
'sphinx.ext.autodoc',
50+
'sphinx.ext.autosectionlabel',
51+
'sphinx.ext.autosummary',
52+
'sphinx.ext.graphviz',
53+
'sphinx.ext.inheritance_diagram',
54+
'sphinx.ext.todo',
55+
'sphinx.ext.napoleon',
56+
'sphinx.ext.githubpages',
57+
'sphinx.ext.mathjax',
58+
'sphinx.ext.doctest',
59+
'sphinx.ext.intersphinx',
60+
'sphinx.ext.linkcode',
61+
'sphinx_gallery.gen_gallery', # to automatically generate example pages from scripts
62+
'sphinx_search.extension', # readthedocs-sphinx-search with ElasticSearch
63+
]
6264

6365
# Due to sphinx-automodapi
6466
numpydoc_show_class_members = False
@@ -75,8 +77,11 @@
7577
# List of patterns, relative to source directory, that match files and
7678
# directories to ignore when looking for source files.
7779
# This pattern also affects html_static_path and html_extra_path.
78-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store',
79-
]
80+
exclude_patterns = [
81+
'_build',
82+
'Thumbs.db',
83+
'.DS_Store',
84+
]
8085

8186
# Mock packages that are not installed on rtd
8287
autodoc_mock_imports = MOCK_MODULES
@@ -90,25 +95,24 @@
9095
# The following is used by sphinx.ext.linkcode to provide links to github
9196
from docs.github_link import make_linkcode_resolve
9297

93-
linkcode_resolve = make_linkcode_resolve('skhubness',
94-
'https://github.com/VarIr/'
95-
'scikit-hubness/blob/{revision}/'
96-
'{package}/{path}#L{lineno}')
98+
linkcode_resolve = make_linkcode_resolve(
99+
'skhubness', 'https://github.com/VarIr/scikit-hubness/blob/{revision}/{package}/{path}#L{lineno}',
100+
)
97101

98102
# sphinx gallery: where to take scripts from and where to save output to
99103
sphinx_gallery_conf = {
100-
'examples_dirs': # path to your example scripts:
101-
['../examples/sklearn',
102-
'../examples/hubness_reduction',
103-
'../examples/approximate_neighbors',
104-
'../examples/approximate_hub_red',
105-
],
106-
'gallery_dirs': # path to where to save gallery generated output:
107-
['documentation/auto_examples',
108-
'documentation/auto_examples_hr',
109-
'documentation/auto_examples_ann',
110-
'documentation/auto_examples_ahr',
111-
],
104+
'examples_dirs': [ # path to your example scripts:
105+
'../examples/sklearn',
106+
'../examples/hubness_reduction',
107+
'../examples/approximate_neighbors',
108+
'../examples/approximate_hub_red',
109+
],
110+
'gallery_dirs': [ # path to where to save gallery generated output:
111+
'documentation/auto_examples',
112+
'documentation/auto_examples_hr',
113+
'documentation/auto_examples_ann',
114+
'documentation/auto_examples_ahr',
115+
],
112116
}
113117

114118
# suppress numerous "duplicate label" warnings from sphinx-gallery

docs/development/contributing.rst

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Contributing
1111
Contributions from the community are highly appreciated.
1212
Even small contributions improve the software's quality.
1313

14-
Even if you are not familiar with programming languages and tools,
14+
If you are not familiar with programming languages and tools,
1515
you may contribute by filing bugs or any problems as a
1616
`GitHub issue <https://github.com/VarIr/scikit-hubness/issues>`_.
1717

@@ -25,13 +25,14 @@ If you are not familiar with git, there are lots of tutorials on
2525
All the important basics are covered in the
2626
`GitHub Git handbook <https://guides.github.com/introduction/git-handbook/>`_.
2727

28-
Development of `scikit-hubness` (mostly) follows the
29-
`git flow branching model <https://nvie.com/posts/a-successful-git-branching-model/>`_.
30-
There are two main branches: master and develop.
28+
There is one main branches: ``main``.
3129
For any changes, a new branch should be created.
32-
If you want to add a new feature, fix a noncritical bug, etc. one should
33-
branch off `develop`.
34-
Only if you want to fix a critical bug, branch off `master`.
30+
If you want to add a new feature, fix a noncritical bug, fix a critical bug,
31+
branch off ``main``, introduce your changes, and create a pull request.
32+
33+
(Previously, development of `scikit-hubness` (mostly) followed the
34+
`git flow branching model <https://nvie.com/posts/a-successful-git-branching-model/>`_.
35+
This was found to be unnecessarily complicated for a project of this size).
3536

3637

3738
Workflow
@@ -55,10 +56,10 @@ you can - of course - directly submit a pull request (PR).
5556

5657
#. Create feature/bugfix branch.
5758
In case of feature or noncritical bugfix:
58-
$ ``git checkout develop && git checkout -b featureXYZ develop``
59+
$ ``git checkout main && git checkout -b featureXYZ``
5960

6061
In case of critical bug:
61-
$ ``git checkout -b bugfix123 master``
62+
$ ``git checkout -b bugfix123 main``
6263

6364
#. Implement feature/fix bug/fix typo/...
6465
Happy coding!
@@ -76,7 +77,7 @@ you can - of course - directly submit a pull request (PR).
7677

7778
#. Wait...
7879
Several devops checks will be performed automatically
79-
(e.g. continuous integration (CI) with GitHub Actions).
80+
(e.g. continuous integration (CI) with Github Actions).
8081

8182
The authors will get in contact with you,
8283
and may ask for changes.
@@ -123,9 +124,9 @@ Code style and further guidelines
123124
Testing
124125
=======
125126

126-
In `scikit-hubness`, we aim for high code coverage. As of September 2019,
127-
between 98% and 99% of all code lines are visited at least once when
128-
running the complete test suite. This is primarily to ensure:
127+
In `scikit-hubness`, we aim for high code coverage. Between 90% and 100% of all code lines
128+
should be visited at least once when running the complete test suite.
129+
This is primarily to ensure:
129130

130131
* correctness of the code (to some extent) and
131132
* maintainability (new changes don't break old code).

0 commit comments

Comments
 (0)