Skip to content

Commit 8da26da

Browse files
Fix install instructions
1 parent 5f0ac18 commit 8da26da

File tree

3 files changed

+49
-34
lines changed

3 files changed

+49
-34
lines changed

README.md

Lines changed: 21 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,69 +6,59 @@ OpenFF Pablo
66
| :----------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
77
| **Status** | [![GH Actions Status](https://github.com/openforcefield/openff-pablo/actions/workflows/gh-ci.yaml/badge.svg)](https://github.com/openforcefield/openff-pablo/actions?query=branch%3Amain+workflow%3Agh-ci) [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/openforcefield/openff-pablo/main.svg)](https://results.pre-commit.ci/latest/github/openforcefield/openff-pablo/main) |
88

9-
New, independent implementation of `Topology.from_pdb`
9+
New, independent implementation of OpenFF's `Topology.from_pdb`
1010

1111
OpenFF Pablo is bound by a [Code of Conduct](https://github.com/openforcefield/openff-pablo/blob/main/CODE_OF_CONDUCT.md).
1212

1313
### Installation
1414

15-
To build OpenFF Pablo from source,
16-
we highly recommend using virtual environments.
17-
If possible, we strongly recommend that you use
18-
[Anaconda](https://docs.conda.io/en/latest/) as your package manager.
19-
Below we provide instructions both for `conda` and
20-
for `pip`.
15+
This is a pre-release of Pablo and is not yet published in any package manager.
16+
You can install it by managing your own Conda environment and installing it manually.
2117

22-
#### With conda
18+
Here we describe dependency and environment management with Micromamba, but other Conda-compatible package managers such as Conda and Mamba work the same way - just change the name of the executable.
2319

24-
Ensure that you have [conda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html) installed.
25-
26-
Create a virtual environment and activate it:
20+
Download the user environment YAML file and create a virtual environment from it:
2721

2822
```
29-
conda create --name pablo
30-
conda activate pablo
23+
curl https://raw.githubusercontent.com/openforcefield/openff-pablo/refs/heads/main/devtools/conda-envs/user_env.yaml | micromamba env create --name pablo -f /dev/stdin
3124
```
3225

33-
Install the development and documentation dependencies:
26+
#### Development build
27+
28+
Clone the repository:
3429

3530
```
36-
conda env update --name pablo --file devtools/conda-envs/test_env.yaml
37-
conda env update --name pablo --file docs/requirements.yaml
31+
git clone https://github.com/openforcefield/openff-pablo
3832
```
3933

40-
Build this package from source:
34+
Create a virtual environment:
4135

4236
```
43-
pip install -e .
37+
micromamba create --name pablo-dev
4438
```
4539

46-
If you want to update your dependencies (which can be risky!), run:
40+
Install the development and documentation dependencies:
4741

4842
```
49-
conda update --all
43+
micromamba env update -n pablo-dev --file openff-pablo/devtools/conda-envs/test_env.yaml
44+
micromamba env update -n pablo-dev --file openff-pablo/docs/requirements.yaml
5045
```
5146

52-
And when you are finished, you can exit the virtual environment with:
47+
Install this package in editable mode:
5348

5449
```
55-
conda deactivate
50+
micromamba run -n pablo-dev pip install -e openff-pablo
5651
```
5752

58-
#### With pip
53+
If you want to update your dependencies, rebuild the environment from scratch.
5954

60-
To build the package from source, run:
55+
Then activate the environment to run commands in it:
6156

6257
```
63-
pip install -e .
58+
micromamba activate pablo-dev
6459
```
6560

66-
If you want to create a development environment, install
67-
the dependencies required for tests and docs with:
68-
69-
```
70-
pip install -e ".[test,doc]"
71-
```
61+
Or use `micromamba run -n pablo-dev`.
7262

7363
### Copyright
7464

devtools/conda-envs/user_env.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: pablo
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
# Base depends (runtime and imports)
6+
- pip
7+
- python>=3.11
8+
- openff-toolkit-base>=0.17.0
9+
- rdkit
10+
- openmm
11+
- pyxdg
12+
- rustworkx
13+
- gemmi
14+
15+
- pip:
16+
- git+https://github.com/openforcefield/openff-pablo.git@main

openff/pablo/_utils.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import rdkit.Chem.Draw
1919
import rdkit.Chem.rdDepictor
2020
import rdkit.Geometry
21-
from IPython.display import SVG
2221
from openff.toolkit import Molecule
2322
from openff.toolkit.topology._mm_molecule import _SimpleMolecule
2423
from openff.toolkit.topology.molecule import MoleculeLike
@@ -348,9 +347,11 @@ def draw_molecule(
348347
emphasize_atoms: list[int] | None = None,
349348
explicit_hydrogens: bool | None = None,
350349
color_by_element: bool | None = None,
351-
) -> SVG:
350+
) -> str:
352351
"""Draw a molecule
353352
353+
Returns a string encoding an XML with the requested drawing.
354+
354355
Parameters
355356
==========
356357
@@ -391,6 +392,14 @@ def draw_molecule(
391392
KeyError
392393
When an atom or bond in highlight_atoms or highlight_bonds is missing
393394
from the image, including when it is present in the molecule but hidden.
395+
396+
Examples
397+
========
398+
399+
>>> from IPython.display import SVG
400+
>>>
401+
>>> SVG(draw_molecule(...))
402+
394403
"""
395404

396405
# We're working in RDKit
@@ -543,4 +552,4 @@ def draw_molecule(
543552

544553
# Return an SVG object that we can view in notebook
545554
svg_contents = drawer.GetDrawingText()
546-
return SVG(svg_contents)
555+
return svg_contents

0 commit comments

Comments
 (0)