Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
b2983cc
Merge commit '9911380ebfd97d832990866f9af1ac440d68bc13'
Sangwon91 Dec 31, 2022
b296c95
Remove old setup and req
Sangwon91 Dec 31, 2022
f56778c
Fix typo
Sangwon91 Dec 31, 2022
8fc0eb0
Update readme
Sangwon91 Dec 31, 2022
748ac79
Update README.md
Sangwon91 Jan 1, 2023
0252c3c
Remove .
Sangwon91 Jan 1, 2023
3d36579
Add pre-commit to dependency
Sangwon91 Aug 1, 2023
d1fbe24
Apply pre-commit to improve code quality
Sangwon91 Aug 1, 2023
5978237
Apply formatting to database files
Sangwon91 Aug 1, 2023
2b0e354
Update readme
Sangwon91 Aug 1, 2023
fb251ae
Merge branch 'master' of https://github.com/Sangwon91/PORMAKE
Sangwon91 Aug 1, 2023
518f4e0
Update dependency and add an action for test
Sangwon91 Sep 7, 2023
dbdf425
Update action to run test on test branch
Sangwon91 Sep 7, 2023
26bf06a
Merge pull request #11 from Sangwon91/test
Sangwon91 Sep 7, 2023
eefe377
Update pormake version to publish
Sangwon91 Sep 7, 2023
bb5db2e
Update dependency
Sangwon91 Sep 24, 2023
b4264de
Split example into script and notebook
Sangwon91 Sep 24, 2023
f048635
Update gitignore for notebooks
Sangwon91 Sep 24, 2023
0567b70
Add dectructor
Sangwon91 Sep 24, 2023
c7015b1
Update decomposer
Sangwon91 Sep 24, 2023
204e9ad
Release version 0.2.0
Sangwon91 Sep 24, 2023
c196dbf
"added charges functionality"
aniruddha-seal Dec 18, 2023
6d4a396
added charge functionality
aniruddha-seal Dec 18, 2023
324a15a
Create test_charged.py
aniruddha-seal Dec 18, 2023
97d2a06
Merge pull request #21 from aniruddha-seal/with_charges
Sangwon91 Jan 13, 2024
ac4f094
Update for backward compatibility
Sangwon91 Jan 13, 2024
879e210
Update README and version
Sangwon91 Jan 13, 2024
5c95e25
Fix database bugs.
Sangwon91 Jun 27, 2024
d04960e
240806
geonho42 Aug 6, 2024
05b5d16
240806
geonho42 Aug 6, 2024
8e4ca22
240812-pormake_v2
geonho42 Aug 12, 2024
ab00fa0
240814
geonho42 Aug 14, 2024
da9eafb
240819
geonho42 Aug 19, 2024
6f6dc27
240827
geonho42 Aug 27, 2024
358f44a
240829
geonho42 Aug 29, 2024
fb494f5
240905
geonho42 Sep 5, 2024
55639fb
240924
geonho42 Sep 24, 2024
97613c9
240925
geonho42 Sep 25, 2024
b05dbd5
240930
geonho42 Sep 30, 2024
2ee827b
241007
geonho42 Oct 7, 2024
c030650
241122
geonho42 Nov 22, 2024
acf35b9
241125
geonho42 Nov 25, 2024
a46d6c6
241219
geonho42 Dec 19, 2024
f9c676b
241224
geonho42 Dec 24, 2024
5f1d517
241224
geonho42 Dec 24, 2024
86e6b5c
241224
geonho42 Dec 24, 2024
7ee8861
241226
geonho42 Dec 26, 2024
1e496ab
241226
geonho42 Dec 26, 2024
5d4ef0b
241226
geonho42 Dec 26, 2024
7eb62c6
241226
geonho42 Dec 26, 2024
db41b8c
241227
geonho42 Dec 27, 2024
f8e3004
250102
geonho42 Jan 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
31 changes: 31 additions & 0 deletions .github/workflows/pip-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This is a basic workflow to help you get started with Actions

