Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c63ff94
Set up pixi
Yoshanuikabundi Jan 24, 2025
c036d85
Set up pixi for CI
Yoshanuikabundi Jan 25, 2025
a5ba3b7
Fix doctests and be ok with codecov failing
Yoshanuikabundi Jan 25, 2025
ef005b6
Fix lints
Yoshanuikabundi Jan 25, 2025
85a3e16
Fix lints pt2
Yoshanuikabundi Jan 25, 2025
f483cf1
Add all environment
Yoshanuikabundi Jan 25, 2025
5292d54
Fix lints pt3
Yoshanuikabundi Jan 25, 2025
8b637af
Fix lints pt4
Yoshanuikabundi Jan 25, 2025
73d745e
Revert "Add all environment"
Yoshanuikabundi Jan 25, 2025
5bef7d0
Fix lints pt5
Yoshanuikabundi Jan 25, 2025
26e23c8
Rename CI jobs
Yoshanuikabundi Jan 25, 2025
6b86332
Fix lints pt6
Yoshanuikabundi Jan 25, 2025
f643b42
add doctest to codebase
Yoshanuikabundi Jan 25, 2025
b9b0af4
Fix lints pt7
Yoshanuikabundi Jan 25, 2025
3920384
Add commented better_typing branches for units and toolkit
Yoshanuikabundi Jan 25, 2025
e48e9e7
Uncomment custom branch deps
Yoshanuikabundi Jan 25, 2025
db13b34
Revert "Uncomment custom branch deps"
Yoshanuikabundi Jan 25, 2025
567d0be
Clarify CI naming
Yoshanuikabundi Jan 25, 2025
221f389
fix workflow naming
Yoshanuikabundi Jan 25, 2025
fc97d90
Require future version of OFFTK
Yoshanuikabundi Aug 15, 2025
cffa005
Update deps
Yoshanuikabundi Aug 26, 2025
20ac0b4
Attempt to configure RTD to use pixi
Yoshanuikabundi Aug 26, 2025
339e9e3
Fix RTD config git command
Yoshanuikabundi Aug 26, 2025
abe5448
Try configuring pixi env with symlink
Yoshanuikabundi Aug 26, 2025
0a6a8c3
Fix GHA
Yoshanuikabundi Aug 26, 2025
5f9b080
Remove unhelpful RTD config
Yoshanuikabundi Aug 26, 2025
56d41a5
Fix typechecks
Yoshanuikabundi Aug 26, 2025
38b2ffc
remove unnecessary rm in rtd config
Yoshanuikabundi Aug 26, 2025
14aecc3
Create venv parent directory before symlinking
Yoshanuikabundi Aug 26, 2025
40afc44
Create only venv parent dirs
Yoshanuikabundi Aug 26, 2025
0121da6
ls
Yoshanuikabundi Aug 26, 2025
8f309d4
Give up and just override build command
Yoshanuikabundi Aug 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ comment:
flags: []
paths: []
ignore:
- "openff/pablo/_version.py"
- "examples/"
- "docs/"
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly

groups:
dependencies:
patterns:
- "*"
47 changes: 47 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: GH Actions Lints
on:
push:
branches:
- main
pull_request:
branches:
- main

concurrency:
# Specific group naming so CI is only cancelled
# within same PR or on merge to main
group: ${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}
cancel-in-progress: true

defaults:
run:
shell: bash -l {0}

jobs:
lints:
if: "github.repository == 'openforcefield/openff-pablo'"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Build information
run: |
uname -a
df -h
ulimit -a

- uses: prefix-dev/[email protected]
with:
pixi-version: v0.50.0
activate-environment: lint

- run: ruff check openff

- run: pixi r typecheck
47 changes: 13 additions & 34 deletions .github/workflows/gh-ci.yaml → .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: GH Actions CI
name: GH Actions Tests
on:
push:
branches:
Expand All @@ -23,14 +23,13 @@ defaults:
shell: bash -l {0}

