Skip to content

Commit

Permalink
Remove public API of indexing module. (#580)
Browse files Browse the repository at this point in the history
* Remove public API for indexing module.

* Remove index command from signac.__main__.

* Remove tests for methods and classes that have been removed.

* Remove index from CLI help message.

* Make indexing features adhere to pydocstyle.

* Fix typo.

* Remove index shell test.
  • Loading branch information
bdice authored Aug 3, 2021
1 parent 5f337f2 commit 257c931
Show file tree
Hide file tree
Showing 11 changed files with 196 additions and 1,242 deletions.
2 changes: 1 addition & 1 deletion doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Top-level functions
.. automodule:: signac
:members:
:show-inheritance:
:exclude-members: Project,Collection,RegexFileCrawler,MainCrawler,MasterCrawler,SignacProjectCrawler,JSONDict,H5Store,H5StoreManager
:exclude-members: Project,Collection,JSONDict,H5Store,H5StoreManager


Submodules
Expand Down
4 changes: 2 additions & 2 deletions doc/cli-help.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
usage: signac [-h] [--debug] [--version] [-v] [-y]
{init,project,job,statepoint,diff,document,rm,move,clone,index,find,view,schema,shell,sync,import,export,update-cache,config}
{init,project,job,statepoint,diff,document,rm,move,clone,find,view,schema,shell,sync,import,export,update-cache,config}
...

signac aids in the management, access and analysis of large-scale
computational investigations.

positional arguments:
{init,project,job,statepoint,diff,document,rm,move,clone,index,find,view,schema,shell,sync,import,export,update-cache,config}
{init,project,job,statepoint,diff,document,rm,move,clone,find,view,schema,shell,sync,import,export,update-cache,config}

optional arguments:
-h, --help show this help message and exit
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ select = E,F,W
ignore = E123,E126,E203,E226,E241,E704,W503,W504

[pydocstyle]
match = ^((?!\.sync-zenodo-metadata|setup|benchmark|indexing).)*\.py$
match = ^((?!\.sync-zenodo-metadata|setup|benchmark).)*\.py$
match-dir = ^((?!\.|tests|configobj).)*$
ignore-decorators = "deprecated"
add-ignore = D105, D107, D203, D204, D213
Expand All @@ -35,7 +35,7 @@ omit =

[tool:pytest]
filterwarnings =
ignore: .*[The indexing module | get_statepoint | Use of.+as key] is deprecated.*: DeprecationWarning
ignore: .*[get_statepoint | Use of.+as key] is deprecated.*: DeprecationWarning

[bumpversion:file:setup.py]

Expand Down
23 changes: 0 additions & 23 deletions signac/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,10 @@
from . import cite, contrib, errors, sync, testing, warnings
from .contrib import (
Collection,
MainCrawler,
MasterCrawler,
Project,
RegexFileCrawler,
SignacProjectCrawler,
TemporaryProject,
export,
export_one,
export_pymongo,
export_to_mirror,
fetch,
get_job,
get_project,
index,
index_files,
init_project,
)
from .core.h5store import H5Store, H5StoreManager
Expand Down Expand Up @@ -56,19 +45,7 @@
"init_project",
"get_job",
"diff_jobs",
"fetch",
"export_one",
"export",
"export_to_mirror",
"Collection",
"export_pymongo",
"fs",
"index_files",
"index",
"RegexFileCrawler",
"MainCrawler",
"MasterCrawler",
"SignacProjectCrawler",
"buffered",
"is_buffered",
"get_buffer_size",
Expand Down
26 changes: 2 additions & 24 deletions signac/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
else:
READLINE = True

from . import Project, get_project, index, init_project
from . import Project, get_project, init_project
from .common import config
from .common.configobj import Section, flatten_errors
from .contrib.filterparse import parse_filter_arg
Expand Down Expand Up @@ -277,16 +277,6 @@ def main_clone(args):
_print_err(f"Cloned '{job}' to '{dst_project}'.")


def main_index(args):
"""Handle index subcommand."""
_print_err(f"Compiling main index for path '{os.path.realpath(args.root)}'...")
if args.tags:
args.tags = set(args.tags)
_print_err("Provided tags: {}".format(", ".join(sorted(args.tags))))
for doc in index(root=args.root, tags=args.tags, raise_on_error=args.debug):
print(json.dumps(doc))


def main_find(args):
"""Handle find subcommand."""
project = get_project()
Expand Down Expand Up @@ -1197,18 +1187,6 @@ def main():
)
parser_clone.set_defaults(func=main_clone)

parser_index = subparsers.add_parser("index")
parser_index.add_argument(
"root",
nargs="?",
default=".",
help="Specify the root path from where the main index is to be compiled.",
)
parser_index.add_argument(
"-t", "--tags", nargs="+", help="Specify tags for this main index compilation."
)
parser_index.set_defaults(func=main_index)

parser_find = subparsers.add_parser(
"find",
description="""All filter arguments may be provided either directly in JSON
Expand Down Expand Up @@ -1486,7 +1464,7 @@ def main():
"--ignore-times",
action="store_true",
dest="deep",
help="Never rely on file meta data such as the size or the modification time "
help="Never rely on file metadata such as the size or the modification time "
"when determining file differences.",
)
sync_group.add_argument(
Expand Down
32 changes: 0 additions & 32 deletions signac/contrib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,49 +5,17 @@

import logging

from . import indexing
from .collection import Collection
from .indexing import (
BaseCrawler,
JSONCrawler,
MainCrawler,
MasterCrawler,
RegexFileCrawler,
SignacProjectCrawler,
export,
export_one,
export_pymongo,
export_to_mirror,
fetch,
fetched,
index,
index_files,
)
from .project import Project, TemporaryProject, get_job, get_project, init_project

logger = logging.getLogger(__name__)


__all__ = [
"indexing",
"Project",
"TemporaryProject",
"get_project",
"init_project",
"get_job",
"BaseCrawler",
"RegexFileCrawler",
"JSONCrawler",
"SignacProjectCrawler",
"MainCrawler",
"MasterCrawler",
"fetch",
"fetched",
"export_one",
"export",
"export_to_mirror",
"export_pymongo",
"index_files",
"index",
"Collection",
]
Loading

0 comments on commit 257c931

Please sign in to comment.