name: Test for pip installation

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main", "test" ]
pull_request:
branches: [ "main" ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
ci:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
os: ["ubuntu-20.04", "ubuntu-22.04"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install PORMAKE using pip.
run: |
pip install -e .
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ dist
test*
*.log
*.pickle
*.log
*.log
.ipynb_checkpoints

working_area/
48 changes: 48 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
exclude: |
'\.csv$'
'\.lock$'
- id: trailing-whitespace
exclude: |
'\.csv$'
'\.lock$'
- repo: https://github.com/pycqa/isort
# Recent version of Poetry had a breaking
# change incompatible with isort <= 5.11.4.
rev: 5.12.0
hooks:
- id: isort
args: [
'--line-width=80',
# In order to use with black.
'--profile=black',
# '--multi-line=HANGING_INDENT'
]
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
args: [
'--line-length=80',
# Do not use double quotes.
'--skip-string-normalization'
]
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
# W503: This warning is generated when a line break
# occurs before a binary operator (such as + or -)
# E501: Try to respect --line-length,
# but don’t become crazy if you can’t.
# E203: whitespace before ':'.
# E402: module level import not at top of file.
# E741: ambiguous variable name.
args: ['--max-line-length=80', '--ignore=W503,E501,E203,E40,E741']
# __init__ frequently violate F401, F403.
exclude: '__init__'
121 changes: 85 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,62 @@
**Por**ous materials **Make**r

> Python library for the construction of porous materials using topology and building blocks.
>
> Please cite [me](https://pubs.acs.org/doi/abs/10.1021/acsami.1c02471) if you find it useful!
>
> [Please cite me if you find it useful!](https://pubs.acs.org/doi/abs/10.1021/acsami.1c02471)

Development Roadmap (updated 2024.12.20):
1. Change of project management tool: `poetry` to `uv`
1. Simple web application for the generation of porous materials
1. Enrich the code with descriptive docstrings.
1. Fortify the project by implementing comprehensive test code.
1. Development of an enhanced algorithm for improved placement of edge building blocks (considering symmetry).

## Release Note
#### New fork
[Repository URL](https://github.com/geonho42/PORMAKE)

This fork attempted to solve an issue in PORMAKE where, when generating Porous materials, linkers would be inserted with random rotation around the axis formed by two connection points. In addition, single metal node building blocks are added as an alternative to cluster building blocks, and corresponding organic linkers and organic node building blocks are added to generate porous materials with small pore sizes. For those who need this functionality, please refer to the [README](https://github.com/geonho42/PORMAKE/blob/main/example/script/pormake_v2/README.md) of this fork.

Thank you for your valuable contribution @geonho42 !

#### Version: `0.2.1`

**New feature added**: Building blocks with partial charge

The example can be found in [here](./example/notebook/test_charged.py).

Thank you for your valuable contribution @aniruddha-seal !

#### Version: `0.2.0`

**New feature added**: A module for extracting building blocks from MOFs

[MOF Decomposer README](./pormake/experimental/decomposer/README.md)

<image src="doc/decomposer.png" width="500px"></image>

## Installation
* Dependencies

```
python>=3.7
```
### 1. Using PIP

This method is only valid for Linux and macOS as `jax` supports those operating
systems. It is recommended to use WSL for Windows users.

```
jax[cpu]
pymatgen<2022
ase>=3.18.0
pip install pormake
```

1. Install all dependencies.
### 2. From source

**Warning: on Windows system, you have to install `jax` and `pymatgen` manually.**
```bash
$ pip install -r requirements.txt
#### 1. Directly install from Github repository
```
pip install git+https://github.com/Sangwon91/PORMAKE.git
```

2. Install `pormake` using `setup.py`

```bash
$ python setup.py install
#### 2. Editable installtion
```
git clone https://github.com/Sangwon91/PORMAKE.git
pip install -e PORMAKE
```

## Examples
Expand All @@ -54,7 +83,7 @@ You can check the information using `.describe()` method.
tbo.describe()
```

In this case, there are two node types (`0` and `1`) and one edge type (`(0, 1)`). `CN` in the node information indicates coordination number (number of adjacent nodes).
In this case, there are two node types (`0` and `1`) and one edge type (`(0, 1)`). `CN` in the node information indicates coordination number (number of adjacent nodes).

```
===============================================================================
Expand All @@ -79,7 +108,7 @@ Node type: 1, CN: 4
52, 53, 54, 55

-------------------------------------------------------------------------------
Edge type information (adjacent node types)
Edge type information (adjacent node types)
-------------------------------------------------------------------------------
Edge type: (0, 1)
slot indices: 56, 57, 58, 59, 60, 61, 62, 63, 64, 65
Expand Down Expand Up @@ -211,7 +240,7 @@ N13.view()

<img src="doc/N13.png" width=400>

Before the next step, you should know the equivalence of the following two approaches for MOF construction.
Before the next step, you should know the equivalence of the following two approaches for MOF construction.

```python
# Approach 1.
Expand Down Expand Up @@ -283,7 +312,7 @@ Node type: 0, CN: 6
slot indices: 0

-------------------------------------------------------------------------------
Edge type information (adjacent node types)
Edge type information (adjacent node types)
-------------------------------------------------------------------------------
Edge type: (0, 0)
slot indices: 1, 2, 3
Expand Down Expand Up @@ -313,7 +342,7 @@ Node type: 0, CN: 6
slot indices: 0, 1

-------------------------------------------------------------------------------
Edge type information (adjacent node types)
Edge type information (adjacent node types)
-------------------------------------------------------------------------------
Edge type: (0, 0)
slot indices: 2, 3, 4, 5, 6, 7
Expand Down Expand Up @@ -368,7 +397,7 @@ print("RMSD at pcu node type 0: %.2f" % pcu_rmsd_0)
RMSD at pcu node type 0: 0.42
```

In general, `RMSD < 0.3` is good threshold for the MOF constructions.
In general, `RMSD < 0.3` is good threshold for the MOF constructions.



Expand Down Expand Up @@ -399,7 +428,7 @@ Node type: 1, CN: 12
slot indices: 6, 7

-------------------------------------------------------------------------------
Edge type information (adjacent node types)
Edge type information (adjacent node types)
-------------------------------------------------------------------------------
Edge type: (0, 1)
slot indices: 8, 9, 10, 11, 12, 13, 14, 15, 16, 17
Expand Down Expand Up @@ -476,18 +505,18 @@ H 0.2000 2.3210 0.0000
X -0.7500 0.0000 0.0000
X 2.6850 -1.9831 0.0000
X 2.6850 1.9831 0.0000
0 1 A
0 5 A
1 2 A
1 6 S
2 3 A
3 4 A
3 7 S
4 5 A
5 8 S
9 0 S
10 2 S
11 4 S
0 1 A
0 5 A
1 2 A
1 6 S
2 3 A
3 4 A
3 7 S
4 5 A
5 8 S
9 0 S
10 2 S
11 4 S
```

The first two columns are the indices of atoms consisting the bond and the third term is bond type.
Expand All @@ -499,3 +528,23 @@ You can load building block using `BuilingBlock` object like below:
```python
bb = pm.BuildingBlock('N10.xyz')
```

## Contributions
This project is managed through [`uv`](https://docs.astral.sh/uv/). It is strongly recommended to use `uv` for development. Additionally, support for Python versions below `3.10` will be discontinued in the future, so it is recommended to use Python `3.10` or higher. Below are examples of commands used when developing with `uv`.

### 1. Install required libraries
```bash
git clone [this repository]
cd [this repository]
uv sync
```

### 2. Apply pre-commit before commit
```bash
uvx pre-commit
```

### 3. Install new libraries for new functionalities
```bash
uv add [library name]
```
Binary file added doc/cgdfile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/decomposer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/linker_representer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/spacegroup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions example/notebook/bbs/N10_charged.xyz
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
12
9 10 11
C 0.0000 0.0000 0.0000 1.0
C 0.7700 -1.3336 0.0000 1.0
C 2.3100 -1.3336 0.0000 1.0
C 3.0800 0.0000 0.0000 1.0
C 2.3100 1.3336 0.0000 1.0
C 0.7700 1.3336 0.0000 1.0
H 0.2000 -2.3210 0.0000 1.0
H 4.2200 0.0000 0.0000 1.0
H 0.2000 2.3210 0.0000 1.0
X -0.7500 0.0000 0.0000 1.0
X 2.6850 -1.9831 0.0000 1.0
X 2.6850 1.9831 0.0000 1.0
0 1 A
0 5 A
1 2 A
1 6 S
2 3 A
3 4 A
3 7 S
4 5 A
5 8 S
9 0 S
10 2 S
11 4 S
41 changes: 41 additions & 0 deletions example/notebook/bbs/N409_charged.xyz
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
18
14 15 16 17
C 0.0000 0.0000 0.0000 1.0
Cu -1.8618 0.8155 2.1384 1.0
O -0.1268 0.3884 1.1811 1.0
O -0.9831 -0.2434 -0.6786 1.0
Cu -2.8696 0.0122 -0.1863 1.0
C -4.7314 0.8278 1.9522 1.0
O -2.0437 -1.0793 2.6799 1.0
O -2.8721 -1.7284 0.6772 1.0
C -2.4575 -1.9107 1.8525 1.0
C -2.2739 2.7384 0.0996 1.0
O -3.7483 1.0711 2.6308 1.0
O -4.6046 0.4394 0.7710 1.0
O -2.6877 1.9070 -0.7277 1.0
O -1.8593 2.5562 1.2750 1.0
X 0.7704 0.1533 -0.1604 1.0
X -5.5018 0.6744 2.1126 1.0
X -2.4733 -2.6871 1.8980 1.0
X -2.2581 3.5149 0.0541 1.0
0 2 A
0 3 A
0 14 S
1 2 S
1 4 S
1 6 S
1 10 S
1 13 S
3 4 S
4 7 S
4 11 S
4 12 S
5 10 A
5 11 A
5 15 S
6 8 A
7 8 A
8 16 S
9 12 A
9 13 A
9 17 S
Loading