nerdd-module 0.3.16__tar.gz → 0.3.17__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.16 → nerdd_module-0.3.17}/PKG-INFO +1 -1
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/config/models.py +16 -2
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/converters/__init__.py +0 -1
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module.egg-info/PKG-INFO +1 -1
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module.egg-info/SOURCES.txt +0 -1
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/pyproject.toml +1 -1
- nerdd_module-0.3.16/nerdd_module/converters/mol_to_image_converter.py +0 -62
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/LICENSE +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/README.md +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/__init__.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/cli.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/config/__init__.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/config/configuration.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/config/default_configuration.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/config/dict_configuration.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/config/merged_configuration.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/config/package_configuration.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/config/search_yaml_configuration.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/config/yaml_configuration.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/converters/basic_type_converter.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/converters/converter.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/converters/converter_config.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/converters/mol_converter.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/converters/problem_list_converter.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/converters/representation_converter.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/converters/void_converter.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/input/__init__.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/input/depth_first_explorer.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/input/explorer.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/input/file_reader.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/input/gzip_reader.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/input/inchi_reader.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/input/list_reader.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/input/mol_reader.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/input/reader.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/input/reader_config.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/input/sdf_reader.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/input/smiles_reader.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/input/string_reader.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/input/tar_reader.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/input/zip_reader.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/model/__init__.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/model/assign_mol_id_step.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/model/assign_name_step.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/model/convert_representations_step.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/model/enforce_schema_step.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/model/model.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/model/read_input_step.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/model/simple_model.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/model/write_output_step.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/output/__init__.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/output/csv_writer.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/output/file_writer.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/output/iterator_writer.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/output/pandas_writer.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/output/record_list_writer.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/output/sdf_writer.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/output/writer.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/polyfills/__init__.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/polyfills/block_logs.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/polyfills/files.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/polyfills/get_entry_points.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/polyfills/literal.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/polyfills/typed_dict.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/polyfills/types.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/polyfills/version.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/preprocessing/__init__.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/preprocessing/check_valid_smiles.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/preprocessing/chembl_structure_pipeline.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/preprocessing/filter_by_element.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/preprocessing/filter_by_weight.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/preprocessing/preprocessing_step.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/preprocessing/remove_stereochemistry.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/preprocessing/sanitize.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/problem.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/py.typed +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/steps/__init__.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/steps/map_step.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/steps/output_step.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/steps/step.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/tests/__init__.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/tests/checks.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/tests/files.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/tests/models/AtomicMassModel.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/tests/models/MolWeightModel.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/tests/models/__init__.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/tests/predictions.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/tests/preprocessing/DummyPreprocessingStep.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/tests/preprocessing/__init__.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/tests/representations.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/util/__init__.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/util/call_with_mappings.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/util/package.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/version.py +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module.egg-info/dependency_links.txt +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module.egg-info/requires.txt +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module.egg-info/top_level.txt +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/setup.cfg +0 -0
- {nerdd_module-0.3.16 → nerdd_module-0.3.17}/tests/test_features.py +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from typing import Any, List, Optional, Union
|
|
2
2
|
|
|
3
|
-
from pydantic import BaseModel, model_validator
|
|
3
|
+
from pydantic import BaseModel, computed_field, model_validator
|
|
4
|
+
from stringcase import spinalcase
|
|
4
5
|
|
|
5
6
|
from ..polyfills import Literal
|
|
6
7
|
|
|
@@ -98,9 +99,22 @@ class ResultProperty(BaseModel):
|
|
|
98
99
|
|
|
99
100
|
|
|
100
101
|
class Module(BaseModel):
|
|
102
|
+
@computed_field # type: ignore[prop-decorator]
|
|
103
|
+
@property
|
|
104
|
+
def id(self) -> str:
|
|
105
|
+
# TODO: incorporate versioning
|
|
106
|
+
# compute the primary key from name and version
|
|
107
|
+
# if "version" in module.keys():
|
|
108
|
+
# version = module["version"]
|
|
109
|
+
# else:
|
|
110
|
+
# version = "1.0.0"
|
|
111
|
+
# name = module["name"]
|
|
112
|
+
|
|
113
|
+
return spinalcase(self.name)
|
|
114
|
+
|
|
101
115
|
task: Optional[Task] = None
|
|
102
116
|
rank: Optional[int] = None
|
|
103
|
-
name:
|
|
117
|
+
name: str
|
|
104
118
|
batch_size: int = 100
|
|
105
119
|
version: Optional[str] = None
|
|
106
120
|
visible_name: Optional[str] = None
|
|
@@ -2,7 +2,6 @@ from .basic_type_converter import *
|
|
|
2
2
|
from .converter import *
|
|
3
3
|
from .converter_config import *
|
|
4
4
|
from .mol_converter import *
|
|
5
|
-
from .mol_to_image_converter import *
|
|
6
5
|
from .problem_list_converter import *
|
|
7
6
|
from .representation_converter import *
|
|
8
7
|
from .void_converter import *
|
|
@@ -25,7 +25,6 @@ nerdd_module/converters/basic_type_converter.py
|
|
|
25
25
|
nerdd_module/converters/converter.py
|
|
26
26
|
nerdd_module/converters/converter_config.py
|
|
27
27
|
nerdd_module/converters/mol_converter.py
|
|
28
|
-
nerdd_module/converters/mol_to_image_converter.py
|
|
29
28
|
nerdd_module/converters/problem_list_converter.py
|
|
30
29
|
nerdd_module/converters/representation_converter.py
|
|
31
30
|
nerdd_module/converters/void_converter.py
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
from typing import Any
|
|
2
|
-
from xml.dom import minidom
|
|
3
|
-
|
|
4
|
-
from rdkit.Chem import Mol
|
|
5
|
-
from rdkit.Chem.Draw import MolDraw2DSVG
|
|
6
|
-
|
|
7
|
-
from .converter import Converter
|
|
8
|
-
from .converter_config import ConverterConfig
|
|
9
|
-
|
|
10
|
-
__all__ = ["MolToImageConverter"]
|
|
11
|
-
|
|
12
|
-
default_width = 300
|
|
13
|
-
default_height = 180
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
class MolToImageConverter(Converter):
|
|
17
|
-
def _convert(self, input: Any, context: dict) -> Any:
|
|
18
|
-
width = self.result_property.image_width
|
|
19
|
-
height = self.result_property.image_height
|
|
20
|
-
|
|
21
|
-
if width is None:
|
|
22
|
-
width = default_width
|
|
23
|
-
if height is None:
|
|
24
|
-
height = default_height
|
|
25
|
-
|
|
26
|
-
mol = input
|
|
27
|
-
if mol is None:
|
|
28
|
-
return None
|
|
29
|
-
|
|
30
|
-
assert isinstance(mol, Mol), f"Expected RDKit Mol object, but got {type(mol)}"
|
|
31
|
-
|
|
32
|
-
svg = MolDraw2DSVG(width, height)
|
|
33
|
-
|
|
34
|
-
# remove background
|
|
35
|
-
opts = svg.drawOptions()
|
|
36
|
-
opts.clearBackground = False
|
|
37
|
-
|
|
38
|
-
# add highlight circles around atoms during drawing
|
|
39
|
-
# (we will remove them later in post processing)
|
|
40
|
-
atoms = range(mol.GetNumAtoms())
|
|
41
|
-
colors = [[(0.8, 1, 1)]] * mol.GetNumAtoms()
|
|
42
|
-
radii = [0.5] * mol.GetNumAtoms()
|
|
43
|
-
atom_highlight = dict(zip(atoms, colors))
|
|
44
|
-
atom_radii = dict(zip(atoms, radii))
|
|
45
|
-
svg.DrawMoleculeWithHighlights(mol, "", atom_highlight, {}, atom_radii, [])
|
|
46
|
-
svg.FinishDrawing()
|
|
47
|
-
|
|
48
|
-
# post process SVG
|
|
49
|
-
xml = svg.GetDrawingText()
|
|
50
|
-
tree = minidom.parseString(xml)
|
|
51
|
-
root = tree.getElementsByTagName("svg")[0]
|
|
52
|
-
|
|
53
|
-
# make highlight circles invisible
|
|
54
|
-
for ellipse in root.getElementsByTagName("ellipse"):
|
|
55
|
-
ellipse.setAttribute("style", "opacity:0")
|
|
56
|
-
|
|
57
|
-
xml = tree.toxml()
|
|
58
|
-
|
|
59
|
-
return xml
|
|
60
|
-
|
|
61
|
-
# TODO: move to nerdd-link
|
|
62
|
-
config = ConverterConfig(data_types="mol", output_formats="json")
|
|
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.16 → nerdd_module-0.3.17}/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
|
{nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/converters/problem_list_converter.py
RENAMED
|
File without changes
|
{nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/converters/representation_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.16 → nerdd_module-0.3.17}/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.16 → nerdd_module-0.3.17}/nerdd_module/preprocessing/check_valid_smiles.py
RENAMED
|
File without changes
|
{nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/preprocessing/chembl_structure_pipeline.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nerdd_module-0.3.16 → nerdd_module-0.3.17}/nerdd_module/preprocessing/preprocessing_step.py
RENAMED
|
File without changes
|
{nerdd_module-0.3.16 → nerdd_module-0.3.17}/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
|