From 75348ba8ed687024fa74af0842fbaefc28476e57 Mon Sep 17 00:00:00 2001 From: allbegray Date: Fri, 8 Apr 2022 13:23:44 +0900 Subject: [PATCH 1/8] :wrench: add setup.py --- setup.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 setup.py diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..57dd4a7 --- /dev/null +++ b/setup.py @@ -0,0 +1,22 @@ +import setuptools +from setuptools import setup, find_packages + +setup(name='smiles-transformer', + version='1.0.0', + description='Original implementation of the paper "SMILES Transformer: Pre-trained Molecular Fingerprint for Low Data Drug Discovery"', + long_description=open('README.md').read(), + author='Shion Honda', + author_email='https://twitter.com/shion_honda', + url='https://github.com/DSPsleeporg/smiles-transformer', + license='MIT', + # py_modules=['calWordsFreq', 'findKeywordSentences'], + install_requires=[ + 'numpy', + 'pandas', + 'torch', + 'tqdm', + 'rdkit-pypi', + ], + python_requires='>=3', + packages=setuptools.find_packages(where='smiles_transformer') + ) From 3e6af5a2502e8fbbe9d566e24706d7b3630b6fdd Mon Sep 17 00:00:00 2001 From: allbegray Date: Fri, 8 Apr 2022 13:30:00 +0900 Subject: [PATCH 2/8] :wrench: add __init__.py --- setup.py | 4 ++-- smiles_transformer/__init__.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 smiles_transformer/__init__.py diff --git a/setup.py b/setup.py index 57dd4a7..470b331 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ import setuptools from setuptools import setup, find_packages -setup(name='smiles-transformer', +setup(name='smiles_transformer', version='1.0.0', description='Original implementation of the paper "SMILES Transformer: Pre-trained Molecular Fingerprint for Low Data Drug Discovery"', long_description=open('README.md').read(), @@ -18,5 +18,5 @@ 'rdkit-pypi', ], python_requires='>=3', - packages=setuptools.find_packages(where='smiles_transformer') + packages=['smiles_transformer'] ) diff --git a/smiles_transformer/__init__.py b/smiles_transformer/__init__.py new file mode 100644 index 0000000..b6e690f --- /dev/null +++ b/smiles_transformer/__init__.py @@ -0,0 +1 @@ +from . import * From 4974190caa32cacf430937eaddde30285bc8118e Mon Sep 17 00:00:00 2001 From: allbegray Date: Fri, 8 Apr 2022 13:44:15 +0900 Subject: [PATCH 3/8] :wrench: remove 'rdkit-pypi' on install_requires --- setup.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/setup.py b/setup.py index 470b331..15ff821 100644 --- a/setup.py +++ b/setup.py @@ -9,13 +9,11 @@ author_email='https://twitter.com/shion_honda', url='https://github.com/DSPsleeporg/smiles-transformer', license='MIT', - # py_modules=['calWordsFreq', 'findKeywordSentences'], install_requires=[ 'numpy', 'pandas', 'torch', 'tqdm', - 'rdkit-pypi', ], python_requires='>=3', packages=['smiles_transformer'] From 4fb9971e57ea888888214b1a5ab927c1716f0ce7 Mon Sep 17 00:00:00 2001 From: allbegray Date: Fri, 8 Apr 2022 15:01:33 +0900 Subject: [PATCH 4/8] :wrench: __init__.py --- smiles_transformer/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/smiles_transformer/__init__.py b/smiles_transformer/__init__.py index b6e690f..f99d8a4 100644 --- a/smiles_transformer/__init__.py +++ b/smiles_transformer/__init__.py @@ -1 +1,5 @@ from . import * +from .build_vocab import WordVocab +from .dataset import Seq2seqDataset +from .enumerator import SmilesEnumerator +from .utils import split From aa703e6366a06648ceb2ecd3ddb5ecc0eb15263c Mon Sep 17 00:00:00 2001 From: allbegray Date: Fri, 8 Apr 2022 15:08:14 +0900 Subject: [PATCH 5/8] :wrench: __init__.py --- smiles_transformer/__init__.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/smiles_transformer/__init__.py b/smiles_transformer/__init__.py index f99d8a4..158fa87 100644 --- a/smiles_transformer/__init__.py +++ b/smiles_transformer/__init__.py @@ -1,5 +1,3 @@ -from . import * -from .build_vocab import WordVocab -from .dataset import Seq2seqDataset -from .enumerator import SmilesEnumerator -from .utils import split +import smiles_transformer + +__all__ = ["smiles_transformer"] From 17539dabd87991777db4b53ee62ca572ff5ec4f6 Mon Sep 17 00:00:00 2001 From: allbegray Date: Fri, 8 Apr 2022 15:09:50 +0900 Subject: [PATCH 6/8] :wrench: __init__.py --- smiles_transformer/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/smiles_transformer/__init__.py b/smiles_transformer/__init__.py index 158fa87..cbb4fa4 100644 --- a/smiles_transformer/__init__.py +++ b/smiles_transformer/__init__.py @@ -1,3 +1,4 @@ -import smiles_transformer +import build_vocab +import dataset -__all__ = ["smiles_transformer"] +__all__ = ["build_vocab", "dataset"] From 4a8deff8f6d8cb108d537df684b721d886de7a1f Mon Sep 17 00:00:00 2001 From: allbegray Date: Fri, 8 Apr 2022 15:12:07 +0900 Subject: [PATCH 7/8] :wrench: __init__.py --- smiles_transformer/__init__.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/smiles_transformer/__init__.py b/smiles_transformer/__init__.py index cbb4fa4..b55eea3 100644 --- a/smiles_transformer/__init__.py +++ b/smiles_transformer/__init__.py @@ -1,4 +1,9 @@ -import build_vocab -import dataset - -__all__ = ["build_vocab", "dataset"] +from .build_corpus import * +from .build_vocab import * +from .dataset import * +from .enumerator import * +from .pretrain_rnn import * +from .pretrain_trfm import * +from .sample import * +from .smi2csv import * +from .utils import * From 8ed56f3557248057f3555800fa0b7d3931a22c09 Mon Sep 17 00:00:00 2001 From: allbegray Date: Fri, 8 Apr 2022 15:16:15 +0900 Subject: [PATCH 8/8] :wrench: package reimport --- smiles_transformer/__init__.py | 10 +--------- smiles_transformer/build_corpus.py | 2 +- smiles_transformer/dataset.py | 4 ++-- smiles_transformer/pretrain_rnn.py | 4 ++-- smiles_transformer/pretrain_trfm.py | 4 ++-- smiles_transformer/sample.py | 2 +- 6 files changed, 9 insertions(+), 17 deletions(-) diff --git a/smiles_transformer/__init__.py b/smiles_transformer/__init__.py index b55eea3..b6e690f 100644 --- a/smiles_transformer/__init__.py +++ b/smiles_transformer/__init__.py @@ -1,9 +1 @@ -from .build_corpus import * -from .build_vocab import * -from .dataset import * -from .enumerator import * -from .pretrain_rnn import * -from .pretrain_trfm import * -from .sample import * -from .smi2csv import * -from .utils import * +from . import * diff --git a/smiles_transformer/build_corpus.py b/smiles_transformer/build_corpus.py index 5c42a95..bb46160 100644 --- a/smiles_transformer/build_corpus.py +++ b/smiles_transformer/build_corpus.py @@ -2,7 +2,7 @@ import pandas as pd from tqdm import tqdm -from utils import split +from .utils import split def main(): parser = argparse.ArgumentParser(description='Build a corpus file') diff --git a/smiles_transformer/dataset.py b/smiles_transformer/dataset.py index 34ed188..8be8423 100644 --- a/smiles_transformer/dataset.py +++ b/smiles_transformer/dataset.py @@ -3,8 +3,8 @@ import torch from torch.utils.data import Dataset, DataLoader -from enumerator import SmilesEnumerator -from utils import split +from .enumerator import SmilesEnumerator +from .utils import split PAD = 0 MAX_LEN = 220 diff --git a/smiles_transformer/pretrain_rnn.py b/smiles_transformer/pretrain_rnn.py index d51820e..280bb4c 100644 --- a/smiles_transformer/pretrain_rnn.py +++ b/smiles_transformer/pretrain_rnn.py @@ -12,8 +12,8 @@ from torch.autograd import Variable from torch.nn.utils import clip_grad_norm_ from torch.nn import functional as F -from build_vocab import WordVocab -from dataset import Seq2seqDataset +from .build_vocab import WordVocab +from .dataset import Seq2seqDataset PAD = 0 UNK = 1 diff --git a/smiles_transformer/pretrain_trfm.py b/smiles_transformer/pretrain_trfm.py index 3a054a9..9681e1c 100644 --- a/smiles_transformer/pretrain_trfm.py +++ b/smiles_transformer/pretrain_trfm.py @@ -12,8 +12,8 @@ from torch.utils.data import DataLoader from tqdm import tqdm -from build_vocab import WordVocab -from dataset import Seq2seqDataset +from .build_vocab import WordVocab +from .dataset import Seq2seqDataset PAD = 0 UNK = 1 diff --git a/smiles_transformer/sample.py b/smiles_transformer/sample.py index 198b87e..0ab9f08 100644 --- a/smiles_transformer/sample.py +++ b/smiles_transformer/sample.py @@ -1,4 +1,4 @@ -from enumerator import SmilesEnumerator +from .enumerator import SmilesEnumerator sme = SmilesEnumerator() smiles = ''