Skip to content

Commit 8b12d4c

Browse files
authored
#298 Add punchlines (#299)
1 parent 96159b8 commit 8b12d4c

5 files changed

Lines changed: 92 additions & 61 deletions

File tree

src/senzing/szconfig.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class SzConfig(ABC):
3535
@abstractmethod
3636
def add_data_source(self, data_source_code: str) -> str:
3737
"""
38-
The `add_data_source` method adds a data source to an existing in-memory configuration.
38+
The `add_data_source` method adds a new data source to this instance.
3939
4040
Args:
4141
data_source_code (str): Name of data source code to add.
@@ -62,7 +62,7 @@ def add_data_source(self, data_source_code: str) -> str:
6262
@abstractmethod
6363
def delete_data_source(self, data_source_code: str) -> str:
6464
"""
65-
The `delete_data_source` method removes a data source from an existing in-memory configuration.
65+
The `delete_data_source` method deletes a data source from this instance.
6666
6767
Args:
6868
data_source_code (str): Name of data source code to delete.
@@ -86,7 +86,7 @@ def delete_data_source(self, data_source_code: str) -> str:
8686
@abstractmethod
8787
def export(self) -> str:
8888
"""
89-
The `export` method creates a JSON string representation of the Senzing SzConfig object.
89+
The `export` method retrieves the configuration definition for this instance.
9090
9191
Args:
9292
@@ -112,8 +112,7 @@ def export(self) -> str:
112112
@abstractmethod
113113
def get_data_sources(self) -> str:
114114
"""
115-
The `get_data_sources` method returns a JSON document of data sources
116-
contained in an in-memory configuration.
115+
The `get_data_sources` method gets the data sources for this instance.
117116
118117
Args:
119118
@@ -142,7 +141,7 @@ def get_data_sources(self) -> str:
142141

