diff --git a/deepchem/data/data_loader.py b/deepchem/data/data_loader.py index 5482c286ed..4ee7b4d4b6 100644 --- a/deepchem/data/data_loader.py +++ b/deepchem/data/data_loader.py @@ -19,15 +19,16 @@ from deepchem.utils.genomics_utils import encode_bio_sequence try: + from deepchem.feat.dft_data import DFTEntry import yaml from yaml.loader import SafeLoader -except (ImportError, ModuleNotFoundError) as e: - warnings.warn("PyYAML is not installed. Please install PyYAML to use the DataLoader class.") +except: + pass try: import pysam -except (ImportError, ModuleNotFoundError) as e: - warnings.warn("pysam is not installed. Please install pysam to use the DataLoader class.") +except: + pass logger = logging.getLogger(__name__) @@ -1879,7 +1880,6 @@ def _featurize_shard(self, shard): ------- x: featurized shard (DFTEntry objects) """ - from deepchem.feat.dft_data import DFTEntry try: e_type = shard['e_type'] if 'true_val' in shard.keys(): diff --git a/deepchem/feat/dft_data.py b/deepchem/feat/dft_data.py index 84fedd9ee4..96b32fb8e7 100644 --- a/deepchem/feat/dft_data.py +++ b/deepchem/feat/dft_data.py @@ -12,7 +12,7 @@ from dqc.system.mol import Mol from dqc.system.base_system import BaseSystem from deepchem.utils.dftutils import KSCalc -except (ImportError, ModuleNotFoundError) as e: +except: pass from deepchem.utils.dft_utils import parse_moldesc, BaseGrid diff --git a/deepchem/models/dft/dftxc.py b/deepchem/models/dft/dftxc.py index 08c2c12e63..f123356540 100644 --- a/deepchem/models/dft/dftxc.py +++ b/deepchem/models/dft/dftxc.py @@ -1,7 +1,7 @@ """Derived from https://github.com/mfkasim1/xcnn/blob/f2cb9777da2961ac553f256ecdcca3e314a538ca/xcdnn2/litmodule.py""" from deepchem.models.dft.scf import XCNNSCF -import torch from deepchem.models.dft.nnxc import HybridXC +import torch from deepchem.models.losses import Loss, L2Loss from deepchem.models.torch_models.torch_model import TorchModel from typing import Tuple, Optional, List, Any diff --git a/deepchem/models/dft/nnxc.py b/deepchem/models/dft/nnxc.py index 01ef374c63..3941007f0e 100644 --- a/deepchem/models/dft/nnxc.py +++ b/deepchem/models/dft/nnxc.py @@ -8,7 +8,7 @@ from dqc.api.getxc import get_xc from dqc.xc.base_xc import BaseXC from dqc.utils.safeops import safenorm, safepow -except (ImportError, ModuleNotFoundError) as e: +except: pass diff --git a/deepchem/models/tests/test_dens.py b/deepchem/models/tests/test_dens.py index 19794c02b4..821f1c12da 100644 --- a/deepchem/models/tests/test_dens.py +++ b/deepchem/models/tests/test_dens.py @@ -5,7 +5,7 @@ import torch from deepchem.models.losses import DensityProfileLoss has_dqc = True -except (ImportError, ModuleNotFoundError) as e: +except: has_dqc = False import numpy as np import pytest diff --git a/deepchem/models/tests/test_nnxc.py b/deepchem/models/tests/test_nnxc.py index c7a83d2f6d..e0a8a00781 100644 --- a/deepchem/models/tests/test_nnxc.py +++ b/deepchem/models/tests/test_nnxc.py @@ -5,7 +5,7 @@ import torch.nn as nn from dqc.utils.datastruct import ValGrad has_dqc = True -except (ImportError, ModuleNotFoundError) as e: +except: has_dqc = False