Skip to content

Commit

Permalink
merge and fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjonesBSU committed Aug 19, 2024
2 parents 09f8dcf + 30c6d3d commit 665b5ef
Show file tree
Hide file tree
Showing 23 changed files with 160 additions and 399 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
shell: bash -l {0}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
name: Checkout Branch / Pull Request

- name: Install Mamba (Linux)
Expand All @@ -42,7 +42,7 @@ jobs:
run: python -m pytest -v -nauto --cov=foyer --cov-report=xml --cov-append --cov-config=setup.cfg --color yes --pyargs foyer

- name: Upload Coverage Report
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v4
with:
name: Foyer-Coverage
verbose: true
Expand All @@ -63,7 +63,7 @@ jobs:
shell: bash -l {0}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
name: Checkout Branch / Pull Request

- name: Install Mamba (Linux)
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
shell: bash -l {0}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
name: Checkout Branch / Pull Request

- name: Install Mamba
Expand Down
23 changes: 11 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,26 @@ ci:
skip: []
submodules: false
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.5.7
hooks:
# Run the linter.
- id: ruff
args: [--line-length=80, --fix]
# Run the formatter.
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
exclude: 'setup.cfg'
- repo: https://github.com/psf/black
rev: 24.8.0
hooks:
- id: black
args: [--line-length=80]
exclude: 'setup.cfg|foyer/tests/files/.*'
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
args: [--profile=black, --line-length=80]
- repo: https://github.com/pycqa/pydocstyle
rev: '6.3.0'
hooks:
- id: pydocstyle
exclude: ^(foyer/tests/|docs/|devtools/|setup.py)
args: [--convention=numpy]
exclude: "foyer/tests/files/.*"
5 changes: 2 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
import pathlib
import sys

import sphinx_rtd_theme

sys.path.insert(0, os.path.abspath("../.."))
sys.path.insert(0, os.path.abspath("sphinxext"))

base_path = pathlib.Path(__file__).parent
os.system("python {} --name".format((base_path / "../../setup.py").resolve()))


import foyer

# -- Project information -----------------------------------------------------

project = "foyer"
Expand Down Expand Up @@ -147,7 +147,6 @@
# a list of builtin themes.
#
# html_theme = 'alabaster'
import sphinx_rtd_theme

html_theme = "sphinx_rtd_theme"
hhtml_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
Expand Down
1 change: 0 additions & 1 deletion environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dependencies:
- parmed>=3.4.3
- ele
- openff-toolkit >=0.11
- gmso
- pip
- pre-commit
- pytest
Expand Down
16 changes: 4 additions & 12 deletions foyer/atomtyper.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ def find_atomtypes(structure, forcefield, max_iter=10):
topology_graph = TopologyGraph.from_gmso_topology(structure)

if isinstance(forcefield, Forcefield):
atomtype_rules = AtomTypingRulesProvider.from_foyer_forcefield(
forcefield
)
atomtype_rules = AtomTypingRulesProvider.from_foyer_forcefield(forcefield)
elif isinstance(forcefield, AtomTypingRulesProvider):
atomtype_rules = forcefield
else:
Expand Down Expand Up @@ -110,9 +108,7 @@ def find_atomtypes(structure, forcefield, max_iter=10):
atomic_number = atom_data.atomic_number
atomic_symbol = atom_data.element
try:
element_from_num = ele.element_from_atomic_number(
atomic_number
).symbol
element_from_num = ele.element_from_atomic_number(atomic_number).symbol
element_from_sym = ele.element_from_symbol(atomic_symbol).symbol
assert element_from_num == element_from_sym
system_elements.add(element_from_num)
Expand Down Expand Up @@ -210,13 +206,9 @@ def _iterate_rules(rules, topology_graph, typemap, max_iter):

def _resolve_atomtypes(topology_graph, typemap):
"""Determine the final atomtypes from the white- and blacklists."""
atoms = {
atom_idx: data for atom_idx, data in topology_graph.atoms(data=True)
}
atoms = {atom_idx: data for atom_idx, data in topology_graph.atoms(data=True)}
for atom_id, atom in typemap.items():
atomtype = [
rule_name for rule_name in atom["whitelist"] - atom["blacklist"]
]
atomtype = [rule_name for rule_name in atom["whitelist"] - atom["blacklist"]]
if len(atomtype) == 1:
atom["atomtype"] = atomtype[0]
elif len(atomtype) > 1:
Expand Down
Loading

0 comments on commit 665b5ef

Please sign in to comment.