jobs:
main-tests:
tests:
if: "github.repository == 'openforcefield/openff-pablo'"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.11"]

steps:
- uses: actions/checkout@v4
Expand All @@ -43,38 +42,18 @@ jobs:
df -h
ulimit -a

- name: Install environment
uses: mamba-org/setup-micromamba@v2
- uses: prefix-dev/[email protected]
with:
environment-file: devtools/conda-envs/test_env.yaml
create-args: >-
python=${{ matrix.python-version }}
pixi-version: v0.52.0
environments: test

- name: Install package
run: |
python --version
python -m pip install .

- name: Python information
run: |
which python
which pip
pip list
micromamba info
micromamba list
- run: pixi r slowtest -v --color=yes --cov=openff/pablo --cov-append --cov-report=xml

- name: Type check
if: runner.os == 'Linux'
run: |
basedpyright openff
- run: pixi r doctest -v --color=yes

- name: Run tests
run: |
pytest -n auto -v --color=yes

# - name: codecov
# uses: codecov/codecov-action@v3
# with:
# file: coverage.xml
# name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}
# verbose: True
- name: Codecov
uses: codecov/codecov-action@v5
with:
files: ./coverage.xml
disable_search: true
fail_ci_if_error: false
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,8 @@ poetry.lock
# zed
.zed/

# pixi
.pixi
pixi.lock

.ccd_cache
33 changes: 0 additions & 33 deletions devtools/conda-envs/docs_env.yaml

This file was deleted.

49 changes: 0 additions & 49 deletions devtools/conda-envs/test_env.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions openff/pablo/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import rdkit.Chem.Draw
import rdkit.Chem.rdDepictor
import rdkit.Geometry
from IPython.display import SVG
from openff.toolkit import Molecule
from openff.toolkit.topology._mm_molecule import _SimpleMolecule
from openff.toolkit.topology.molecule import MoleculeLike
Expand Down Expand Up @@ -348,7 +347,7 @@ def draw_molecule(
emphasize_atoms: list[int] | None = None,
explicit_hydrogens: bool | None = None,
color_by_element: bool | None = None,
) -> SVG:
):
"""Draw a molecule

Parameters
Expand Down Expand Up @@ -392,6 +391,7 @@ def draw_molecule(
When an atom or bond in highlight_atoms or highlight_bonds is missing
from the image, including when it is present in the molecule but hidden.
"""
from IPython.display import SVG

# We're working in RDKit
try:
Expand Down
35 changes: 35 additions & 0 deletions openff/pablo/residue.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,41 @@ def from_smiles(
virtual_sites
Virtual sites expected by the residue. See
:py:data:`openff.pablo.ResidueDefinition.virtual_sites`

Examples
--------

To create a ``ResidueDefinition`` for a neutral cysteine residue:

>>> from openff.pablo.residue import ResidueDefinition
>>> from openff.pablo.chem import DISULFIDE_BOND, PEPTIDE_BOND
>>>
>>> ResidueDefinition.from_smiles(
... residue_name="CYS",
... mapped_smiles=r"[N:1]([C@@:2]([C:5]([S:6][H:13])([H:11])[H:12])([C:3]([O:7][H:14])=[O:4])[H:10])([H:8])[H:9]",
... atom_names={
... 1: "N",
... 2: "CA",
... 3: "C",
... 4: "O",
... 5: "CB",
... 6: "SG",
... 7: "OXT",
... 8: "H",
... 9: "H2",
... 10: "HA",
... 11: "HB2",
... 12: "HB3",
... 13: "HG",
... 14: "HXT",
... },
... leaving_atoms={7, 14, 13, 9},
... crosslink=DISULFIDE_BOND,
... linking_bond=PEPTIDE_BOND,
... description="CYSTEINE",
... )
ResidueDefinition(...)

"""
molecule = Molecule.from_mapped_smiles(
mapped_smiles,
Expand Down
Loading
Loading