nerdd-module 0.2.0__tar.gz → 0.2.1__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.2.0 → nerdd-module-0.2.1}/PKG-INFO +1 -1
- nerdd-module-0.2.1/nerdd_module/__init__.py +10 -0
- nerdd-module-0.2.1/nerdd_module/config/package_configuration.py +31 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/io/depth_first_explorer.py +1 -1
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/io/file_reader.py +12 -3
- nerdd-module-0.2.1/nerdd_module/polyfills/__init__.py +2 -0
- nerdd-module-0.2.1/nerdd_module/polyfills/files.py +8 -0
- nerdd-module-0.2.0/nerdd_module/__init__.py → nerdd-module-0.2.1/nerdd_module/polyfills/get_entry_points.py +3 -10
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module.egg-info/PKG-INFO +1 -1
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module.egg-info/SOURCES.txt +3 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/setup.py +1 -1
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/tests/steps/molecules.py +1 -2
- nerdd-module-0.2.0/nerdd_module/config/package_configuration.py +0 -30
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/LICENSE +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/README.md +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/abstract_model.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/cli.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/config/__init__.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/config/auto_configuration.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/config/configuration.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/config/default_configuration.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/config/dict_configuration.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/config/merged_configuration.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/config/yaml_configuration.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/io/__init__.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/io/csv_writer.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/io/explorer.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/io/gzip_reader.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/io/inchi_reader.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/io/list_reader.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/io/mol_reader.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/io/reader.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/io/reader_registry.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/io/sdf_reader.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/io/sdf_writer.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/io/smiles_reader.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/io/string_reader.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/io/tar_reader.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/io/writer.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/io/writer_registry.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/io/zip_reader.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/preprocessing/__init__.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/preprocessing/check_valid_smiles.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/preprocessing/chembl_structure_pipeline.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/preprocessing/empty_pipeline.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/preprocessing/filter_by_element.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/preprocessing/filter_by_weight.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/preprocessing/pipeline.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/preprocessing/registry.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/preprocessing/remove_stereochemistry.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/preprocessing/step.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/problem.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/version.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module.egg-info/dependency_links.txt +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module.egg-info/requires.txt +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module.egg-info/top_level.txt +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/setup.cfg +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/tests/__init__.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/tests/conftest.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/tests/models/AtomicMassModel.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/tests/models/MolWeightModel.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/tests/models/MolWeightModelWithExplicitMolIds.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/tests/models/MolWeightModelWithExplicitMols.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/tests/models/__init__.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/tests/steps/__init__.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/tests/steps/checks.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/tests/steps/predictors.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/tests/steps/preprocessing.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/tests/test_atom_property_prediction.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/tests/test_molecule_property_prediction.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/tests/test_preprocessing.py +0 -0
- {nerdd-module-0.2.0 → nerdd-module-0.2.1}/tests/test_reading_formats.py +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from ..polyfills import files
|
|
2
|
+
from .configuration import Configuration
|
|
3
|
+
from .dict_configuration import DictConfiguration
|
|
4
|
+
from .yaml_configuration import YamlConfiguration
|
|
5
|
+
|
|
6
|
+
__all__ = ["PackageConfiguration"]
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class PackageConfiguration(Configuration):
|
|
10
|
+
def __init__(self, package):
|
|
11
|
+
super().__init__()
|
|
12
|
+
|
|
13
|
+
# get the resource directory
|
|
14
|
+
try:
|
|
15
|
+
root_dir = files(package)
|
|
16
|
+
except ModuleNotFoundError:
|
|
17
|
+
root_dir = None
|
|
18
|
+
|
|
19
|
+
if root_dir is None:
|
|
20
|
+
self.config = DictConfiguration({})
|
|
21
|
+
else:
|
|
22
|
+
# navigate to the config file
|
|
23
|
+
config_file = root_dir / "nerdd.yml"
|
|
24
|
+
|
|
25
|
+
if config_file is not None and config_file.exists():
|
|
26
|
+
self.config = YamlConfiguration(config_file, base_path=root_dir)
|
|
27
|
+
else:
|
|
28
|
+
self.config = DictConfiguration({})
|
|
29
|
+
|
|
30
|
+
def _get_dict(self):
|
|
31
|
+
return self.config.get_dict()
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import os
|
|
2
|
+
from pathlib import Path
|
|
2
3
|
from typing import Generator
|
|
3
4
|
|
|
4
5
|
from .reader import MoleculeEntry, Reader
|
|
@@ -9,12 +10,20 @@ __all__ = ["FileReader"]
|
|
|
9
10
|
|
|
10
11
|
@register_reader
|
|
11
12
|
class FileReader(Reader):
|
|
12
|
-
def __init__(self):
|
|
13
|
+
def __init__(self, data_dir="."):
|
|
13
14
|
super().__init__()
|
|
15
|
+
self.data_dir = Path(data_dir)
|
|
14
16
|
|
|
15
17
|
def read(self, filename, explore) -> Generator[MoleculeEntry, None, None]:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
assert isinstance(filename, str), "input must be a string"
|
|
19
|
+
|
|
20
|
+
try:
|
|
21
|
+
path = Path(filename).absolute()
|
|
22
|
+
except:
|
|
23
|
+
raise ValueError("input must be a valid path")
|
|
24
|
+
|
|
25
|
+
assert path.is_relative_to(self.data_dir), "input must be a relative path"
|
|
26
|
+
assert path.exists(), "input must be a valid file"
|
|
18
27
|
|
|
19
28
|
with open(filename, "rb") as f:
|
|
20
29
|
for entry in explore(f):
|
|
@@ -1,22 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
from .cli import *
|
|
3
|
-
from .config import *
|
|
4
|
-
from .problem import *
|
|
5
|
-
from .version import *
|
|
1
|
+
__all__ = ["get_entry_points"]
|
|
6
2
|
|
|
7
3
|
# import entry_points from importlib.metadata or fall back to pkg_resources
|
|
4
|
+
# TODO: add importlib_metadata as another option
|
|
8
5
|
try:
|
|
9
6
|
from importlib.metadata import entry_points
|
|
10
7
|
|
|
11
8
|
def get_entry_points(group):
|
|
12
|
-
return entry_points(
|
|
9
|
+
return entry_points(group=group)
|
|
13
10
|
|
|
14
11
|
except ImportError:
|
|
15
12
|
import pkg_resources
|
|
16
13
|
|
|
17
14
|
def get_entry_points(group):
|
|
18
15
|
return pkg_resources.iter_entry_points(group)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
for entry_point in get_entry_points("nerdd-module.plugins"):
|
|
22
|
-
entry_point.load()
|
|
@@ -38,6 +38,9 @@ nerdd_module/io/tar_reader.py
|
|
|
38
38
|
nerdd_module/io/writer.py
|
|
39
39
|
nerdd_module/io/writer_registry.py
|
|
40
40
|
nerdd_module/io/zip_reader.py
|
|
41
|
+
nerdd_module/polyfills/__init__.py
|
|
42
|
+
nerdd_module/polyfills/files.py
|
|
43
|
+
nerdd_module/polyfills/get_entry_points.py
|
|
41
44
|
nerdd_module/preprocessing/__init__.py
|
|
42
45
|
nerdd_module/preprocessing/check_valid_smiles.py
|
|
43
46
|
nerdd_module/preprocessing/chembl_structure_pipeline.py
|
|
@@ -4,8 +4,7 @@ from hypothesis import settings
|
|
|
4
4
|
from hypothesis import strategies as st
|
|
5
5
|
from hypothesis_rdkit import mols
|
|
6
6
|
from pytest_bdd import given, parsers
|
|
7
|
-
from rdkit.Chem import
|
|
8
|
-
from rdkit.Chem.Descriptors import MolWt
|
|
7
|
+
from rdkit.Chem import MolToInchi, MolToMolBlock, MolToSmiles
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
@given(
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
try:
|
|
2
|
-
# works in python 3.9+
|
|
3
|
-
from importlib.resources import files
|
|
4
|
-
except ImportError:
|
|
5
|
-
from importlib_resources import files
|
|
6
|
-
|
|
7
|
-
from .configuration import Configuration
|
|
8
|
-
from .dict_configuration import DictConfiguration
|
|
9
|
-
from .yaml_configuration import YamlConfiguration
|
|
10
|
-
|
|
11
|
-
__all__ = ["PackageConfiguration"]
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class PackageConfiguration(Configuration):
|
|
15
|
-
def __init__(self, package):
|
|
16
|
-
super().__init__()
|
|
17
|
-
|
|
18
|
-
# get the resource directory
|
|
19
|
-
root_dir = files(package)
|
|
20
|
-
|
|
21
|
-
# navigate to the config file
|
|
22
|
-
config_file = root_dir / "nerdd.yml"
|
|
23
|
-
|
|
24
|
-
if config_file is not None and config_file.exists():
|
|
25
|
-
self.config = YamlConfiguration(config_file, base_path=root_dir)
|
|
26
|
-
else:
|
|
27
|
-
self.config = DictConfiguration({})
|
|
28
|
-
|
|
29
|
-
def _get_dict(self):
|
|
30
|
-
return self.config.get_dict()
|
|
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
|
|
File without changes
|
|
File without changes
|
{nerdd-module-0.2.0 → nerdd-module-0.2.1}/nerdd_module/preprocessing/chembl_structure_pipeline.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nerdd-module-0.2.0 → nerdd-module-0.2.1}/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
|