Skip to content

Commit 0680cfc

Browse files
docktermjantaenc
andauthored
#298 Update documentation (#332)
* #298 Update szconfig.py * #298 Update szconfigmanager.py * #298 Update szdiagnostic.py and szproduct.py * 298 Update version, date, update * 298 Update szengine * #298 Update descriptions * #298 Update descriptions * #298 Update version to 4.0.0 * #298 Update version to 4.0.0 * #298 Update version to 4.0.0 * #298 Fix documentation --------- Co-authored-by: antaenc <28313221+antaenc@users.noreply.github.com>
1 parent 124719a commit 0680cfc

11 files changed

Lines changed: 164 additions & 95 deletions

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning].
77

88
## [Unreleased]
99

10+
## [4.0.0] - 2025-08-05
11+
12+
### Changed in 4.0.0
13+
14+
- For use with Senzing v4
15+
1016
## [0.2.20] - 2025-07-19
1117

1218
### Changed in 0.2.20

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = senzing
3-
version = 0.2.20
3+
version = 4.0.0
44
author = senzing
55
author_email = support@senzing.com
66
description = Python SDK method definitions

src/senzing/constants.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
"SZ_VERBOSE_LOGGING",
1616
"SZ_WITHOUT_INFO",
1717
]
18-
__version__ = "0.0.1" # See https://www.python.org/dev/peps/pep-0396/
19-
__date__ = "2023-10-30"
20-
__updated__ = "2023-10-30"
18+
__version__ = "4.0.0"
19+
__date__ = "2025-08-05"
20+
__updated__ = "2025-08-05"
2121

2222
# -----------------------------------------------------------------------------
2323
# Constant helper values useful for flags

src/senzing/szabstractfactory.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
# Metadata
2525

2626
__all__ = ["SzAbstractFactory"]
27-
__version__ = "0.0.1" # See https://www.python.org/dev/peps/pep-0396/
28-
__date__ = "2024-09-23"
29-
__updated__ = "2025-01-28"
27+
__version__ = "4.0.0"
28+
__date__ = "2025-08-05"
29+
__updated__ = "2025-08-05"
3030

3131

3232
# -----------------------------------------------------------------------------

src/senzing/szconfig.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
# Metadata
1414

1515
__all__ = ["SzConfig"]
16-
__version__ = "0.0.1" # See https://www.python.org/dev/peps/pep-0396/
17-
__date__ = "2023-10-30"
18-
__updated__ = "2025-01-28"
16+
__version__ = "4.0.0"
17+
__date__ = "2025-08-05"
18+
__updated__ = "2025-08-05"
1919

2020
# -----------------------------------------------------------------------------
2121
# SzConfig
@@ -89,6 +89,9 @@ def register_data_source(self, data_source_code: str) -> str:
8989
"""
9090
The `register_data_source` method adds a data source to this configuration.
9191
92+
Because SzConfig is an in-memory representation, the repository is not changed
93+
unless the configuration is exported and then registered via ConfigManager.
94+
9295
Args:
9396
data_source_code (str): Name of data source code to add.
9497
@@ -116,6 +119,14 @@ def unregister_data_source(self, data_source_code: str) -> str:
116119
"""
117120
The `unregister_data_source` method removes a data source from this configuration.
118121
122+
Because SzConfig is an in-memory representation, the repository is not changed unless
123+
the configuration is exported and then registered via ConfigManager.
124+
125+
Is idempotent.
126+
127+
Warning: If records in the repository refer to the unregistered datasource,
128+
the configuration cannot be used as the active configuration.
129+
119130
Args:
120131
data_source_code (str): Name of data source code to delete.
121132

src/senzing/szconfigmanager.py

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
# Metadata
1515

1616
__all__ = ["SzConfigManager"]
17-
__version__ = "0.0.1" # See https://www.python.org/dev/peps/pep-0396/
18-
__date__ = "2023-10-30"
19-
__updated__ = "2023-11-08"
17+
__version__ = "4.0.0"
18+
__date__ = "2025-08-05"
19+
__updated__ = "2025-08-05"
2020

