Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions: Let's turn ruff green again #53

Merged
merged 4 commits into from
Oct 8, 2023
Merged
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
16 changes: 8 additions & 8 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# This workflow will install Python dependencies, run tests, and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: PACKMAN Contineous Integration
name: PACKMAN Continuous Integration

on:
push:
Expand All @@ -13,20 +13,20 @@ jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: pip install --user ruff
- run: ruff --exit-zero --line-length=1100 --target-version=py37 --statistics . | sort -k 2
- run: ruff --ignore=E402,E701,E722,E741,F401,F403,F841
--format=github --line-length=1100 --target-version=py37 .
- run: ruff --exit-zero --line-length=320 --target-version=py38 --statistics . | sort -k 2
- run: ruff --ignore=E402,E501,E701,E722,E741,F401,F403,F841
--output-format=github --target-version=py38 .

build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion packman/molecule/atom.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def get_bond(self,atom2):
"""
if(type(atom2) == type(self)):
None
elif(type(atom2) ==int):
elif(isinstance(atom2, int)):
Model = self.get_parent().get_parent().get_parent()
atom2 = Model.get_atom(atom2)
else:
Expand Down
10 changes: 5 additions & 5 deletions packman/molecule/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,15 +320,15 @@ def get_torsion(self, bond, neighbor1=None, neighbor2=None, radians=True):
logging.error('neighbour2 not selected. Options available for neighbour2: ' + ', '.join( [str(i) for i in self.__ModelGraph[atom2.get_id()] if i != atom1.get_id() ] ) )
return None

if(type(neighbor1)==int):
if(isinstance(neighbor1, int)):
neighbor1 = self.__AllAtoms[neighbor1]
elif(type(neighbor1)==type(atom1)):
None
else:
logging.error('neighbour1 should either be an integer or a packman.molecule.Atom object.')
return None

if(type(neighbor2)==int):
if(isinstance(neighbor2, int)):
neighbor2 = self.__AllAtoms[neighbor2]
elif(type(neighbor2)==type(atom2)):
None
Expand Down Expand Up @@ -448,15 +448,15 @@ def set_torsion(self, bond, theta, neighbor1=None, neighbor2=None, radians=True)
logging.error('neighbour2 not selected. Options available for neighbour2: ' + ', '.join( [str(i) for i in self.__ModelGraph[atom2.get_id()] if i != atom1.get_id() ] ) )
return None

if(type(neighbor1)==int):
if(isinstance(neighbor1, int)):
neighbor1 = self.__AllAtoms[neighbor1]
elif(type(neighbor1)==type(atom1)):
None
else:
logging.error('neighbour1 should either be an integer or a packman.molecule.Atom object.')
return None

if(type(neighbor2)==int):
if(isinstance(neighbor2, int)):
neighbor2 = self.__AllAtoms[neighbor2]
elif(type(neighbor2)==type(atom2)):
None
Expand Down Expand Up @@ -718,4 +718,4 @@ def check_clashes(self,distance=0.77):
from scipy.spatial import KDTree
all_atoms=[i for i in self.get_atoms()]
T=KDTree([i.get_location() for i in all_atoms])
return len(T.query_pairs(distance))
return len(T.query_pairs(distance))