nerdd-module 0.3.48__tar.gz → 0.3.49__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.48 → nerdd_module-0.3.49}/PKG-INFO +1 -1
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/input/stream_reader.py +16 -11
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/input/tar_reader.py +9 -2
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/input/zip_reader.py +10 -2
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module.egg-info/PKG-INFO +1 -1
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/pyproject.toml +1 -1
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/LICENSE +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/README.md +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/__init__.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/cli.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/config/__init__.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/config/configuration.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/config/default_configuration.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/config/dict_configuration.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/config/merged_configuration.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/config/models.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/config/package_configuration.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/config/search_yaml_configuration.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/config/yaml_configuration.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/converters/__init__.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/converters/basic_type_converter.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/converters/converter.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/converters/converter_config.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/converters/mol_converter.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/converters/problem_list_converter.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/converters/representation_converter.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/converters/source_list_converter.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/converters/void_converter.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/input/__init__.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/input/depth_first_explorer.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/input/explorer.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/input/file_reader.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/input/gzip_reader.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/input/inchi_reader.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/input/list_reader.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/input/mol_reader.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/input/reader.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/input/reader_config.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/input/sdf_reader.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/input/smiles_reader.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/input/string_reader.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/model/__init__.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/model/assign_name_step.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/model/convert_representations_step.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/model/enforce_schema_step.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/model/model.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/model/prediction_step.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/model/read_input_step.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/model/write_output_step.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/output/__init__.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/output/csv_writer.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/output/file_writer.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/output/iterator_writer.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/output/pandas_writer.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/output/record_list_writer.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/output/sdf_writer.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/output/writer.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/output/writer_config.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/polyfills/__init__.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/polyfills/block_logs.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/polyfills/files.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/polyfills/get_entry_points.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/polyfills/literal.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/polyfills/typed_dict.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/polyfills/types.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/polyfills/version.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/preprocessing/__init__.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/preprocessing/check_valid_smiles.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/preprocessing/chembl_structure_pipeline.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/preprocessing/filter_by_element.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/preprocessing/filter_by_weight.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/preprocessing/preprocessing_step.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/preprocessing/remove_small_fragments.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/preprocessing/remove_stereochemistry.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/preprocessing/sanitize.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/problem.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/py.typed +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/steps/__init__.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/steps/map_step.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/steps/output_step.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/steps/step.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/tests/__init__.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/tests/checks.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/tests/files.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/tests/models/AtomicMassModel.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/tests/models/MolWeightModel.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/tests/models/__init__.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/tests/predictions.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/tests/preprocessing/DummyPreprocessingStep.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/tests/preprocessing/__init__.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/tests/representations.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/util/__init__.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/util/call_with_mappings.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/util/package.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/version.py +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module.egg-info/SOURCES.txt +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module.egg-info/dependency_links.txt +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module.egg-info/requires.txt +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module.egg-info/top_level.txt +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/setup.cfg +0 -0
- {nerdd_module-0.3.48 → nerdd_module-0.3.49}/tests/test_features.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from abc import abstractmethod
|
|
2
2
|
from codecs import getreader
|
|
3
|
-
from typing import Any, Iterator
|
|
3
|
+
from typing import Any, Iterator, Optional
|
|
4
4
|
|
|
5
5
|
import chardet
|
|
6
6
|
|
|
@@ -10,8 +10,9 @@ __all__ = ["StreamReader"]
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class StreamReader(Reader):
|
|
13
|
-
def __init__(self) -> None:
|
|
13
|
+
def __init__(self, encoding: Optional[str] = "utf-8-sig") -> None:
|
|
14
14
|
super().__init__()
|
|
15
|
+
self.encoding = encoding
|
|
15
16
|
|
|
16
17
|
def read(self, input_stream: Any, explore: ExploreCallable) -> Iterator[MoleculeEntry]:
|
|
17
18
|
if not hasattr(input_stream, "read") or not hasattr(input_stream, "seek"):
|
|
@@ -20,24 +21,28 @@ class StreamReader(Reader):
|
|
|
20
21
|
input_stream.seek(0)
|
|
21
22
|
|
|
22
23
|
#
|
|
23
|
-
# detect file encoding
|
|
24
|
+
# detect file encoding (if not provided)
|
|
24
25
|
#
|
|
25
26
|
|
|
26
27
|
# read a portion of the file's content
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
if self.encoding is None:
|
|
29
|
+
sample = input_stream.read(1_000_000)
|
|
30
|
+
result = chardet.detect(sample)
|
|
31
|
+
if result["confidence"] > 0.5 and result["encoding"] is not None:
|
|
32
|
+
encoding = result["encoding"]
|
|
33
|
+
else:
|
|
34
|
+
encoding = "utf-8-sig"
|
|
35
|
+
|
|
36
|
+
input_stream.seek(0)
|
|
31
37
|
else:
|
|
32
|
-
encoding =
|
|
33
|
-
|
|
34
|
-
input_stream.seek(0)
|
|
38
|
+
encoding = self.encoding
|
|
35
39
|
|
|
36
40
|
#
|
|
37
41
|
# read file
|
|
38
42
|
#
|
|
39
43
|
StreamReader = getreader(encoding)
|
|
40
|
-
|
|
44
|
+
# errors="replace": replace invalid characters instead of failing
|
|
45
|
+
reader = StreamReader(input_stream, "replace")
|
|
41
46
|
return self._read_stream(reader, explore)
|
|
42
47
|
|
|
43
48
|
@abstractmethod
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import tarfile
|
|
2
|
-
from typing import Any, Iterator
|
|
2
|
+
from typing import Any, Iterator, Tuple
|
|
3
3
|
|
|
4
4
|
from .reader import ExploreCallable, MoleculeEntry, Reader
|
|
5
5
|
|
|
@@ -21,7 +21,14 @@ class TarReader(Reader):
|
|
|
21
21
|
if not member.isfile():
|
|
22
22
|
continue
|
|
23
23
|
for entry in explore(tar.extractfile(member)):
|
|
24
|
-
|
|
24
|
+
# the underlying reader only sees the file content as a stream
|
|
25
|
+
# -> it might believe that the source is "raw_input"
|
|
26
|
+
# -> we need to correct that here
|
|
27
|
+
if len(entry.source) == 1 and entry.source[0] == "raw_input":
|
|
28
|
+
source: Tuple[str, ...] = tuple()
|
|
29
|
+
else:
|
|
30
|
+
source = entry.source
|
|
31
|
+
yield entry._replace(source=(member.name, *source))
|
|
25
32
|
|
|
26
33
|
def __repr__(self) -> str:
|
|
27
34
|
return "TarReader()"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import zipfile
|
|
2
|
-
from typing import Any, Iterator
|
|
2
|
+
from typing import Any, Iterator, Tuple
|
|
3
3
|
|
|
4
4
|
from .reader import ExploreCallable, MoleculeEntry, Reader
|
|
5
5
|
|
|
@@ -23,7 +23,15 @@ class ZipReader(Reader):
|
|
|
23
23
|
continue
|
|
24
24
|
with zipf.open(member, "r") as f:
|
|
25
25
|
for entry in explore(f):
|
|
26
|
-
|
|
26
|
+
# the underlying reader only sees the file content as a stream
|
|
27
|
+
# -> it might believe that the source is "raw_input"
|
|
28
|
+
# -> we need to correct that here
|
|
29
|
+
if len(entry.source) == 1 and entry.source[0] == "raw_input":
|
|
30
|
+
source: Tuple[str, ...] = tuple()
|
|
31
|
+
else:
|
|
32
|
+
source = entry.source
|
|
33
|
+
|
|
34
|
+
yield entry._replace(source=(member, *source))
|
|
27
35
|
|
|
28
36
|
def __repr__(self) -> str:
|
|
29
37
|
return "ZipReader()"
|
|
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.48 → nerdd_module-0.3.49}/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.48 → nerdd_module-0.3.49}/nerdd_module/converters/problem_list_converter.py
RENAMED
|
File without changes
|
{nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/converters/representation_converter.py
RENAMED
|
File without changes
|
{nerdd_module-0.3.48 → nerdd_module-0.3.49}/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
|
{nerdd_module-0.3.48 → nerdd_module-0.3.49}/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
|
|
File without changes
|
{nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/preprocessing/check_valid_smiles.py
RENAMED
|
File without changes
|
{nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/preprocessing/chembl_structure_pipeline.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/preprocessing/preprocessing_step.py
RENAMED
|
File without changes
|
{nerdd_module-0.3.48 → nerdd_module-0.3.49}/nerdd_module/preprocessing/remove_small_fragments.py
RENAMED
|
File without changes
|
{nerdd_module-0.3.48 → nerdd_module-0.3.49}/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
|