nerdd-module 0.3.21__tar.gz → 0.3.22__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.21 → nerdd_module-0.3.22}/PKG-INFO +1 -1
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/config/package_configuration.py +11 -15
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/config/search_yaml_configuration.py +5 -3
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/model/simple_model.py +27 -22
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module.egg-info/PKG-INFO +1 -1
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/pyproject.toml +1 -1
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/LICENSE +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/README.md +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/__init__.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/cli.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/config/__init__.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/config/configuration.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/config/default_configuration.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/config/dict_configuration.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/config/merged_configuration.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/config/models.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/config/yaml_configuration.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/converters/__init__.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/converters/basic_type_converter.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/converters/converter.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/converters/converter_config.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/converters/mol_converter.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/converters/problem_list_converter.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/converters/representation_converter.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/converters/source_list_converter.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/converters/void_converter.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/input/__init__.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/input/depth_first_explorer.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/input/explorer.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/input/file_reader.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/input/gzip_reader.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/input/inchi_reader.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/input/list_reader.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/input/mol_reader.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/input/reader.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/input/reader_config.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/input/sdf_reader.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/input/smiles_reader.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/input/string_reader.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/input/tar_reader.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/input/zip_reader.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/model/__init__.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/model/assign_mol_id_step.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/model/assign_name_step.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/model/convert_representations_step.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/model/enforce_schema_step.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/model/model.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/model/read_input_step.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/model/write_output_step.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/output/__init__.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/output/csv_writer.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/output/file_writer.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/output/iterator_writer.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/output/pandas_writer.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/output/record_list_writer.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/output/sdf_writer.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/output/writer.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/polyfills/__init__.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/polyfills/block_logs.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/polyfills/files.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/polyfills/get_entry_points.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/polyfills/literal.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/polyfills/typed_dict.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/polyfills/types.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/polyfills/version.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/preprocessing/__init__.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/preprocessing/check_valid_smiles.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/preprocessing/chembl_structure_pipeline.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/preprocessing/filter_by_element.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/preprocessing/filter_by_weight.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/preprocessing/preprocessing_step.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/preprocessing/remove_stereochemistry.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/preprocessing/sanitize.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/problem.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/py.typed +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/steps/__init__.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/steps/map_step.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/steps/output_step.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/steps/step.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/tests/__init__.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/tests/checks.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/tests/files.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/tests/models/AtomicMassModel.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/tests/models/MolWeightModel.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/tests/models/__init__.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/tests/predictions.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/tests/preprocessing/DummyPreprocessingStep.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/tests/preprocessing/__init__.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/tests/representations.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/util/__init__.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/util/call_with_mappings.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/util/package.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/version.py +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module.egg-info/SOURCES.txt +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module.egg-info/dependency_links.txt +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module.egg-info/requires.txt +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module.egg-info/top_level.txt +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/setup.cfg +0 -0
- {nerdd_module-0.3.21 → nerdd_module-0.3.22}/tests/test_features.py +0 -0
|
@@ -19,23 +19,19 @@ class PackageConfiguration(Configuration):
|
|
|
19
19
|
remaining_path = package_path[1:]
|
|
20
20
|
|
|
21
21
|
# get the resource directory
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
except ModuleNotFoundError:
|
|
25
|
-
root_dir = None
|
|
22
|
+
root_dir = files(package_root)
|
|
23
|
+
assert root_dir is not None
|
|
26
24
|
|
|
27
25
|
self.config: Configuration = DictConfiguration({})
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
else:
|
|
38
|
-
self.config = DictConfiguration({})
|
|
26
|
+
|
|
27
|
+
# navigate to the config file
|
|
28
|
+
config_file = root_dir.joinpath(*remaining_path, filename)
|
|
29
|
+
assert config_file is not None and config_file.is_file()
|
|
30
|
+
|
|
31
|
+
logger.info(f"Found configuration file in package: {config_file}")
|
|
32
|
+
self.config = YamlConfiguration(
|
|
33
|
+
config_file.open(), base_path=root_dir.joinpath(*remaining_path)
|
|
34
|
+
)
|
|
39
35
|
|
|
40
36
|
def _get_dict(self) -> dict:
|
|
41
37
|
return self.config._get_dict()
|
{nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/config/search_yaml_configuration.py
RENAMED
|
@@ -12,7 +12,9 @@ logger = logging.getLogger(__name__)
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
class SearchYamlConfiguration(DictConfiguration):
|
|
15
|
-
def __init__(
|
|
15
|
+
def __init__(
|
|
16
|
+
self, start: str, base_path: Optional[str] = None, filename: str = "nerdd.yml"
|
|
17
|
+
) -> None:
|
|
16
18
|
# provide a default configuration if no configuration file is found
|
|
17
19
|
config: Configuration = DictConfiguration({})
|
|
18
20
|
|
|
@@ -22,8 +24,8 @@ class SearchYamlConfiguration(DictConfiguration):
|
|
|
22
24
|
# reached)
|
|
23
25
|
leaf = start
|
|
24
26
|
while True:
|
|
25
|
-
if os.path.isfile(os.path.join(leaf,
|
|
26
|
-
default_config_file = os.path.join(leaf,
|
|
27
|
+
if os.path.isfile(os.path.join(leaf, filename)):
|
|
28
|
+
default_config_file = os.path.join(leaf, filename)
|
|
27
29
|
break
|
|
28
30
|
elif leaf == os.path.dirname(leaf): # reached root
|
|
29
31
|
default_config_file = None
|
|
@@ -32,10 +32,9 @@ __all__ = ["SimpleModel"]
|
|
|
32
32
|
class SimpleModel(Model):
|
|
33
33
|
def __init__(self, preprocessing_steps: Iterable[Step] = []) -> None:
|
|
34
34
|
super().__init__()
|
|
35
|
-
assert isinstance(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
)
|
|
35
|
+
assert isinstance(
|
|
36
|
+
preprocessing_steps, Iterable
|
|
37
|
+
), f"Expected Iterable for argument preprocessing_steps, got {type(preprocessing_steps)}"
|
|
39
38
|
assert all(isinstance(step, Step) for step in preprocessing_steps), (
|
|
40
39
|
f"Expected all elements of preprocessing_steps to be of type Step, "
|
|
41
40
|
f"got {[type(step) for step in preprocessing_steps if not isinstance(step, Step)]}"
|
|
@@ -79,14 +78,6 @@ class SimpleModel(Model):
|
|
|
79
78
|
pass
|
|
80
79
|
|
|
81
80
|
def _get_base_config(self) -> Union[Configuration, dict]:
|
|
82
|
-
return {}
|
|
83
|
-
|
|
84
|
-
def _get_config(self) -> Configuration:
|
|
85
|
-
# get base configuration specified in this class
|
|
86
|
-
base_config = self._get_base_config()
|
|
87
|
-
if isinstance(base_config, dict):
|
|
88
|
-
base_config = DictConfiguration(base_config)
|
|
89
|
-
|
|
90
81
|
# get the class of the nerdd module, e.g. <CypstrateModel>
|
|
91
82
|
nerdd_module_class = self.__class__
|
|
92
83
|
|
|
@@ -97,17 +88,30 @@ class SimpleModel(Model):
|
|
|
97
88
|
# get the root module name, e.g. "cypstrate"
|
|
98
89
|
root_module = python_module.split(".")[0]
|
|
99
90
|
|
|
100
|
-
configs = [
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
91
|
+
configs: List[Configuration] = []
|
|
92
|
+
|
|
93
|
+
try:
|
|
94
|
+
configs.append( # TODO: remove "."
|
|
95
|
+
SearchYamlConfiguration(get_file_path_to_instance(self) or ".")
|
|
96
|
+
)
|
|
97
|
+
except Exception:
|
|
98
|
+
pass
|
|
99
|
+
|
|
100
|
+
try:
|
|
101
|
+
configs.append(PackageConfiguration(f"{root_module}.data", filename="nerdd.yml"))
|
|
102
|
+
except Exception:
|
|
103
|
+
pass
|
|
104
|
+
|
|
105
|
+
return MergedConfiguration(*configs)
|
|
106
|
+
|
|
107
|
+
def _get_config(self) -> Configuration:
|
|
108
|
+
# get base configuration specified in this class
|
|
109
|
+
base_config = self._get_base_config()
|
|
110
|
+
if isinstance(base_config, dict):
|
|
111
|
+
base_config = DictConfiguration(base_config)
|
|
108
112
|
|
|
109
113
|
# add default properties mol_id, raw_input, etc.
|
|
110
|
-
task =
|
|
114
|
+
task = base_config.get_dict().task
|
|
111
115
|
|
|
112
116
|
# check whether we need to add to add a property "atom_id" or "derivative_id"
|
|
113
117
|
task_based_property = []
|
|
@@ -179,8 +183,9 @@ class SimpleModel(Model):
|
|
|
179
183
|
]
|
|
180
184
|
|
|
181
185
|
configs = [
|
|
186
|
+
DefaultConfiguration(self),
|
|
182
187
|
DictConfiguration({"result_properties": default_properties_start}),
|
|
183
|
-
|
|
188
|
+
base_config,
|
|
184
189
|
DictConfiguration({"result_properties": default_properties_end}),
|
|
185
190
|
]
|
|
186
191
|
|
|
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.21 → nerdd_module-0.3.22}/nerdd_module/converters/problem_list_converter.py
RENAMED
|
File without changes
|
{nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/converters/representation_converter.py
RENAMED
|
File without changes
|
{nerdd_module-0.3.21 → nerdd_module-0.3.22}/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.21 → nerdd_module-0.3.22}/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
|
{nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/preprocessing/check_valid_smiles.py
RENAMED
|
File without changes
|
{nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/preprocessing/chembl_structure_pipeline.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nerdd_module-0.3.21 → nerdd_module-0.3.22}/nerdd_module/preprocessing/preprocessing_step.py
RENAMED
|
File without changes
|
{nerdd_module-0.3.21 → nerdd_module-0.3.22}/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
|