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

Renaming the src/whoosh_reloaded folder back to src/whoosh #37

Merged
merged 13 commits into from
Feb 2, 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
20 changes: 20 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[run]
branch = True
omit =
# Autogenerated missed code handles other VCSes.
devito/_version.py
examples/*__init__*
concurrency = multiprocessing
parallel = True

[report]
# Regexes for lines to exclude from consideration
exclude_lines =
# Don't complain about missing debug-only code:
def __repr__

# Don't complain if tests don't hit defensive assertion code:
raise NotImplementedError
raise ValueError
raise TypeError
raise RuntimeError
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ jobs:
- name: Run test
run: pytest
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ eggs/
.eggs/
*.egg
*.egg-info/
/test.py
6 changes: 3 additions & 3 deletions benchmark/dictionary.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os.path, gzip

from whoosh_reloaded import analysis, fields
from whoosh_reloaded.support.bench import Bench, Spec
from whoosh import analysis, fields
from whoosh.support.bench import Bench, Spec


class VulgarTongue(Spec):
Expand Down Expand Up @@ -35,7 +35,7 @@ def whoosh_schema(self):
return schema

def zcatalog_setup(self, cat):
from zcatalog import indexes # @UnresolvedImport
from zcatalog import indexes # type: ignore @UnresolvedImport

cat["head"] = indexes.FieldIndex(field_name="head")
cat["body"] = indexes.TextIndex(field_name="body")
Expand Down
12 changes: 6 additions & 6 deletions benchmark/enron.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
from zlib import compress, decompress

try:
import xappy
import xappy # type: ignore
except ImportError:
pass

from whoosh_reloaded import analysis, fields
from whoosh_reloaded.compat import urlretrieve, next
from whoosh_reloaded.support.bench import Bench, Spec
from whoosh_reloaded.util import now
from whoosh import analysis, fields
from whoosh.compat import urlretrieve, next
from whoosh.support.bench import Bench, Spec
from whoosh.util import now


# Benchmark class
Expand Down Expand Up @@ -165,7 +165,7 @@ def xappy_indexer_connection(self, path):
return conn

def zcatalog_setup(self, cat):
from zcatalog import indexes
from zcatalog import indexes # type: ignore

for name in ("date", "frm"):
cat[name] = indexes.FieldIndex(field_name=name)
Expand Down
8 changes: 4 additions & 4 deletions benchmark/marc21.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from __future__ import with_statement, print_function
import fnmatch, logging, os.path, re

from whoosh_reloaded import analysis, fields, index, qparser, query, scoring
from whoosh_reloaded.compat import xrange
from whoosh_reloaded.util import now
from whoosh import analysis, fields, index, qparser, query, scoring
from whoosh.compat import range
from whoosh.util import now


log = logging.getLogger(__name__)
Expand Down Expand Up @@ -59,7 +59,7 @@ def parse_record(data, tags=None):
field_count = (dirend - dirstart) // DIRECTORY_ENTRY_LEN

result = {}
for i in xrange(field_count):
for i in range(field_count):
start = dirstart + i * DIRECTORY_ENTRY_LEN
end = start + DIRECTORY_ENTRY_LEN
tag = data[start : start + 3]
Expand Down
8 changes: 4 additions & 4 deletions benchmark/reuters.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import gzip, os.path

from whoosh_reloaded import analysis, fields, index, qparser, query
from whoosh_reloaded.support.bench import Bench, Spec
from whoosh_reloaded.util import now
from whoosh import analysis, fields, index, qparser, query
from whoosh.support.bench import Bench, Spec
from whoosh.util import now


class Reuters(Spec):
Expand All @@ -22,7 +22,7 @@ def whoosh_schema(self):
return schema

def zcatalog_setup(self, cat):
from zcatalog import indexes # @UnresolvedImport
from zcatalog import indexes # type: ignore @UnresolvedImport

cat["id"] = indexes.FieldIndex(field_name="id")
cat["headline"] = indexes.TextIndex(field_name="headline")
Expand Down
28 changes: 28 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
codecov:
require_ci_to_pass: yes
notify:
wait_for_ci: yes

coverage:
precision: 2
round: down
range: 80...90

status:
# Learn more at http://docs.codecov.io/docs/codecov-yaml
project:
default:
enabled: yes
target: 1
threshold: 0.1
patch:
default:
enabled: off

ignore:
- "**/*.ipynb"
- docs
- docker
- binder
- .github
- .git
8 changes: 4 additions & 4 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,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/whoosh_reloaded.qhcp"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/whoosh.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/whoosh_reloaded.qhc"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/whoosh.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/whoosh_reloaded"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/whoosh_reloaded"
@echo "# mkdir -p $$HOME/.local/share/devhelp/whoosh"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/whoosh"
@echo "# devhelp"

epub:
Expand Down
4 changes: 2 additions & 2 deletions docs/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\whoosh_reloaded.qhcp
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\whoosh.qhcp
echo.To view the help file:
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\whoosh_reloaded.ghc
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\whoosh.ghc
goto end
)

Expand Down
18 changes: 9 additions & 9 deletions docs/source/analysis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ tokenizer, and the tokenizer will usually be wrapped in a few filters.
A tokenizer is a callable that takes a unicode string and yields a series of
``analysis.Token`` objects.

For example, the provided :class:`whoosh_reloaded.analysis.RegexTokenizer` class
For example, the provided :class:`whoosh.analysis.RegexTokenizer` class
implements a customizable, regular-expression-based tokenizer that extracts
words and ignores whitespace and punctuation.

::

