nerdd-module 0.3.27__tar.gz → 0.3.29__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/PKG-INFO +1 -1
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/cli.py +2 -2
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/model/enforce_schema_step.py +4 -6
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/model/model.py +9 -7
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/model/simple_model.py +9 -7
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/problem.py +1 -1
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/util/call_with_mappings.py +1 -1
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module.egg-info/PKG-INFO +1 -1
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/pyproject.toml +1 -1
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/LICENSE +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/README.md +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/__init__.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/config/__init__.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/config/configuration.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/config/default_configuration.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/config/dict_configuration.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/config/merged_configuration.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/config/models.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/config/package_configuration.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/config/search_yaml_configuration.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/config/yaml_configuration.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/converters/__init__.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/converters/basic_type_converter.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/converters/converter.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/converters/converter_config.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/converters/mol_converter.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/converters/problem_list_converter.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/converters/representation_converter.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/converters/source_list_converter.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/converters/void_converter.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/input/__init__.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/input/depth_first_explorer.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/input/explorer.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/input/file_reader.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/input/gzip_reader.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/input/inchi_reader.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/input/list_reader.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/input/mol_reader.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/input/reader.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/input/reader_config.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/input/sdf_reader.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/input/smiles_reader.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/input/string_reader.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/input/tar_reader.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/input/zip_reader.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/model/__init__.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/model/assign_name_step.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/model/convert_representations_step.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/model/read_input_step.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/model/write_output_step.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/output/__init__.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/output/csv_writer.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/output/file_writer.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/output/iterator_writer.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/output/pandas_writer.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/output/record_list_writer.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/output/sdf_writer.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/output/writer.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/output/writer_config.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/polyfills/__init__.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/polyfills/block_logs.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/polyfills/files.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/polyfills/get_entry_points.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/polyfills/literal.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/polyfills/typed_dict.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/polyfills/types.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/polyfills/version.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/preprocessing/__init__.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/preprocessing/check_valid_smiles.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/preprocessing/chembl_structure_pipeline.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/preprocessing/filter_by_element.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/preprocessing/filter_by_weight.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/preprocessing/preprocessing_step.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/preprocessing/remove_stereochemistry.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/preprocessing/sanitize.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/py.typed +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/steps/__init__.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/steps/map_step.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/steps/output_step.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/steps/step.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/tests/__init__.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/tests/checks.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/tests/files.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/tests/models/AtomicMassModel.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/tests/models/MolWeightModel.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/tests/models/__init__.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/tests/predictions.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/tests/preprocessing/DummyPreprocessingStep.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/tests/preprocessing/__init__.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/tests/representations.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/util/__init__.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/util/package.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/version.py +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module.egg-info/SOURCES.txt +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module.egg-info/dependency_links.txt +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module.egg-info/requires.txt +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module.egg-info/top_level.txt +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/setup.cfg +0 -0
- {nerdd_module-0.3.27 → nerdd_module-0.3.29}/tests/test_features.py +0 -0
|
@@ -67,8 +67,8 @@ def auto_cli(f: Callable[..., Model], *args: Any, **kwargs: Any) -> None:
|
|
|
67
67
|
|
|
68
68
|
# compose footer with examples
|
|
69
69
|
examples = []
|
|
70
|
-
if hasattr(model, "
|
|
71
|
-
example_smiles = model.
|
|
70
|
+
if hasattr(model, "config"):
|
|
71
|
+
example_smiles = model.config.example_smiles
|
|
72
72
|
if example_smiles is not None:
|
|
73
73
|
examples.append(example_smiles)
|
|
74
74
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
from typing import Iterator
|
|
3
3
|
|
|
4
|
-
from ..config import
|
|
4
|
+
from ..config import Module
|
|
5
5
|
from ..steps import Step
|
|
6
6
|
|
|
7
7
|
__all__ = ["EnforceSchemaStep"]
|
|
@@ -10,11 +10,9 @@ logger = logging.getLogger(__name__)
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class EnforceSchemaStep(Step):
|
|
13
|
-
def __init__(self, config:
|
|
13
|
+
def __init__(self, config: Module, output_format: str) -> None:
|
|
14
14
|
super().__init__()
|
|
15
|
-
self._property_names = [
|
|
16
|
-
p.name for p in config.get_dict().get_visible_properties(output_format)
|
|
17
|
-
]
|
|
15
|
+
self._property_names = [p.name for p in config.get_visible_properties(output_format)]
|
|
18
16
|
|
|
19
17
|
# check that properties are unique
|
|
20
18
|
if len(self._property_names) != len(set(self._property_names)):
|
|
@@ -22,7 +20,7 @@ class EnforceSchemaStep(Step):
|
|
|
22
20
|
x for x in self._property_names if self._property_names.count(x) > 1
|
|
23
21
|
}
|
|
24
22
|
logger.warning(
|
|
25
|
-
f"Duplicate properties in result_properties:
|
|
23
|
+
f"Duplicate properties in result_properties: {', '.join(duplicate_properties)}"
|
|
26
24
|
)
|
|
27
25
|
|
|
28
26
|
def _run(self, source: Iterator[dict]) -> Iterator[dict]:
|
|
@@ -164,7 +164,7 @@ class PredictionStep(Step):
|
|
|
164
164
|
isinstance(record, dict) for record in predictions
|
|
165
165
|
), "The predictions must be a list of dictionaries."
|
|
166
166
|
except Exception as e:
|
|
167
|
-
logger.error
|
|
167
|
+
logger.exception("An error occurred during prediction.", exc_info=e)
|
|
168
168
|
|
|
169
169
|
# if an error occurs, we want to catch it and yield the error message
|
|
170
170
|
predictions = [
|
|
@@ -214,13 +214,15 @@ class PredictionStep(Step):
|
|
|
214
214
|
mol_id_to_record[record["mol_id"]].append(record)
|
|
215
215
|
|
|
216
216
|
# add all records that are missing in the predictions
|
|
217
|
-
for mol_id
|
|
217
|
+
for mol_id in temporary_mol_ids:
|
|
218
218
|
if mol_id not in mol_id_to_record:
|
|
219
|
-
#
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
219
|
+
# add a dummy record to the mapping
|
|
220
|
+
mol_id_to_record[mol_id].append(
|
|
221
|
+
{
|
|
222
|
+
# notify the user that the molecule could not be predicted
|
|
223
|
+
"problems": [IncompletePredictionProblem()],
|
|
224
|
+
}
|
|
225
|
+
)
|
|
224
226
|
|
|
225
227
|
# If the result has multiple entries per mol_id, check that atom_id or
|
|
226
228
|
# derivative_id is present in multi-entry results.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from abc import abstractmethod
|
|
2
|
+
from functools import cached_property
|
|
2
3
|
from typing import Any, Iterable, List, Optional, Tuple, Union
|
|
3
4
|
|
|
4
5
|
from rdkit.Chem import Mol
|
|
@@ -61,8 +62,8 @@ class SimpleModel(Model):
|
|
|
61
62
|
def _get_postprocessing_steps(self, output_format: Optional[str], **kwargs: Any) -> List[Step]:
|
|
62
63
|
output_format = output_format or "pandas"
|
|
63
64
|
return [
|
|
64
|
-
EnforceSchemaStep(self.
|
|
65
|
-
ConvertRepresentationsStep(self.
|
|
65
|
+
EnforceSchemaStep(self.config, output_format),
|
|
66
|
+
ConvertRepresentationsStep(self.config, output_format, **kwargs),
|
|
66
67
|
WriteOutputStep(output_format, **kwargs),
|
|
67
68
|
]
|
|
68
69
|
|
|
@@ -187,23 +188,24 @@ class SimpleModel(Model):
|
|
|
187
188
|
|
|
188
189
|
return MergedConfiguration(*configs)
|
|
189
190
|
|
|
190
|
-
|
|
191
|
+
@cached_property
|
|
192
|
+
def config(self) -> Module:
|
|
191
193
|
return self._get_config().get_dict()
|
|
192
194
|
|
|
193
195
|
def _get_batch_size(self) -> int:
|
|
194
196
|
default = super()._get_batch_size()
|
|
195
|
-
return self.
|
|
197
|
+
return self.config.batch_size or default
|
|
196
198
|
|
|
197
199
|
def _get_name(self) -> str:
|
|
198
200
|
default = super()._get_name()
|
|
199
|
-
return self.
|
|
201
|
+
return self.config.name or default
|
|
200
202
|
|
|
201
203
|
def _get_description(self) -> str:
|
|
202
204
|
default = super()._get_description()
|
|
203
|
-
return self.
|
|
205
|
+
return self.config.description or default
|
|
204
206
|
|
|
205
207
|
def _get_job_parameters(self) -> List[JobParameter]:
|
|
206
|
-
return super()._get_job_parameters() + self.
|
|
208
|
+
return super()._get_job_parameters() + self.config.job_parameters
|
|
207
209
|
|
|
208
210
|
|
|
209
211
|
class CustomPreprocessingStep(PreprocessingStep):
|
|
@@ -25,7 +25,7 @@ def UnknownProblem() -> Problem:
|
|
|
25
25
|
def InvalidWeightProblem(weight: float, min_weight: float, max_weight: float) -> Problem:
|
|
26
26
|
return Problem(
|
|
27
27
|
type="invalid_weight",
|
|
28
|
-
message=(f"Molecular weight {weight:.2f} out of range
|
|
28
|
+
message=(f"Molecular weight {weight:.2f} out of range [{min_weight}, {max_weight}]"),
|
|
29
29
|
)
|
|
30
30
|
|
|
31
31
|
|
|
@@ -23,7 +23,7 @@ def call_with_mappings(
|
|
|
23
23
|
# copy config
|
|
24
24
|
config = config.copy()
|
|
25
25
|
|
|
26
|
-
#
|
|
26
|
+
# check what arguments the class or function can take
|
|
27
27
|
spec = inspect.getfullargspec(class_or_function)
|
|
28
28
|
parameter_names = [a for a in spec.args if a != "self"]
|
|
29
29
|
accept_any_args = spec.varargs is not None
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/config/search_yaml_configuration.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/converters/problem_list_converter.py
RENAMED
|
File without changes
|
{nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/converters/representation_converter.py
RENAMED
|
File without changes
|
{nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/converters/source_list_converter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/model/convert_representations_step.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/preprocessing/check_valid_smiles.py
RENAMED
|
File without changes
|
{nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/preprocessing/chembl_structure_pipeline.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/preprocessing/preprocessing_step.py
RENAMED
|
File without changes
|
{nerdd_module-0.3.27 → nerdd_module-0.3.29}/nerdd_module/preprocessing/remove_stereochemistry.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|