2121
# -----------------------------------------------------------------------------
2222
# SzConfigManager
@@ -93,8 +93,6 @@ def create_config_from_template(self) -> SzConfig:
9393
The `create_config_from_template` method creates a new SzConfig instance from the template
9494
configuration definition.
9595
96-
The template configuration is located at PIPELINE.RESOURCEPATH/templates/g2config.json
97-
9896
Args:
9997
config_definition (str): The Senzing configuration JSON document.
10098
@@ -122,6 +120,11 @@ def get_config_registry(self) -> str:
122120
"""
123121
The `get_config_registry` method gets the configuration registry.
124122
123+
The registry contains the original timestamp, original comment, and configuration ID
124+
of all configurations ever registered with the repository.
125+
126+
Registered configurations cannot be unregistered.
127+
125128
Returns:
126129
str: A JSON document containing Senzing configurations.
127130
@@ -146,8 +149,12 @@ def get_default_config_id(self) -> int:
146149
"""
147150
The `get_default_config_id` method gets the default configuration ID for the repository.
148151
152+
Unless an explicit configuration ID is specified at initialization, the default configuration ID is used.
153+
154+
This may not be the same as the active configuration ID.
155+
149156
Returns:
150-
int: A configuration identifier which identifies the current configuration in use.
157+
int: The current default configuration ID or zero if the default configuration has not been set.
151158
152159
Raises:
153160
TypeError: Incorrect datatype of input parameter.
@@ -170,6 +177,10 @@ def register_config(self, config_definition: str, config_comment: str) -> int:
170177
"""
171178
The `register_config` method registers a configuration definition in the repository.
172179
180+
Registered configurations do not become immediately active nor do they become the default.
181+
182+
Registered configurations cannot be unregistered.
183+
173184
Args:
174185
config_definition (str): The Senzing configuration JSON document.
175186
config_comment (str): free-form string of comments describing the configuration document.
@@ -199,9 +210,9 @@ def replace_default_config_id(self, current_default_config_id: int, new_default_
199210
The `replace_default_config_id` method replaces the existing default configuration ID with
200211
a new configuration ID.
201212
202-
It is like a "compare-and-swap" instruction to serialize concurrent editing of configuration.
203-
If `current_default_config_id` is no longer the "current configuration identifier", the operation will fail.
204-
To simply set the default configuration ID, use `set_default_config_id`.
213+
The change is prevented if the current default configuration ID value is not as expected.
214+
215+
Use this in place of set_default_config_id() to handle race conditions.
205216
206217
Args:
207218
current_default_config_id (int): The configuration identifier to replace.
@@ -223,7 +234,7 @@ def set_default_config(self, config_definition: str, config_comment: str) -> int
223234
The `set_default_config` method registers a configuration in the repository and sets its ID as the default
224235
for the repository.
225236
226-
To serialize modifying of the configuration identifier, see `replace_default_config_id`.
237+
Convenience method for register_config() followed by set_default_config_id().
227238
228239
Args:
229240
config_definition (str): The Senzing configuration JSON document.
@@ -250,7 +261,9 @@ def set_default_config_id(self, config_id: int) -> None:
250261
"""
251262
The `set_default_config_id` method sets the default configuration ID.
252263
253-
To serialize modifying of the configuration identifier, see `replace_default_config_id`.
264+
Usually this method is sufficient for setting the default configuration ID.
265+
However in concurrent environments that could encounter race conditions,
266+
consider using replace_default_config_id() instead.
254267
255268
Args:
256269
config_id (int): The configuration identifier of the Senzing Engine configuration to use as the default.

src/senzing/szdiagnostic.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
# Metadata
1212

1313
__all__ = ["SzDiagnostic"]
14-
__version__ = "0.0.1" # See https://www.python.org/dev/peps/pep-0396/
15-
__date__ = "2023-10-30"
16-
__updated__ = "2025-01-28"
14+
__version__ = "4.0.0"
15+
__date__ = "2025-08-05"
16+
__updated__ = "2025-08-05"
1717

1818
# -----------------------------------------------------------------------------
1919
# SzDiagnostic
@@ -32,7 +32,12 @@ class SzDiagnostic(ABC):
3232
@abstractmethod
3333
def check_repository_performance(self, seconds_to_run: int) -> str:
3434
"""
35-
The `check_repository_performance` method conducts a rudimentary repository test to gauge I/O performance.
35+
The `check_repository_performance` method conducts a rudimentary repository test to gauge I/O
36+
and network performance.
37+
38+
Typically, this is only run when troubleshooting performance.
39+
40+
This is a non-destructive test.
3641
3742
Args:
3843
seconds_to_run (int): Duration of the test in seconds.
@@ -89,8 +94,11 @@ def purge_repository(self) -> None:
8994
**Warning:**
9095
The `purge_repository` method purges all data in the repository, except the configuration.
9196
92-
Before calling `purge_repository` all other instances of the Senzing API
93-
MUST be destroyed or shutdown.
97+
WARNING: This method is destructive, it will delete all loaded records and entity resolution decisions.
98+
99+
Senzing does not provide a means to restore the data.
100+
101+
The only means of recovery would be restoring from a database backup.
94102
95103
Raises:
96104

0 commit comments

Comments
 (0)