Skip to content

Commit

Permalink
Flake 8 bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
gbayarri committed Jan 8, 2025
1 parent e2b8837 commit f3c8dd8
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 77 deletions.
90 changes: 45 additions & 45 deletions .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,60 +13,60 @@ jobs:
python-version: ["3.10"]
runs-on: ${{ matrix.os }}
steps:
# - name: Check out repository code
# uses: actions/checkout@v4
- name: Check out repository code
uses: actions/checkout@v4

# - run: echo "Repository -> ${{ github.repository }}"
# - run: echo "Branch -> ${{ github.ref }}"
# - run: echo "Trigger event -> ${{ github.event_name }}"
# - run: echo "Runner OS -> ${{ runner.os }}"
- run: echo "Repository -> ${{ github.repository }}"
- run: echo "Branch -> ${{ github.ref }}"
- run: echo "Trigger event -> ${{ github.event_name }}"
- run: echo "Runner OS -> ${{ runner.os }}"

# - name: List files in the repository
# run: |
# ls ${{ github.workspace }}
- name: List files in the repository
run: |
ls ${{ github.workspace }}
# - name: Remove all micromamba installations
# run: |
# rm -rf $HOME/.bash_profile $HOME/.conda $HOME/micromamba $HOME/micromamba-bin 2>/dev/null
# touch $HOME/.bash_profile
- name: Remove all micromamba installations
run: |
rm -rf $HOME/.bash_profile $HOME/.conda $HOME/micromamba $HOME/micromamba-bin 2>/dev/null
touch $HOME/.bash_profile
# - name: setup-micromamba
# uses: mamba-org/[email protected]
# with:
# generate-run-shell: true
# micromamba-version: '2.0.2-2'
# post-cleanup: 'all'
# init-shell: bash
# environment-file: .github/env.yaml
# create-args: >-
# python=${{ matrix.python-version }}
# pytest
# pytest-cov
# pytest-html
# flake8
# pip
- name: setup-micromamba
uses: mamba-org/[email protected]
with:
generate-run-shell: true
micromamba-version: '2.0.2-2'
post-cleanup: 'all'
init-shell: bash
environment-file: .github/env.yaml
create-args: >-
python=${{ matrix.python-version }}
pytest
pytest-cov
pytest-html
flake8
pip
# - name: List installed package versions
# shell: bash -l {0}
# run: micromamba list
- name: List installed package versions
shell: bash -l {0}
run: micromamba list

# - name: Checkout biobb_common
# uses: actions/checkout@v4
# with:
# repository: bioexcel/biobb_common
# path: './biobb_common'
- name: Checkout biobb_common
uses: actions/checkout@v4
with:
repository: bioexcel/biobb_common
path: './biobb_common'