143142
def help(self, method_name: str = "") -> str:
144143
"""
145-
Return the help for a particular message.
144+
The `help` method returns help for a particular message.
146145
147146
Args:
148147
method_name (str): The name of the method. (e.g. "init"). If empty, a list of methods and descriptions is returned.

src/senzing/szconfigmanager.py

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ class SzConfigManager(ABC):
3636
@abstractmethod
3737
def create_config_from_config_id(self, config_id: int) -> SzConfig:
3838
"""
39-
The `create_config_from_config_id` method creates an in-memory Senzing configuration
40-
from a specific Senzing configuration stored in the Senzing database.
39+
The `create_config_from_config_id` method creates a new SzConfig instance for a configuration ID.
4140
4241
Args:
4342
config_id (int): The configuration identifier of the desired Senzing configuration to retrieve.
@@ -64,8 +63,7 @@ def create_config_from_config_id(self, config_id: int) -> SzConfig:
6463
@abstractmethod
6564
def create_config_from_string(self, config_definition: str) -> SzConfig:
6665
"""
67-
The `create_config_from_string` method creates an in-memory Senzing configuration
68-
from the given Senzing configuration JSON document.
66+
The `create_config_from_string` method creates a new SzConfig instance from a configuration definition.
6967
7068
Args:
7169
config_definition (str): The Senzing configuration JSON document.
@@ -92,8 +90,10 @@ def create_config_from_string(self, config_definition: str) -> SzConfig:
9290
@abstractmethod
9391
def create_config_from_template(self) -> SzConfig:
9492
"""
95-
The `create_config_from_template` method creates an in-memory Senzing configuration
96-
from the template Senzing configuration JSON document located at PIPELINE.RESOURCEPATH/templates/g2config.json
93+
The `create_config_from_template` method Creates a new SzConfig instance
94+
from the template configuration definition.
95+
96+
The template configuration is located at PIPELINE.RESOURCEPATH/templates/g2config.json
9797
9898
Args:
9999
config_definition (str): The Senzing configuration JSON document.
@@ -120,7 +120,7 @@ def create_config_from_template(self) -> SzConfig:
120120
@abstractmethod
121121
def get_config_registry(self) -> str:
122122
"""
123-
The `get_config_registry` method retrieves a list of Senzing configurations from the Senzing database.
123+
The `get_config_registry` method gets the configuration registry.
124124
125125
Returns:
126126
str: A JSON document containing Senzing configurations.
@@ -144,7 +144,7 @@ def get_config_registry(self) -> str:
144144
@abstractmethod
145145
def get_default_config_id(self) -> int:
146146
"""
147-
The `get_default_config_id` method retrieves from the Senzing database the configuration identifier of the default Senzing configuration.
147+
The `get_default_config_id` method gets the default configuration for the repository.
148148
149149
Returns:
150150
int: A configuration identifier which identifies the current configuration in use.
@@ -168,7 +168,7 @@ def get_default_config_id(self) -> int:
168168
@abstractmethod
169169
def register_config(self, config_definition: str, config_comment: str) -> int:
170170
"""
171-
The `register_config` method adds a Senzing configuration JSON document to the Senzing database.
171+
The `register_config` method registers a configuration definition with the repository.
172172
173173
Args:
174174
config_definition (str): The Senzing configuration JSON document.
@@ -196,7 +196,9 @@ def register_config(self, config_definition: str, config_comment: str) -> int:
196196
@abstractmethod
197197
def replace_default_config_id(self, current_default_config_id: int, new_default_config_id: int) -> None:
198198
"""
199-
The `replace_default_config_id` method replaces the old configuration identifier with a new configuration identifier in the Senzing database.
199+
The `replace_default_config_id` method replaces the existing default configuration ID with a new
200+
configuration ID.
201+
200202
It is like a "compare-and-swap" instruction to serialize concurrent editing of configuration.
201203
If `current_default_config_id` is no longer the "current configuration identifier", the operation will fail.
202204
To simply set the default configuration ID, use `set_default_config_id`.
@@ -218,7 +220,9 @@ def replace_default_config_id(self, current_default_config_id: int, new_default_
218220
@abstractmethod
219221
def set_default_config(self, config_definition: str, config_comment: str) -> int:
220222
"""
221-
The `set_default_config` method replaces the current default Senzing configuration in the Senzing database.
223+
The `set_default_config` method registers a configuration with the repository and sets its ID as the default
224+
for the repository.
225+
222226
To serialize modifying of the configuration identifier, see `replace_default_config_id`.
223227
224228
Args:
@@ -244,7 +248,8 @@ def set_default_config(self, config_definition: str, config_comment: str) -> int
244248
@abstractmethod
245249
def set_default_config_id(self, config_id: int) -> None:
246250
"""
247-
The `set_default_config_id` method replaces and sets a new configuration identifier in the Senzing database.
251+
The `set_default_config_id` method Sets the default configuration ID.
252+
248253
To serialize modifying of the configuration identifier, see `replace_default_config_id`.
249254
250255
Args:
@@ -266,7 +271,7 @@ def set_default_config_id(self, config_id: int) -> None:
266271

267272
def help(self, method_name: str = "") -> str:
268273
"""
269-
Return the help for a particular message.
274+
The `help` method returns help for a particular message.
270275
271276
Args:
272277
method_name (str): The name of the method. (e.g. "init"). If empty, a list of methods and descriptions is returned.

src/senzing/szdiagnostic.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class SzDiagnostic(ABC):
3232
@abstractmethod
3333
def check_datastore_performance(self, seconds_to_run: int) -> str:
3434
"""
35-
The `check_datastore_performance` method performs inserts to determine rate of insertion.
35+
The `check_datastore_performance` method conducts a rudimentary datastore test to gauge I/O performance.
3636
3737
Args:
3838
seconds_to_run (int): Duration of the test in seconds.
@@ -60,7 +60,7 @@ def check_datastore_performance(self, seconds_to_run: int) -> str:
6060
@abstractmethod
6161
def get_datastore_info(self) -> str:
6262
"""
63-
The `get_datastore_info` method returns a JSON document with details of the datastore
63+
The `get_datastore_info` method returns overview information about the datastore.
6464
currently in use by Senzing.
6565
6666
Raises:
@@ -82,13 +82,13 @@ def get_datastore_info(self) -> str:
8282
# NOTE This is experimental and for internal diagnostics, not to be documented
8383
@abstractmethod
8484
def get_feature(self, feature_id: int) -> str: # pylint: disable=empty-docstring
85-
""""""
85+
"""Experimental/internal for Senzing support use only."""
8686

8787
@abstractmethod
8888
def purge_repository(self) -> None:
8989
"""
9090
**Warning:**
91-
The `purge_repository` method removes every record in the Senzing repository.
91+
The `purge_repository` method purges all entity data in the entire repository.
9292
9393
Before calling `purge_repository` all other instances of the Senzing API
9494
MUST be destroyed or shutdown.
@@ -108,7 +108,7 @@ def purge_repository(self) -> None:
108108

109109
def help(self, method_name: str = "") -> str:
110110
"""
111-
Return the help for a particular message.
111+
The `help` method returns help for a particular message.
112112
113113
Args:
114114
method_name (str): The name of the method. (e.g. "init"). If empty, a list of methods and descriptions is returned.

0 commit comments

Comments
 (0)