Skip to content

Commit

Permalink
refactor: cat is fluid
Browse files Browse the repository at this point in the history
  • Loading branch information
Cloudac7 committed Nov 20, 2023
1 parent ea2f026 commit a076b5b
Show file tree
Hide file tree
Showing 58 changed files with 88 additions and 88 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ on:
- 'master'
- 'dev'
paths:
- catalyner/**
- catflow/**
- tests/**
- .github/workflows/ci.yml
- pyproject.toml
- poetry.lock
pull_request:
paths:
- catalyner/**
- catflow/**
- tests/**
- .github/workflows/ci.yml
- pyproject.toml
Expand Down Expand Up @@ -52,6 +52,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
poetry run coverage run --source=./catalyner -m pytest -v tests/
poetry run coverage run --source=./catflow -m pytest -v tests/
poetry run coverage report
poetry run coveralls --service=github
2 changes: 1 addition & 1 deletion .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- docs/**
- README.md
- mkdocs.yml
- catalyner/**
- catflow/**
- .github/workflows/deploy_docs.yml
jobs:
deploy:
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Catlyner

[![Python package](https://github.com/Cloudac7/catalyner/actions/workflows/ci.yml/badge.svg)](https://github.com/Cloudac7/catalyner/actions/workflows/ci.yml)
[![Coverage Status](https://coveralls.io/repos/github/Cloudac7/catalyner/badge.svg?branch=master)](https://coveralls.io/github/Cloudac7/catalyner?branch=master)
[![Python package](https://github.com/Cloudac7/catflow/actions/workflows/ci.yml/badge.svg)](https://github.com/Cloudac7/catflow/actions/workflows/ci.yml)
[![Coverage Status](https://coveralls.io/repos/github/Cloudac7/catflow/badge.svg?branch=master)](https://coveralls.io/github/Cloudac7/catflow?branch=master)


Machine learning aided catalysis reaction free energy calculation and post-analysis workflow, thus, analyzer for catalysis.

Mainly developed on MacOS Catalina.
As is known to all, cat is fluid and thus cat flows. 🐱

> Former Miko-Analyzer
Expand All @@ -15,13 +15,13 @@ Mainly developed on MacOS Catalina.
To install, clone the repository:

```
git clone https://github.com/cloudac7/catalyner.git
git clone https://github.com/cloudac7/catflow.git
```

and then install with `pip`:

```
cd catalyner
cd catflow
pip install .
```

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion catalyner/__main__.py → catflow/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sys

if __name__ == '__main__':
from catalyner.cmdline.base import cli
from catflow.cmdline.base import cli
sys.exit(cli())
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion catalyner/cmdline/base.py → catflow/cmdline/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from importlib.metadata import entry_points


entries = entry_points().get('catalyner.cmdline', [])
entries = entry_points().get('catflow.cmdline', [])
if entries != []:
entries_cli = [i.load() for i in entries]
else:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions catalyner/metad/fes.py → catflow/metad/fes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
from numpy.typing import ArrayLike
from matplotlib.colors import Colormap

from catalyner.metad.hills import Hills
from catalyner.graph.plotting import canvas_style
from catalyner.utils.log_factory import logger
from catflow.metad.hills import Hills
from catflow.graph.plotting import canvas_style
from catflow.utils.log_factory import logger


class FreeEnergySurface:
Expand All @@ -20,7 +20,7 @@ class FreeEnergySurface:
Usage:
```python
from catalyner.metad.fes import FreeEnergySurface
from catflow.metad.fes import FreeEnergySurface
fes = FreeEnergySurface(hills)
```
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions catalyner/metad/profile.py → catflow/metad/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from typing import List, Optional, Union
from matplotlib.colors import Colormap

from catalyner.graph.plotting import canvas_style
from catalyner.metad.fes import FreeEnergySurface
from catalyner.metad.hills import Hills
from catflow.graph.plotting import canvas_style
from catflow.metad.fes import FreeEnergySurface
from catflow.metad.hills import Hills


class FreeEnergyProfile:
Expand Down
4 changes: 2 additions & 2 deletions catalyner/metad/string.py → catflow/metad/string.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
from scipy.interpolate import Rbf, griddata, interp1d, RegularGridInterpolator
from typing import Literal, List, Union, Tuple, Optional

from catalyner.utils import logger
from catalyner.metad.fes import FreeEnergySurface
from catflow.utils import logger
from catflow.metad.fes import FreeEnergySurface


class StringMethod:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from MDAnalysis import Universe


from catalyner.structure.lindemann_index import LindemannIndex
from catflow.structure.lindemann_index import LindemannIndex


class Cluster(object):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class AxisMaxDistance(AnalysisBase):
Examples:
>>> import MDAnalysis as mda
>>> from catalyner.structure.dynamic_selection import AxisMaxDistance
>>> from catflow.structure.dynamic_selection import AxisMaxDistance
>>> u = mda.Universe("system.gro", "system.trr")
>>> ag1 = u.select_atoms("protein")
>>> ag2 = u.select_atoms("resname LIG")
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

import numpy as np

from catalyner.utils.log_factory import logger
from catalyner.utils.lammps import lammps_variable_parser
from catalyner.tesla.base.exploration import ExplorationAnalyzer
from catalyner.tesla.ai2_kit.task import CllAnalyzer
from catflow.utils.log_factory import logger
from catflow.utils.lammps import lammps_variable_parser
from catflow.tesla.base.exploration import ExplorationAnalyzer
from catflow.tesla.ai2_kit.task import CllAnalyzer


def read_model_deviation(model_devi_path: Path):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import re

from catalyner.tesla.base.labeling import LabelingAnalyzer
from catalyner.tesla.ai2_kit.task import CllAnalyzer
from catalyner.graph.plotting import canvas_style
from catflow.tesla.base.labeling import LabelingAnalyzer
from catflow.tesla.ai2_kit.task import CllAnalyzer
from catflow.graph.plotting import canvas_style


class CllLabelingAnalyzer(LabelingAnalyzer, CllAnalyzer):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from ai2_kit.core.checkpoint import set_checkpoint_file
from ai2_kit.workflow.cll_mlp import CllWorkflowConfig

from catalyner.tesla.base.task import BaseTask, BaseAnalyzer
from catflow.tesla.base.task import BaseTask, BaseAnalyzer


class CllTask(BaseTask):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import numpy as np
from matplotlib import pyplot as plt

from catalyner.utils import logger
from catalyner.graph.plotting import canvas_style
from catalyner.tesla.base.training import TrainingAnalyzer
from catalyner.tesla.ai2_kit.task import CllAnalyzer, CllTask
from catflow.utils import logger
from catflow.graph.plotting import canvas_style
from catflow.tesla.base.training import TrainingAnalyzer
from catflow.tesla.ai2_kit.task import CllAnalyzer, CllTask


class CllTrainingAnalyzer(TrainingAnalyzer, CllAnalyzer):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
import seaborn as sns
from matplotlib import pyplot as plt

from catalyner.utils.log_factory import logger
from catalyner.graph.plotting import canvas_style, square_grid
from catalyner.tesla.base.task import BaseAnalyzer
from catflow.utils.log_factory import logger
from catflow.graph.plotting import canvas_style, square_grid
from catflow.tesla.base.task import BaseAnalyzer


def read_model_deviation(model_devi_path: Path):
Expand Down Expand Up @@ -251,7 +251,7 @@ def plot_single_iteration(
kwargs (_type_, optional): Additional keyword arguments. Include other params, such as:
`temps`: please use the value of `group_by`, whose default input is `"temps"`.
`label_unit`: the unit of `select_value`, such as 'Å'.
Parameters of `canvas_style`: please refer to `catalyner.graph.plotting.canvas_style`.
Parameters of `canvas_style`: please refer to `catflow.graph.plotting.canvas_style`.
Returns:
Figure: A plot for different desired values.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
from ase.io import read
from matplotlib import pyplot as plt

from catalyner.utils.log_factory import logger
from catalyner.utils.log_factory import LogFactory
from catalyner.tesla.base.task import BaseTask, BaseAnalyzer
from catalyner.graph.plotting import canvas_style
from catflow.utils.log_factory import logger
from catflow.utils.log_factory import LogFactory
from catflow.tesla.base.task import BaseTask, BaseAnalyzer
from catflow.graph.plotting import canvas_style



Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import numpy as np
from matplotlib import pyplot as plt

from catalyner.utils import logger
from catalyner.graph.plotting import canvas_style
from catalyner.tesla.base.task import BaseAnalyzer, BaseTask
from catflow.utils import logger
from catflow.graph.plotting import canvas_style
from catflow.tesla.base.task import BaseAnalyzer, BaseTask


class TrainingAnalyzer(BaseAnalyzer):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
import numpy as np
from matplotlib import pyplot as plt

from catalyner.utils.log_factory import logger
from catalyner.graph.plotting import canvas_style, square_grid
from catalyner.tesla.base.exploration import ExplorationAnalyzer, PlottingExploartion
from catalyner.tesla.dpgen.task import DPAnalyzer
from catflow.utils.log_factory import logger
from catflow.graph.plotting import canvas_style, square_grid
from catflow.tesla.base.exploration import ExplorationAnalyzer, PlottingExploartion
from catflow.tesla.dpgen.task import DPAnalyzer


class DPExplorationAnalyzer(ExplorationAnalyzer, DPAnalyzer):
Expand Down Expand Up @@ -95,7 +95,7 @@ def plot_single_iteration(
kwargs (_type_, optional): Additional keyword arguments. Include other params, such as:
`temps`: please use the value of `group_by`, whose default input is `"temps"`.
`label_unit`: the unit of `select_value`, such as 'Å'.
Parameters of `canvas_style`: please refer to `catalyner.graph.plotting.canvas_style`.
Parameters of `canvas_style`: please refer to `catflow.graph.plotting.canvas_style`.
Returns:
Figure: A plot for different desired values.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Optional

from catalyner.tesla.base.labeling import LabelingAnalyzer
from catalyner.tesla.dpgen.task import DPTask, DPAnalyzer
from catflow.tesla.base.labeling import LabelingAnalyzer
from catflow.tesla.dpgen.task import DPTask, DPAnalyzer


class DPLabelingAnalyzer(LabelingAnalyzer, DPAnalyzer):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from pathlib import Path
from typing import Optional

from catalyner.tesla.base.task import BaseTask, BaseAnalyzer
from catflow.tesla.base.task import BaseTask, BaseAnalyzer


class DPTask(BaseTask):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import numpy as np
from matplotlib import pyplot as plt

from catalyner.utils import logger
from catalyner.graph.plotting import canvas_style
from catalyner.tesla.base.training import TrainingAnalyzer
from catalyner.tesla.dpgen.task import DPAnalyzer
from catflow.utils import logger
from catflow.graph.plotting import canvas_style
from catflow.tesla.base.training import TrainingAnalyzer
from catflow.tesla.dpgen.task import DPAnalyzer

class DPTrainingAnalyzer(TrainingAnalyzer, DPAnalyzer):
"""Analyzer for training tasks.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class LogFactory(object):
"""
For logging
"""
def __init__(self, logger=None, log_dir=None, log_name="catalyner.log"):
def __init__(self, logger=None, log_dir=None, log_name="catflow.log"):
self.log_path = Path.cwd() if log_dir is None else Path(log_dir)
self.logger = logging.getLogger(logger)
self.logger.setLevel(logging.DEBUG)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/Usage/cluster_structures.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
其他的参数请以可选参数形式传入。

```python
from catalyner.structure.cluster import Cluster
from catflow.structure.cluster import Cluster

trajfile = "./dump.lammpstrj"
c = Cluster(trajfile, topology_format="LAMMPSDUMP", dt=0.0005)
Expand Down
6 changes: 3 additions & 3 deletions docs/Usage/dpgen_analysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
首先,导入环境:

```python
from catalyner.tesla.dpgen import DPTask
from catflow.tesla.dpgen import DPTask
```

加载DP-GEN工作目录:
Expand All @@ -26,7 +26,7 @@ t = DPTask(
导入分析器(`DPAnalyzer`),这里我们选择训练,即:

```python
from catalyner.tesla.dpgen.training import DPTrainingAnalyzer
from catflow.tesla.dpgen.training import DPTrainingAnalyzer
```

从任务初始化分析器实例:
Expand All @@ -51,7 +51,7 @@ fig.set_size_inches((12,12))
类似地,我们也可以对模型的model deviation分布进行分析:

```python
from catalyner.tesla.dpgen.exploration import DPExplorationAnalyzer
from catflow.tesla.dpgen.exploration import DPExplorationAnalyzer
ana = DPExplorationAnalyzer(t)
```

Expand Down
8 changes: 4 additions & 4 deletions docs/Usage/metadyn.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"metadata": {},
"outputs": [],
"source": [
"from catalyner.metad.hills import Hills"
"from catflow.metad.hills import Hills"
]
},
{
Expand Down Expand Up @@ -93,7 +93,7 @@
"metadata": {},
"outputs": [],
"source": [
"from catalyner.metad.fes import FreeEnergySurface\n",
"from catflow.metad.fes import FreeEnergySurface\n",
"\n",
"# do sum_hills\n",
"fes = FreeEnergySurface.from_hills(h2, resolution=256)"
Expand Down Expand Up @@ -447,7 +447,7 @@
}
],
"source": [
"from catalyner.metad.profile import FreeEnergyProfile\n",
"from catflow.metad.profile import FreeEnergyProfile\n",
"fe_profile = FreeEnergyProfile(fes, h2)\n",
"fe_profile.plot(energy_unit=\"kJ/mol\", cmap=\"viridis\", style='ticks', context='notebook')"
]
Expand All @@ -472,7 +472,7 @@
"metadata": {},
"outputs": [],
"source": [
"#from catalyner.metad.string import StringMethod\n",
"#from catflow.metad.string import StringMethod\n",
"s = StringMethod(fes)"
]
},
Expand Down
2 changes: 1 addition & 1 deletion docs/gen_ref.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

nav = mkdocs_gen_files.Nav()

for path in sorted(Path("catalyner").glob("**/*.py")):
for path in sorted(Path("catflow").glob("**/*.py")):
module_path = path.relative_to(".").with_suffix("")
doc_path = path.relative_to(".").with_suffix(".md")
full_doc_path = Path("reference", doc_path)
Expand Down
Loading

0 comments on commit a076b5b

Please sign in to comment.