Skip to content

Commit 8d99085

Browse files
code review comments
1 parent a4baf7d commit 8d99085

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

molpipeline/mol2any/mol2concatinated_vector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ def assemble_output(
315315
"""
316316
values = list(value_list)
317317
if len(values) == 0:
318-
return np.empty((0, 0), dtype=np.float64)
318+
return np.empty((0, self.n_features), dtype=np.float64)
319319
return np.vstack(values)
320320

321321
def transform(self, values: list[RDKitMol]) -> npt.NDArray[np.float64]:

tests/test_elements/test_mol2any/test_mol2concatenated.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
from sklearn.preprocessing import StandardScaler
1212

1313
from molpipeline import ErrorFilter, Pipeline
14-
15-
if TYPE_CHECKING:
16-
from molpipeline.abstract_pipeline_elements.core import MolToAnyPipelineElement
1714
from molpipeline.any2mol import SmilesToMol
1815
from molpipeline.mol2any import (
1916
Mol2PathFP,
@@ -26,6 +23,9 @@
2623
from tests.utils.fingerprints import fingerprints_to_numpy
2724
from tests.utils.logging import capture_logs
2825

26+
if TYPE_CHECKING:
27+
from molpipeline.abstract_pipeline_elements.core import MolToAnyPipelineElement
28+
2929

3030
class TestConcatenatedFingerprint(unittest.TestCase):
3131
"""Unittest for MolToConcatenatedVector."""

tests/test_elements/test_mol2any/test_mol2rdkit_phys_chem.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ def test_empty_result(self) -> None:
417417
"C1=NC(N)=[Se]=C1", # fails PhysChem calculation
418418
],
419419
)
420-
self.assertIsNotNone(pipeline)
420+
self.assertIsNotNone(pipeline) # test for ruff to not have a staticmethod
421421

422422
# test with a molecule that fails the PhysChem calculation and with standardizer
423423
pipeline = Pipeline(
@@ -439,7 +439,7 @@ def test_empty_result(self) -> None:
439439
"C1=NC(N)=[Se]=C1", # fails PhysChem calculation
440440
],
441441
)
442-
self.assertIsNotNone(pipeline)
442+
self.assertIsNotNone(pipeline) # test for ruff to not have a staticmethod
443443

444444
def test_empty_descriptor_list(self) -> None:
445445
"""Test that an empty descriptor list raises ValueError."""

0 commit comments

Comments
 (0)