nerdd-module 0.3.52__tar.gz → 0.3.54__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.52 → nerdd_module-0.3.54}/PKG-INFO +1 -1
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/cli.py +4 -5
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/config/merged_configuration.py +16 -10
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/model/prediction_step.py +3 -1
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module.egg-info/PKG-INFO +1 -1
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/pyproject.toml +3 -1
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/LICENSE +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/README.md +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/__init__.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/config/__init__.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/config/configuration.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/config/default_configuration.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/config/dict_configuration.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/config/models.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/config/package_configuration.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/config/search_yaml_configuration.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/config/yaml_configuration.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/converters/__init__.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/converters/basic_type_converter.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/converters/converter.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/converters/converter_config.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/converters/mol_converter.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/converters/problem_list_converter.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/converters/representation_converter.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/converters/source_list_converter.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/converters/void_converter.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/input/__init__.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/input/depth_first_explorer.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/input/explorer.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/input/file_reader.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/input/gzip_reader.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/input/inchi_reader.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/input/list_reader.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/input/mol_reader.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/input/reader.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/input/reader_config.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/input/sdf_reader.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/input/smiles_reader.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/input/stream_reader.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/input/string_reader.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/input/tar_reader.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/input/zip_reader.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/model/__init__.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/model/assign_name_step.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/model/convert_representations_step.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/model/enforce_schema_step.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/model/model.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/model/read_input_step.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/model/write_output_step.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/output/__init__.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/output/csv_writer.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/output/file_writer.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/output/iterator_writer.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/output/pandas_writer.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/output/record_list_writer.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/output/sdf_writer.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/output/writer.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/output/writer_config.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/polyfills/__init__.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/polyfills/block_logs.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/polyfills/files.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/polyfills/get_entry_points.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/polyfills/literal.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/polyfills/typed_dict.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/polyfills/types.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/polyfills/version.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/preprocessing/__init__.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/preprocessing/check_valid_smiles.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/preprocessing/chembl_structure_pipeline.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/preprocessing/filter_by_element.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/preprocessing/filter_by_weight.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/preprocessing/preprocessing_step.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/preprocessing/remove_hydrogens.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/preprocessing/remove_small_fragments.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/preprocessing/remove_stereochemistry.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/preprocessing/sanitize.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/problem.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/py.typed +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/steps/__init__.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/steps/map_step.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/steps/output_step.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/steps/step.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/tests/__init__.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/tests/checks.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/tests/files.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/tests/models/AtomicMassModel.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/tests/models/MolWeightModel.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/tests/models/__init__.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/tests/predictions.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/tests/preprocessing/DummyPreprocessingStep.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/tests/preprocessing/__init__.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/tests/representations.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/util/__init__.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/util/call_with_mappings.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/util/package.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/version.py +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module.egg-info/SOURCES.txt +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module.egg-info/dependency_links.txt +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module.egg-info/requires.txt +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module.egg-info/top_level.txt +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/setup.cfg +0 -0
- {nerdd_module-0.3.52 → nerdd_module-0.3.54}/tests/test_features.py +0 -0
|
@@ -30,7 +30,7 @@ def infer_click_type(param: JobParameter) -> click.ParamType:
|
|
|
30
30
|
choices = [str(c.value) for c in param.choices]
|
|
31
31
|
return click.Choice(choices)
|
|
32
32
|
|
|
33
|
-
type_map = {
|
|
33
|
+
type_map: dict[str, click.ParamType] = {
|
|
34
34
|
"float": click.FLOAT,
|
|
35
35
|
"integer": click.INT,
|
|
36
36
|
"string": click.STRING,
|
|
@@ -67,10 +67,9 @@ def auto_cli(f: Callable[..., Model], *args: Any, **kwargs: Any) -> None:
|
|
|
67
67
|
|
|
68
68
|
# compose footer with examples
|
|
69
69
|
examples = []
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
examples.append(example_smiles)
|
|
70
|
+
example_smiles = model.config.example_smiles
|
|
71
|
+
if example_smiles is not None:
|
|
72
|
+
examples.append(example_smiles)
|
|
74
73
|
|
|
75
74
|
for ReaderClass in Reader.get_reader_mapping():
|
|
76
75
|
if hasattr(ReaderClass, "config"):
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from collections import Counter
|
|
2
|
+
from typing import Any
|
|
2
3
|
|
|
3
4
|
from .configuration import Configuration
|
|
4
5
|
from .dict_configuration import DictConfiguration
|
|
@@ -6,27 +7,32 @@ from .dict_configuration import DictConfiguration
|
|
|
6
7
|
__all__ = ["MergedConfiguration"]
|
|
7
8
|
|
|
8
9
|
|
|
9
|
-
def merge(*args:
|
|
10
|
+
def merge(*args: Any) -> Any:
|
|
10
11
|
assert len(args) > 0
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
if all(arg is None for arg in args):
|
|
14
|
+
return None
|
|
14
15
|
|
|
15
|
-
if
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
valid_args = [arg for arg in args if arg is not None]
|
|
17
|
+
|
|
18
|
+
first_valid_entry = valid_args[0]
|
|
19
|
+
assert all(isinstance(d, type(first_valid_entry)) for d in valid_args)
|
|
20
|
+
|
|
21
|
+
if isinstance(first_valid_entry, list):
|
|
22
|
+
return [e for d in valid_args for e in d]
|
|
23
|
+
if isinstance(first_valid_entry, dict):
|
|
24
|
+
count_fields = Counter([k for d in valid_args for k in d.keys()])
|
|
19
25
|
|
|
20
26
|
# merge fields that occur in multiple dicts
|
|
21
27
|
overlapping_fields = [k for k, v in count_fields.items() if v > 1]
|
|
22
28
|
merged_overlapping_fields = {
|
|
23
|
-
k: merge(*[d[k] for d in
|
|
29
|
+
k: merge(*[d[k] for d in valid_args if k in d]) for k in overlapping_fields
|
|
24
30
|
}
|
|
25
31
|
|
|
26
32
|
# collect fields that occur in only one dict
|
|
27
33
|
non_overlapping_fields = [k for k, v in count_fields.items() if v == 1]
|
|
28
34
|
merged_non_overlapping_fields = {
|
|
29
|
-
k: v for d in
|
|
35
|
+
k: v for d in valid_args for k, v in d.items() if k in non_overlapping_fields
|
|
30
36
|
}
|
|
31
37
|
|
|
32
38
|
return {
|
|
@@ -36,7 +42,7 @@ def merge(*args: dict) -> dict:
|
|
|
36
42
|
else:
|
|
37
43
|
# merge all configurations starting from the first one
|
|
38
44
|
# --> last configuration has the highest priority
|
|
39
|
-
return
|
|
45
|
+
return valid_args[-1]
|
|
40
46
|
|
|
41
47
|
|
|
42
48
|
class MergedConfiguration(DictConfiguration):
|
|
@@ -94,7 +94,9 @@ class PredictionStep(Step):
|
|
|
94
94
|
# 3. the list of predictions has as many records as the batch (and we assume
|
|
95
95
|
# that the order of the molecules stayed the same)
|
|
96
96
|
if all("mol_id" in record for record in predictions):
|
|
97
|
-
|
|
97
|
+
# convert mol_id to int (or raise an error if it is not possible)
|
|
98
|
+
for record in predictions:
|
|
99
|
+
record["mol_id"] = int(record["mol_id"])
|
|
98
100
|
elif all("mol" in record for record in predictions):
|
|
99
101
|
# check that molecule names contain only valid ids
|
|
100
102
|
for record in predictions:
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "nerdd-module"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.54"
|
|
8
8
|
description = "Base package to create NERDD modules"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "BSD-3-Clause"
|
|
@@ -88,6 +88,8 @@ Repository = "https://github.com/molinfo-vienna/nerdd-module"
|
|
|
88
88
|
#
|
|
89
89
|
# TOOLS
|
|
90
90
|
#
|
|
91
|
+
|
|
92
|
+
|
|
91
93
|
[tool.setuptools.packages.find]
|
|
92
94
|
where = ["."]
|
|
93
95
|
include = ["nerdd_module*"]
|
|
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.52 → nerdd_module-0.3.54}/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.52 → nerdd_module-0.3.54}/nerdd_module/converters/problem_list_converter.py
RENAMED
|
File without changes
|
{nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/converters/representation_converter.py
RENAMED
|
File without changes
|
{nerdd_module-0.3.52 → nerdd_module-0.3.54}/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
|
|
File without changes
|
{nerdd_module-0.3.52 → nerdd_module-0.3.54}/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
|
|
File without changes
|
|
File without changes
|
{nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/preprocessing/check_valid_smiles.py
RENAMED
|
File without changes
|
{nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/preprocessing/chembl_structure_pipeline.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/preprocessing/preprocessing_step.py
RENAMED
|
File without changes
|
|
File without changes
|
{nerdd_module-0.3.52 → nerdd_module-0.3.54}/nerdd_module/preprocessing/remove_small_fragments.py
RENAMED
|
File without changes
|
{nerdd_module-0.3.52 → nerdd_module-0.3.54}/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
|
|
File without changes
|
|
File without changes
|