diff --git a/utils/src/datasets.py b/utils/src/datasets.py index 4ab9a0bf..5b5cc0e8 100644 --- a/utils/src/datasets.py +++ b/utils/src/datasets.py @@ -7,8 +7,8 @@ from rdkit import Chem from torch.utils.data import Dataset, DataLoader from tqdm import tqdm -from utils.src import const - +#from utils.src import const +from . import const from pdb import set_trace diff --git a/utils/src/delinker.py b/utils/src/delinker.py index e1675a2b..2f5b629e 100644 --- a/utils/src/delinker.py +++ b/utils/src/delinker.py @@ -3,8 +3,8 @@ from rdkit import Chem from rdkit.Chem import MolStandardize -from utils.src import metrics -from utils.src.delinker_utils import sascorer, calc_SC_RDKit +from . import metrics +from .delinker_utils import sascorer, calc_SC_RDKit from tqdm import tqdm from pdb import set_trace diff --git a/utils/src/edm.py b/utils/src/edm.py index 6e923ff7..6b84563d 100644 --- a/utils/src/edm.py +++ b/utils/src/edm.py @@ -3,9 +3,9 @@ import numpy as np import math -from utils.src import utils -from utils.src.egnn import Dynamics -from utils.src.noise import GammaNetwork, PredefinedNoiseSchedule +from . import utils +from .egnn import Dynamics +from .noise import GammaNetwork, PredefinedNoiseSchedule from typing import Union from pdb import set_trace diff --git a/utils/src/egnn.py b/utils/src/egnn.py index 52e413e8..6ceaba6b 100644 --- a/utils/src/egnn.py +++ b/utils/src/egnn.py @@ -3,7 +3,7 @@ import torch import torch.nn as nn -from utils.src import utils +from . import utils from pdb import set_trace diff --git a/utils/src/lightning.py b/utils/src/lightning.py index c099944d..02509af8 100644 --- a/utils/src/lightning.py +++ b/utils/src/lightning.py @@ -4,16 +4,16 @@ import torch import wandb -from utils.src import metrics, utils, delinker -from utils.src.const import LINKER_SIZE_DIST -from utils.src.egnn import Dynamics, DynamicsWithPockets -from utils.src.edm import EDM, InpaintingEDM -from utils.src.datasets import ( +from . import metrics, utils, delinker +from .const import LINKER_SIZE_DIST +from .egnn import Dynamics, DynamicsWithPockets +from .edm import EDM, InpaintingEDM +from .datasets import ( ZincDataset, MOADDataset, create_templates_for_linker_generation, get_dataloader, collate ) -from utils.src.linker_size import DistributionNodes -from utils.src.molecule_builder import build_molecules -from utils.src.visualizer import save_xyz_file, visualize_chain +from .linker_size import DistributionNodes +from .molecule_builder import build_molecules +from .visualizer import save_xyz_file, visualize_chain from typing import Dict, List, Optional from tqdm import tqdm diff --git a/utils/src/linker_size.py b/utils/src/linker_size.py index 2a3e87aa..5d7051ad 100644 --- a/utils/src/linker_size.py +++ b/utils/src/linker_size.py @@ -3,7 +3,7 @@ import torch.nn as nn from torch.distributions.categorical import Categorical -from utils.src.egnn import GCL +from .egnn import GCL class DistributionNodes: diff --git a/utils/src/linker_size_lightning.py b/utils/src/linker_size_lightning.py index 265de1ac..92f05ea6 100644 --- a/utils/src/linker_size_lightning.py +++ b/utils/src/linker_size_lightning.py @@ -1,10 +1,10 @@ import pytorch_lightning as pl import torch -from utils.src.const import ZINC_TRAIN_LINKER_ID2SIZE, ZINC_TRAIN_LINKER_SIZE2ID -from utils.src.linker_size import SizeGNN -from utils.src.egnn import coord2diff -from utils.src.datasets import ZincDataset, get_dataloader, collate_with_fragment_edges +from .const import ZINC_TRAIN_LINKER_ID2SIZE, ZINC_TRAIN_LINKER_SIZE2ID +from .linker_size import SizeGNN +from .egnn import coord2diff +from .datasets import ZincDataset, get_dataloader, collate_with_fragment_edges from typing import Dict, List, Optional from torch.nn.functional import cross_entropy, mse_loss, sigmoid diff --git a/utils/src/metrics.py b/utils/src/metrics.py index 9640161a..6ebc4382 100644 --- a/utils/src/metrics.py +++ b/utils/src/metrics.py @@ -2,8 +2,8 @@ from rdkit import Chem from rdkit.Chem import AllChem -from utils.src import const -from utils.src.molecule_builder import get_bond_order +from . import const +from .molecule_builder import get_bond_order from scipy.stats import wasserstein_distance from pdb import set_trace diff --git a/utils/src/molecule_builder.py b/utils/src/molecule_builder.py index 49ad0078..7bb56035 100644 --- a/utils/src/molecule_builder.py +++ b/utils/src/molecule_builder.py @@ -3,7 +3,7 @@ from rdkit import Chem, Geometry -from utils.src import const +from . import const def create_conformer(coords): diff --git a/utils/src/visualizer.py b/utils/src/visualizer.py index fd0e196d..4203ac66 100644 --- a/utils/src/visualizer.py +++ b/utils/src/visualizer.py @@ -7,8 +7,8 @@ import random from sklearn.decomposition import PCA -from utils.src import const -from utils.src.molecule_builder import get_bond_order +from . import const +from .molecule_builder import get_bond_order def save_xyz_file(path, one_hot, positions, node_mask, names, is_geom, suffix=''):