Skip to content

Commit

Permalink
Add GitHub workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
adosar committed Jun 23, 2024
1 parent e0becdc commit 24891da
Show file tree
Hide file tree
Showing 16 changed files with 107 additions and 39 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/pylint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: PyLint

on: push

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
- name: Run pylint
run: pylint src/aidsorb/
15 changes: 15 additions & 0 deletions .github/workflows/unittest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Unittest

on: push

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Run unit tests
run: python -m unittest
80 changes: 54 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,67 @@
AIdsorb is a Python package for processing molecular point clouds.
<h1 align="center">
<img alt="Logo" src="https://raw.githubusercontent.com/adosar/trial/master/docs/source/images/aidsorb_logo_light.svg"/>
</h1>

Currently, only the `PointNet` [^1] architecture is implemented and can be
found under `src/aidsorb/models.py`. In this implementation, the input `T-Net`
transformation from the original paper is not applied, *since is it is not
guaranteed to be a rigid one*.
<h4 align="center">

![Python 3.11+](https://img.shields.io/badge/python-3.11%2B-blue?style=for-the-badge&logo=python&logoColor=white&labelColor=black)
![License GPL-3.0-only](https://img.shields.io/badge/license-GPL--3.0--only-gold?style=for-the-badge&logo=license&logoColor=cyan&labelColor=black)
![Linux](https://img.shields.io/badge/linux-black?style=for-the-badge&logo=linux&logoColor=cyan)

</h4>


**AIdsorb** is a Python package for **deep learning on molecular point clouds**.

**AIdsorb** aims to provide a **fast, easy-to-use and reproduce** interface for:

- 📥 **Creating molecular point clouds**

- 🤖 **Training DL algorithms on molecular point clouds**


<p align="center">
<img alt="Point cloud" src="https://raw.githubusercontent.com/adosar/aidsorb/master/docs/source/images/pcd.gif" width="25%"/>
</p>

## ⚙️ Installation
> Currently not available in PyPI.
> [!IMPORTANT]
> It is strongly recommended to **perform the installation inside a virtual environment**.
**It is strongly recommended to perform the installation inside a virtual environment**.
Assuming an activated virtual environment:
```bash
git clone https://github.com/adosar/aidsorb && cd aidsorb
(venvir) pip install -e .
pip install aidsorb
```

## 📖 Usage
You can create molecular point clouds form a directory containing molecular
files and save them in a `.npz` file.
## 🚀 Usage
> [!NOTE]
> Refer to the 📚 Documentation for more information.
```python
from aidsorb.utils import pcd_from_dir
pcd_from_dir('/path/to/dir', file='point_clouds.npz')
```
Here is a summary of what you can do from the command line:

## 📇 TODO
* Add atoms featurization
* Add more architectures
1. Visualize a molecular point cloud:
```bash
aidsorb visualize path/to/structure
```

2. Create and prepare point clouds:
```bash
aidsorb create path/to/inp path/to/out # Create point clouds
aidsorb prepare path/to/out # Split point clouds to train, val and test
```
where `path/to/inp` is a directory containing molecular structures.

3. Train and test a model:
```bash
aidsorb-lit fit --config=path/to/config.yaml
aidsorb-lit test --config=path/to/config.yaml --ckpt_path=path/to/ckpt
```
Currently, only [PointNet](https://arxiv.org/abs/1612.00593) is supported.

## 📰 Citing AIdsorb
> Currently N/A.
If you use AIdsorb in your research, please consider citing the following work:

Currently, not available.

## 📑 License
MOXελ is released under the [GNU General Public License v3.0 only](https://spdx.org/licenses/GPL-3.0-only.html).

[^1]: R. Q. Charles, H. Su, M. Kaichun and L. J. Guibas, "PointNet: Deep
Learning on Point Sets for 3D Classification and Segmentation," 2017 IEEE
Conference on Computer Vision and Pattern Recognition (CVPR), Honolulu, HI,USA,
2017, pp. 77-85, doi: 10.1109/CVPR.2017.16.
AIdosrb is released under the [GNU General Public License v3.0 only](https://spdx.org/licenses/GPL-3.0-only.html).
Binary file modified docs/source/auto_examples/resume_codeobj.pickle
Binary file not shown.
1 change: 0 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

from urllib.parse import quote
import sys, os
import subprocess
from plotly.io._sg_scraper import plotly_sg_scraper
Expand Down
Binary file added docs/source/images/pcd.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
About
=====

**AIdsorb** is a :fa:`python; fa-fade` Python package for **Deep Learning on
**AIdsorb** is a :fa:`python; fa-fade` Python package for **deep learning on
molecular point clouds**.

.. grid:: 4
Expand Down
10 changes: 9 additions & 1 deletion docs/source/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ Introduction
4:]`` any **additional features**. If ``C == 0``, then the only features are the
atomic numbers.


.. tip::
You can visualize a molecular point cloud with:

.. code-block:: console
$ aidsorb visualize path/to/structure
Deep learning on molecular point clouds
---------------------------------------

Expand All @@ -66,7 +74,7 @@ AIdsorb, the following components are needed:

* A directory containing files of **molecular structures**.
* A ``.csv`` file containing the **labels of the molecular structures**.
* A ``.yaml`` **configuration file** for orchestrating the ML part.
* A ``.yaml`` **configuration file** for orchestrating the DL part.

.. note::
You are solely responsible for these 3 components.
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ where = ["src"]

[tool.setuptools_scm]

[tool.pylint.main]
jobs = 0
disable = ["C"]
fail-under = 8

[project]
name = "aidsorb"
dynamic = ["version"]
Expand Down
2 changes: 1 addition & 1 deletion src/aidsorb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

r"""
**AIdsorb** is a :fa:`python; fa-fade` Python package for **Deep Learning on
**AIdsorb** is a :fa:`python; fa-fade` Python package for **deep learning on
molecular point clouds**.
Expand Down
6 changes: 2 additions & 4 deletions src/aidsorb/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@
.. todo::
Add more architectures for point cloud processing.
.. danger::
Check all docstrings.
References
----------
Expand Down Expand Up @@ -429,7 +426,8 @@ def forward(self, x):

class PointNet(nn.Module):
r"""
A deep learning architecture for processing point clouds.
Vanilla version from the [PointNet]_ paper where :class:`TNet`'s have been
removed.
``PointNet`` takes as input a point cloud and produces one or more outputs.
*The type of the task is determined by* ``head``.
Expand Down
1 change: 0 additions & 1 deletion tests/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import pandas as pd
from torch.utils.data import DataLoader
from aidsorb import data
from aidsorb._internal import _check_shape
from aidsorb.utils import pcd_from_dir
from aidsorb.transforms import Centering
from aidsorb.data import (
Expand Down
2 changes: 1 addition & 1 deletion tests/test_datamodules.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import os
import unittest
import tempfile
from itertools import combinations, product
from itertools import combinations
from torch.utils.data import RandomSampler, SequentialSampler
from aidsorb.utils import pcd_from_dir
from aidsorb.data import prepare_data, Collator
Expand Down
1 change: 0 additions & 1 deletion tests/test_litmodels.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"""

import doctest
import unittest
from aidsorb import litmodels


Expand Down
1 change: 0 additions & 1 deletion tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"""

import doctest
import unittest
from aidsorb import models


Expand Down
1 change: 0 additions & 1 deletion tests/test_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"""

import doctest
import unittest
from aidsorb import transforms


Expand Down

0 comments on commit 24891da

Please sign in to comment.