Skip to content

Commit ee0b866

Browse files
author
Gerit Wagner
committed
update docs
1 parent 97957cf commit ee0b866

40 files changed

Lines changed: 407 additions & 344 deletions

colrev/exceptions.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,38 @@ def __init__(self, old: str, new: str) -> None:
8686
class ReviewManagerNotNotifiedError(CoLRevException):
8787
"""
8888
The ReviewManager was not notified about the operation.
89+
90+
``Dataset.load_records_dict()`` refuses to return data until the review
91+
manager knows which operation is about to run. It expects the
92+
:class:`~colrev.review_manager.ReviewManager` to have its
93+
``notified_next_operation`` flag set, otherwise it raises this exception.
94+
Creating an operation immediately calls :meth:`Operation.notify()
95+
<colrev.operation.Operation.notify>` which sets that flag and runs the
96+
operation's precondition checks. In other words, you do *not* need to call
97+
``notify()`` manually; instantiating the desired operation is enough.
98+
99+
The notification gate exists to prevent two classes of errors:
100+
101+
* **Dirty working tree issues** –
102+
:meth:`Operation.check_precondition()
103+
<colrev.operation.Operation.check_precondition>` ensures the repository is
104+
clean before state-changing work begins. It raises
105+
:class:`~colrev.exceptions.UnstagedGitChangesError` when modifications are
106+
unstaged and :class:`~colrev.exceptions.CleanRepoRequiredError` when tracked
107+
files outside the ignore list would be overwritten. By forcing dataset
108+
access to go through an operation, these safeguards always execute before
109+
records are read or written.
110+
* **Process-order violations** – the same precondition routine verifies that
111+
the requested operation is valid given each record's current status. It can
112+
raise :class:`~colrev.exceptions.ProcessOrderViolation` if earlier steps are
113+
missing or :class:`~colrev.exceptions.NoRecordsError` if work other than
114+
loading is attempted before any records exist. Requiring notification makes
115+
sure these workflow errors are caught instead of letting scripts bypass the
116+
process model.
117+
118+
``ReviewManagerNotNotifiedError`` therefore ensures that every dataset access
119+
is routed through an operation, keeping the repository cleanliness and
120+
process-order checks in place.
89121
"""
90122

91123
def __init__(self) -> None:

docs/source/conf.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
import sys
33
from datetime import datetime
44

5-
import sphinx_rtd_theme
6-
75
try:
86
from colrev import __version__ as colrev_version
97
except Exception:
@@ -23,12 +21,9 @@
2321
# Problems with imports? Could try `export PYTHONPATH=$PYTHONPATH:`pwd``
2422
# from root project dir...
2523

26-
sys.path.insert(
27-
0, os.path.abspath("../../colrev")
28-
) # Source code dir relative to this file
29-
sys.path.insert(
30-
0, os.path.abspath("../../colrev")
31-
) # Source code dir relative to this file
24+
path = os.path.abspath("../../colrev")
25+
if path not in sys.path:
26+
sys.path.insert(0, path)
3227

3328
# -- Project information -----------------------------------------------------
3429

@@ -72,15 +67,12 @@
7267

7368
# -- Options for HTML output -------------------------------------------------
7469

75-
# html_theme = "alabaster"
76-
7770
html_baseurl = "https://colrev-environment.github.io/colrev/"
7871

7972
# Add any paths that contain custom static files (such as style sheets) here,
8073
# relative to this directory. They are copied after the builtin static files,
8174
# so a file named "default.css" will overwrite the builtin "default.css".
8275
html_static_path = ["_static"]
83-
# html_logo = "logo_small.png"
8476
html_favicon = "favicon.png"
8577
html_css_files = [
8678
"css/asciinema-player.css",
@@ -96,7 +88,6 @@
9688
]
9789

9890
html_theme = "sphinx_rtd_theme"
99-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
10091

10192
html_context = {
10293
"display_github": True, # Integrate GitHub
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
colrev.constants.FieldsRegex
2+
============================
3+
4+
.. autoclass:: colrev.constants.FieldsRegex
5+
:members:
6+
:show-inheritance:
7+
:inherited-members:
8+
:special-members: __call__, __add__, __mul__
9+
10+
11+
12+
13+
14+
15+
16+
.. rubric:: Attributes
17+
18+
.. autosummary::
19+
20+
~colrev.constants.FieldsRegex.DOI

docs/source/dev_docs/_autosummary/colrev.constants.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ colrev.constants
2828
colrev.constants.FieldSet
2929
colrev.constants.FieldValues
3030
colrev.constants.Fields
31+
colrev.constants.FieldsRegex
3132
colrev.constants.FileSets
3233
colrev.constants.Filepaths
3334
colrev.constants.IDPattern

docs/source/dev_docs/_autosummary/colrev.env.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ colrev.env
2626
:template: custom-module-template.rst
2727
:recursive:
2828

29-
colrev.env.docker_manager
30-
colrev.env.environment_manager
31-
colrev.env.grobid_service
32-
colrev.env.language_service
33-
colrev.env.local_index
34-
colrev.env.local_index_builder
35-
colrev.env.local_index_prep
36-
colrev.env.local_index_sqlite
37-
colrev.env.resources
38-
colrev.env.tei_parser
39-
colrev.env.utils
29+
docker_manager
30+
environment_manager
31+
grobid_service
32+
language_service
33+
local_index
34+
local_index_builder
35+
local_index_prep
36+
local_index_sqlite
37+
resources
38+
tei_parser
39+
utils
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
colrev.env.tei\_parser.get\_record\_from\_pdf
2+
=============================================
3+
4+
.. currentmodule:: colrev.env.tei_parser
5+
6+
.. autofunction:: get_record_from_pdf

docs/source/dev_docs/_autosummary/colrev.env.tei_parser.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ colrev.env.tei\_parser
99

1010

1111

12+
.. rubric:: Functions
13+
14+
.. autosummary::
15+
:toctree:
16+
:nosignatures:
17+
18+
colrev.env.tei_parser.get_record_from_pdf
19+
1220

1321

1422

docs/source/dev_docs/_autosummary/colrev.hooks.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ colrev.hooks
2626
:template: custom-module-template.rst
2727
:recursive:
2828

29-
colrev.hooks.check
30-
colrev.hooks.format
31-
colrev.hooks.report
32-
colrev.hooks.share
29+
check
30+
format
31+
report
32+
share

docs/source/dev_docs/_autosummary/colrev.loader.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ colrev.loader
2626
:template: custom-module-template.rst
2727
:recursive:
2828

29-
colrev.loader.bib
30-
colrev.loader.enl
31-
colrev.loader.json
32-
colrev.loader.load_utils
33-
colrev.loader.load_utils_formatter
34-
colrev.loader.load_utils_name_formatter
35-
colrev.loader.loader
36-
colrev.loader.md
37-
colrev.loader.nbib
38-
colrev.loader.ris
39-
colrev.loader.table
29+
bib
30+
enl
31+
json
32+
load_utils
33+
load_utils_formatter
34+
load_utils_name_formatter
35+
loader
36+
md
37+
nbib
38+
ris
39+
table

docs/source/dev_docs/_autosummary/colrev.ops.load.Load.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ colrev.ops.load.Load
1818
~colrev.ops.load.Load.conclude
1919
~colrev.ops.load.Load.decorate
2020
~colrev.ops.load.Load.ensure_append_only
21+
~colrev.ops.load.Load.import_record
2122
~colrev.ops.load.Load.load_active_sources
2223
~colrev.ops.load.Load.load_source_records
2324
~colrev.ops.load.Load.main

0 commit comments

Comments
 (0)