Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
65 changes: 42 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,9 @@ By enabling precise volume and flexibility measurements, POVME has become an ess
- Supporting virtual screening and druggability predictions.
- Comparing conformational ensembles from molecular dynamics simulations.

## Development

We use [pixi](https://pixi.sh/latest/) to manage Python environments and simplify the developer workflow.
Once you have [pixi](https://pixi.sh/latest/) installed, move into `POVME` directory (e.g., `cd POVME`) and install the environment using the command

```bash
pixi install
```

Now you can activate the new virtual environment using

```sh
pixi shell -e dev
```

## Installation

### Development
### Latest development version

To install the latest development version of `povme`, follow these steps.

Expand All @@ -63,15 +48,21 @@ Navigate into the cloned directory.
cd POVME
```

Install the development version using `pip`.
Install the latest version using `pixi`.

```bash
pip install .
pixi install
```

This will install `povme` along with all required dependencies into your current Python environment.
This will install `povme` along with all required dependencies into a virtual environment.

To use `povme`, activate the environment and run:

### Tagged
```bash
pixi shell
```

### Tagged version

To install a specific version of `povme`, such as `v2.2.2`, follow these steps.

Expand All @@ -83,14 +74,42 @@ cd POVME
git checkout v2.2.2
```

Install the tagged version using `pip`.
Ensure your environment includes the required dependencies. If not, please run the following:

```bash
pip install .
conda create -n povme python=3.11 numpy=1.23 scipy=1.10
conda activate povme
```

This will install the specified version of `povme` and its dependencies into your current Python environment.

You can use `povme` as follows:

```bash
python3 POVME2.py your_input.init
```

You can also check your installation is valid by running:

```bash
python3 POVME2.py --test
```

## Development

We use [pixi](https://pixi.sh/latest/) to manage Python environments and simplify the developer workflow.
Once you have [pixi](https://pixi.sh/latest/) installed, move into the `POVME` directory (e.g., `cd POVME`) and install the environment using the command:

```bash
pixi install
```

Now you can activate the development virtual environment using:

```sh
pixi shell -e dev
```

## Cite

If you use POVME in your work, please cite:
Expand All @@ -106,4 +125,4 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY
See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program.
If not, see [https://www.gnu.org/licenses/](https://www.gnu.org/licenses/).
If not, see [https://www.gnu.org/licenses/](https://www.gnu.org/licenses/).
7 changes: 1 addition & 6 deletions pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions povme/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ def save_results(results, **kwargs):
"""

from abc import ABC, abstractmethod
from collections.abc import Callable
from typing import Any, Generator
from collections.abc import Callable, Generator
from typing import Any

import ray
from loguru import logger
Expand Down Expand Up @@ -126,6 +126,10 @@ def __init__(
self.n_cores = (
n_cores if n_cores > 0 else int(ray.available_resources().get("CPU", 1))
)
if not use_ray and n_cores > 1:
logger.warning(
"n_cores > 1 but use_ray is False. Running tasks sequentially."
)
"""
The number of parallel tasks to run. If set to `-1` or any value less than or
equal to `0`, all available CPU cores are utilized.
Expand Down
3 changes: 2 additions & 1 deletion povme/pocket/volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
import os
import sys
import time
from collections.abc import Generator
from io import StringIO
from typing import Any, Generator
from typing import Any

import numpy as np
from loguru import logger
Expand Down
8 changes: 8 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ def turn_on_logging():
enable_logging(10)


@pytest.fixture(autouse=True)
def shutdown_ray_after_test():
"""Ensure Ray is shut down after each test to prevent deadlocks."""
yield
if HAS_RAY and ray.is_initialized():
ray.shutdown()


@pytest.fixture
def path_4nss_config():
return os.path.join(TEST_DIR, "files/4nss/povme.yml")
Expand Down
Loading