# - name: Run tests
# shell: bash -l {0}
# run: |
# # Ignoring docker and singularity tests
# export PYTHONPATH=.:./biobb_common:$PYTHONPATH
- name: Run tests
shell: bash -l {0}
run: |
# Ignoring docker and singularity tests
export PYTHONPATH=.:./biobb_common:$PYTHONPATH
# # Create directory for tests reports
# mkdir -p ./reports/junit
# Create directory for tests reports
mkdir -p ./reports/junit
# # Production one
# pytest biobb_analysis/test/unitests/ --ignore-glob=*container.py --ignore-glob=*docker.py --ignore-glob=*singularity.py
# Production one
pytest biobb_analysis/test/unitests/ --ignore-glob=*container.py --ignore-glob=*docker.py --ignore-glob=*singularity.py
# Notify user about test results
- name: Comment on PR
Expand Down
48 changes: 16 additions & 32 deletions biobb_analysis/gromacs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,11 @@ def check_energy_path(path, out_log, classname):
file_extension = PurePath(path).suffix
if not is_valid_energy(file_extension[1:]):
fu.log(
classname
+ ": Format %s in energy input file is not compatible" % file_extension[1:],
classname + ": Format %s in energy input file is not compatible" % file_extension[1:],
out_log,
)
raise SystemExit(
classname
+ ": Format %s in energy input file is not compatible" % file_extension[1:]
classname + ": Format %s in energy input file is not compatible" % file_extension[1:]
)
# if file input has no path, add cwd because execution is launched on tmp folder
if PurePath(path).name == path or not PurePath(path).is_absolute():
Expand All @@ -70,14 +68,12 @@ def check_input_path(path, out_log, classname):
file_extension = PurePath(path).suffix
if not is_valid_structure(file_extension[1:]):
fu.log(
classname
+ ": Format %s in structure input file is not compatible"
classname + ": Format %s in structure input file is not compatible"
% file_extension[1:],
out_log,
)
raise SystemExit(
classname
+ ": Format %s in structure input file is not compatible"
classname + ": Format %s in structure input file is not compatible"
% file_extension[1:]
)
# if file input has no path, add cwd because execution is launched on tmp folder
Expand All @@ -93,13 +89,11 @@ def check_index_path(path, out_log, classname):
file_extension = PurePath(path).suffix
if not is_valid_index(file_extension[1:]):
fu.log(
classname
+ ": Format %s in index input file is not compatible" % file_extension[1:],
classname + ": Format %s in index input file is not compatible" % file_extension[1:],
out_log,
)
raise SystemExit(
classname
+ ": Format %s in index input file is not compatible" % file_extension[1:]
classname + ": Format %s in index input file is not compatible" % file_extension[1:]
)
# if file input has no path, add cwd because execution is launched on tmp folder
if PurePath(path).name == path or not PurePath(path).is_absolute():
Expand All @@ -115,14 +109,12 @@ def check_traj_path(path, out_log, classname):
file_extension = PurePath(path).suffix
if not is_valid_trajectory(file_extension[1:]):
fu.log(
classname
+ ": Format %s in trajectory input file is not compatible"
classname + ": Format %s in trajectory input file is not compatible"
% file_extension[1:],
out_log,
)
raise SystemExit(
classname
+ ": Format %s in trajectory input file is not compatible"
classname + ": Format %s in trajectory input file is not compatible"
% file_extension[1:]
)
# if file input has no path, add cwd because execution is launched on tmp folder
Expand All @@ -139,13 +131,11 @@ def check_out_xvg_path(path, out_log, classname):
file_extension = PurePath(path).suffix
if not is_valid_xvg(file_extension[1:]):
fu.log(
classname
+ ": Format %s in output file is not compatible" % file_extension[1:],
classname + ": Format %s in output file is not compatible" % file_extension[1:],
out_log,
)
raise SystemExit(
classname
+ ": Format %s in output file is not compatible" % file_extension[1:]
classname + ": Format %s in output file is not compatible" % file_extension[1:]
)
return path

Expand All @@ -158,13 +148,11 @@ def check_out_pdb_path(path, out_log, classname):
file_extension = PurePath(path).suffix
if not is_valid_structure(file_extension[1:]):
fu.log(
classname
+ ": Format %s in output file is not compatible" % file_extension[1:],
classname + ": Format %s in output file is not compatible" % file_extension[1:],
out_log,
)
raise SystemExit(
classname
+ ": Format %s in output file is not compatible" % file_extension[1:]
classname + ": Format %s in output file is not compatible" % file_extension[1:]
)
return path

Expand All @@ -177,13 +165,11 @@ def check_out_traj_path(path, out_log, classname):
file_extension = PurePath(path).suffix
if not is_valid_trajectory_output(file_extension[1:]):
fu.log(
classname
+ ": Format %s in output file is not compatible" % file_extension[1:],
classname + ": Format %s in output file is not compatible" % file_extension[1:],
out_log,
)
raise SystemExit(
classname
+ ": Format %s in output file is not compatible" % file_extension[1:]
classname + ": Format %s in output file is not compatible" % file_extension[1:]
)
return path

Expand All @@ -196,13 +182,11 @@ def check_out_str_ens_path(path, out_log, classname):
file_extension = PurePath(path).suffix
if not is_valid_zip(file_extension[1:]):
fu.log(
classname
+ ": Format %s in output file is not compatible" % file_extension[1:],
classname + ": Format %s in output file is not compatible" % file_extension[1:],
out_log,
)
raise SystemExit(
classname
+ ": Format %s in output file is not compatible" % file_extension[1:]
classname + ": Format %s in output file is not compatible" % file_extension[1:]
)
return path

Expand Down

0 comments on commit f3c8dd8

Please sign in to comment.