>>> from whoosh_reloaded.analysis import RegexTokenizer
>>> from whoosh.analysis import RegexTokenizer
>>> tokenizer = RegexTokenizer()
>>> for token in tokenizer(u"Hello there my friend!"):
... print repr(token.text)
Expand All @@ -38,7 +38,7 @@ words and ignores whitespace and punctuation.
A filter is a callable that takes a generator of Tokens (either a tokenizer or
another filter) and in turn yields a series of Tokens.

For example, the provided :meth:`whoosh_reloaded.analysis.LowercaseFilter` filters tokens
For example, the provided :meth:`whoosh.analysis.LowercaseFilter` filters tokens
by converting their text to lowercase. The implementation is very simple::

def LowercaseFilter(tokens):
Expand All @@ -52,7 +52,7 @@ by converting their text to lowercase. The implementation is very simple::

You can wrap the filter around a tokenizer to see it in operation::

>>> from whoosh_reloaded.analysis import LowercaseFilter
>>> from whoosh.analysis import LowercaseFilter
>>> for token in LowercaseFilter(tokenizer(u"These ARE the things I want!")):
... print repr(token.text)
u'these'
Expand All @@ -72,10 +72,10 @@ tokenizers and filters together using the ``|`` character::

The first item must be a tokenizer and the rest must be filters (you can't put a
filter first or a tokenizer after the first item). Note that this only works if at
least the tokenizer is a subclass of ``whoosh_reloaded.analysis.Composable``, as all the
least the tokenizer is a subclass of ``whoosh.analysis.Composable``, as all the
tokenizers and filters that ship with Whoosh are.

See the :mod:`whoosh_reloaded.analysis` module for information on the available analyzers,
See the :mod:`whoosh.analysis` module for information on the available analyzers,
tokenizers, and filters shipped with Whoosh.


Expand Down Expand Up @@ -185,7 +185,7 @@ want to apply at indexing or query parsing::
else:
...

The :class:`whoosh_reloaded.analysis.MultiFilter` filter class lets you specify different
The :class:`whoosh.analysis.MultiFilter` filter class lets you specify different
filters to use based on the mode setting::

intraword = MultiFilter(index=IntraWordFilter(mergewords=True, mergenums=True),
Expand All @@ -201,7 +201,7 @@ filter out stop words, and includes a default list of common stop words.

::

>>> from whoosh_reloaded.analysis import StopFilter
>>> from whoosh.analysis import StopFilter
>>> stopper = StopFilter()
>>> for token in stopper(LowercaseFilter(tokenizer(u"These ARE the things I want!"))):
... print repr(token.text)
Expand Down Expand Up @@ -276,7 +276,7 @@ be removed from the stream or left in.

::

>>> from whoosh_reloaded.analysis import StandardAnalyzer
>>> from whoosh.analysis import StandardAnalyzer
>>> analyzer = StandardAnalyzer()
>>> [(t.text, t.stopped) for t in analyzer(u"This is a test")]
[(u'test', False)]
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/analysis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
``analysis`` module
===================

.. automodule:: whoosh_reloaded.analysis
.. automodule:: whoosh.analysis

Analyzers
=========
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/codec/base.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
``codec.base`` module
=====================

.. automodule:: whoosh_reloaded.codec.base
.. automodule:: whoosh.codec.base


Classes
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/collectors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
``collectors`` module
=====================

.. automodule:: whoosh_reloaded.collectors
.. automodule:: whoosh.collectors


Base classes
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/columns.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
``columns`` module
=====================

.. automodule:: whoosh_reloaded.columns
.. automodule:: whoosh.columns


Base classes
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/fields.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
``fields`` module
=================

.. automodule:: whoosh_reloaded.fields
.. automodule:: whoosh.fields

Schema class
============
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/filedb/filestore.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
``filedb.filestore`` module
===========================

.. automodule:: whoosh_reloaded.filedb.filestore
.. automodule:: whoosh.filedb.filestore

Base class
==========
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/filedb/filetables.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
``filedb.filetables`` module
============================

.. automodule:: whoosh_reloaded.filedb.filetables
.. automodule:: whoosh.filedb.filetables


Hash file
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/filedb/structfile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
``filedb.structfile`` module
============================

.. automodule:: whoosh_reloaded.filedb.structfile
.. automodule:: whoosh.filedb.structfile

Classes
=======
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/formats.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
``formats`` module
==================

.. automodule:: whoosh_reloaded.formats
.. automodule:: whoosh.formats

Base class
==========
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/highlight.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
``highlight`` module
====================

.. automodule:: whoosh_reloaded.highlight
.. automodule:: whoosh.highlight

See :doc:`how to highlight terms in search results </highlight>`.

Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/idsets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
``support.bitvector`` module
============================

.. automodule:: whoosh_reloaded.idsets
.. automodule:: whoosh.idsets


Base classes
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
``index`` module
================

.. automodule:: whoosh_reloaded.index
.. automodule:: whoosh.index


Functions
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/lang/morph_en.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
``lang.morph_en`` module
========================

.. automodule:: whoosh_reloaded.lang.morph_en
.. automodule:: whoosh.lang.morph_en

.. autofunction:: variations
2 changes: 1 addition & 1 deletion docs/source/api/lang/porter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
``lang.porter`` module
======================

.. automodule:: whoosh_reloaded.lang.porter
.. automodule:: whoosh.lang.porter

.. autofunction:: stem
2 changes: 1 addition & 1 deletion docs/source/api/lang/wordnet.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
``lang.wordnet`` module
========================

.. automodule:: whoosh_reloaded.lang.wordnet
.. automodule:: whoosh.lang.wordnet

Thesaurus
=========
Expand Down
Loading
Loading