From 227b323ea221c1fd13a3f498574c8825efbb40b3 Mon Sep 17 00:00:00 2001 From: albert bou Date: Tue, 6 Aug 2024 10:58:14 +0200 Subject: [PATCH 1/4] ci --- .github/unittests/install_dependencies.sh | 9 +++++ .github/unittests/install_dependencies.shyy | 7 ++++ .../unittests/install_dependencies_nightly.sh | 17 +++++++++ .github/workflows/lint.yml | 38 +++++++++++++++++++ .github/workflows/unit_tests.yml | 38 +++++++++++++++++++ 5 files changed, 109 insertions(+) create mode 100644 .github/unittests/install_dependencies.sh create mode 100644 .github/unittests/install_dependencies.shyy create mode 100644 .github/unittests/install_dependencies_nightly.sh create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/unit_tests.yml diff --git a/.github/unittests/install_dependencies.sh b/.github/unittests/install_dependencies.sh new file mode 100644 index 0000000..32e3ecc --- /dev/null +++ b/.github/unittests/install_dependencies.sh @@ -0,0 +1,9 @@ +python -m pip install --upgrade pip +python -m pip install flake8 pytest pytest-cov hydra-core tqdm torch torchvision, MolScore, promptsmiles + +if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + +pip install torchrl + +cd ../acegen-open +pip install -e . diff --git a/.github/unittests/install_dependencies.shyy b/.github/unittests/install_dependencies.shyy new file mode 100644 index 0000000..972e099 --- /dev/null +++ b/.github/unittests/install_dependencies.shyy @@ -0,0 +1,7 @@ +python -m pip install --upgrade pip +python -m pip install flake8 pytest pytest-cov hydra-core tqdm torch torchvision, MolScore, promptsmiles + +pip install torchrl + +cd ../acegen-open +pip install -e . diff --git a/.github/unittests/install_dependencies_nightly.sh b/.github/unittests/install_dependencies_nightly.sh new file mode 100644 index 0000000..d3f712c --- /dev/null +++ b/.github/unittests/install_dependencies_nightly.sh @@ -0,0 +1,17 @@ +python -m pip install --upgrade pip +python -m pip install flake8 pytest pytest-cov hydra-core tqdm + +# Not using nightly torch, MolScore, promptsmiles +python -m pip install torch torchvision MolScore promptsmiles +# python -m pip install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cpu --force-reinstall + +cd ../acegen-open +pip install -e . +pip uninstall --yes torchrl +pip uninstall --yes tensordict + +cd .. +python -m pip install git+https://github.com/pytorch-labs/tensordict.git +git clone https://github.com/pytorch/rl.git +cd rl +python setup.py develop \ No newline at end of file diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..4606b06 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,38 @@ +name: lint + +on: + push: + branches: [ $default-branch , "main" ] + pull_request: + branches: [ $default-branch , "main" ] + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.11"] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + + - name: Lint + run: | + python -m pip install --upgrade pip + pip install pre-commit + + set +e + pre-commit run --all-files + + if [ $? -ne 0 ]; then + git --no-pager diff + exit 1 + fi \ No newline at end of file diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml new file mode 100644 index 0000000..d449be0 --- /dev/null +++ b/.github/workflows/unit_tests.yml @@ -0,0 +1,38 @@ +name: unit_tests + +on: + push: + branches: [ $default-branch , "main" ] + pull_request: + branches: [ $default-branch , "main" ] + +permissions: + contents: read + +jobs: + tests: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + python-version: ["3.9", "3.10","3.11"] + os: [ubuntu-latest] + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + bash .github/unittest/install_dependencies_nightly.sh + + - name: Test with pytest + run: | + pytest test/ --doctest-modules --junitxml=junit/test-results.xml --cov=. --cov-report=xml --cov-report=html + + - if: matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest' + name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + fail_ci_if_error: false \ No newline at end of file From c18b87dc7644bca40e365630651dec169ec63003 Mon Sep 17 00:00:00 2001 From: albert bou Date: Tue, 6 Aug 2024 11:02:55 +0200 Subject: [PATCH 2/4] update README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3188c07..e74466b 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ ![license](https://img.shields.io/badge/license-MIT-blue) [![tutorials](https://img.shields.io/badge/tutorials-available-brightgreen)](https://github.com/Acellera/acegen-open/tree/main/tutorials) ![python](https://img.shields.io/badge/python-3.9%20|%203.10%20|%203.11-blue) +[![arXiv](https://img.shields.io/badge/arXiv--blue)](https://arxiv.org/abs/2405.04657) +[![JCIM](https://img.shields.io/badge/JCIM-DOI-blue)](https://pubs.acs.org/doi/abs/10.1021/acs.jcim.4c00895) --- @@ -15,8 +17,6 @@ ACEGEN is a comprehensive toolkit designed to leverage reinforcement learning (RL) techniques for generative chemistry tasks, particularly in drug design. ACEGEN harnesses the capabilities of TorchRL, a modern library for general decision-making tasks, to provide a flexible and integrated solution for generative drug design challenges. -The full paper can be found [here](https://pubs.acs.org/doi/abs/10.1021/acs.jcim.4c00895). - --- ## Key Features From a5f3521773154bc9c087ebf1c8bcf52adb382b0e Mon Sep 17 00:00:00 2001 From: albert bou Date: Tue, 6 Aug 2024 11:10:07 +0200 Subject: [PATCH 3/4] update README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e74466b..7dcfc1d 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ ![license](https://img.shields.io/badge/license-MIT-blue) [![tutorials](https://img.shields.io/badge/tutorials-available-brightgreen)](https://github.com/Acellera/acegen-open/tree/main/tutorials) ![python](https://img.shields.io/badge/python-3.9%20|%203.10%20|%203.11-blue) -[![arXiv](https://img.shields.io/badge/arXiv--blue)](https://arxiv.org/abs/2405.04657) -[![JCIM](https://img.shields.io/badge/JCIM-DOI-blue)](https://pubs.acs.org/doi/abs/10.1021/acs.jcim.4c00895) +[![arXiv](https://img.shields.io/badge/arXiv-2405.04657-red.svg)](https://arxiv.org/abs/2405.04657) +[![JCIM](https://img.shields.io/badge/JCIM-10.1021%2Facs.jcim.4c00895-blue)](https://doi.org/10.1021/acs.jcim.4c00895) --- From 51121affdea477f97ce24006347c00240594c3a0 Mon Sep 17 00:00:00 2001 From: albert bou Date: Tue, 6 Aug 2024 11:24:32 +0200 Subject: [PATCH 4/4] update ci scripts --- .github/unittests/install_dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/unittests/install_dependencies.sh b/.github/unittests/install_dependencies.sh index 32e3ecc..071b16f 100644 --- a/.github/unittests/install_dependencies.sh +++ b/.github/unittests/install_dependencies.sh @@ -1,5 +1,5 @@ python -m pip install --upgrade pip -python -m pip install flake8 pytest pytest-cov hydra-core tqdm torch torchvision, MolScore, promptsmiles +python -m pip install flake8 pytest pytest-cov hydra-core tqdm torch torchvision MolScore promptsmiles if [ -f requirements.txt ]; then pip install -r requirements.txt; fi