Skip to content

Commit

Permalink
Example with CI - precommited
Browse files Browse the repository at this point in the history
  • Loading branch information
whitead committed Jul 19, 2024
1 parent 02e6e1d commit ecb27d1
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/modal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
MODAL_TOKEN_ID: ${{ secrets.MODAL_TOKEN_ID }}
CHEMENV_NAME: "-dev"
- name: Run tests
run: pytest tests/
run: pytest tests/
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import os
import pytest


@pytest.fixture(scope="function")
def app_name():
chemenv_name = os.getenv("CHEMENV_NAME", "")
return f"chemenv{chemenv_name}"
return f"chemenv{chemenv_name}"
1 change: 1 addition & 0 deletions tests/test_cheminf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pytest
import modal


@pytest.mark.asyncio
async def test_tanimoto(app_name):
fxn = modal.Function.lookup(app_name, "tanimoto")
Expand Down
4 changes: 2 additions & 2 deletions tools/cheminf/cheminf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ def tanimoto(s1: str, s2: str) -> float:
fp1 = AllChem.GetMorganFingerprintAsBitVect(mol1, 2, nBits=2048)
fp2 = AllChem.GetMorganFingerprintAsBitVect(mol2, 2, nBits=2048)
return DataStructs.TanimotoSimilarity(fp1, fp2)
except (TypeError, ValueError, AttributeError):
return "Error: Not a valid SMILES string"
except (TypeError, ValueError, AttributeError) as e:
raise ValueError("Invalid SMILES strings") from e
2 changes: 0 additions & 2 deletions tools/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@
chemenv_name = f"-{chemenv_name}"
app = App(f"chemenv{chemenv_name}")
app.include(cheminf_app)


0 comments on commit ecb27d1

Please sign in to comment.