Skip to content

Commit

Permalink
Merge branch 'tanghaibao:main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Adamtaranto authored Dec 26, 2024
2 parents aef18d5 + 756adc1 commit b37a74a
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 5 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/Black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Black Formatting
on: [pull_request]
jobs:
black:
if: ${{ github.actor != 'dependabot[bot]' }} # Do not run on commits created by dependabot
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the changed files.
contents: write # Allows reading and writing repository contents (e.g., commits)
pull-requests: write # Allows reading and writing pull requests
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Black Code Formatter
uses: psf/black@stable
with:
options: "--verbose"
src: "."

- name: Commit changes
if: success()
uses: stefanzweifel/git-auto-commit-action@v5
id: auto-commit-action
with:
commit_message: 'Style fixes by Black'
4 changes: 1 addition & 3 deletions jcvi/formats/gff.py
Original file line number Diff line number Diff line change
Expand Up @@ -2850,9 +2850,7 @@ def note(args):
continue
if AED is not None and float(g.attributes["_AED"][0]) > AED:
continue
keyval = [g.accn] + [
",".join(g.attributes.get(x, ["nan"])) for x in attrib
]
keyval = [g.accn] + [",".join(g.attributes.get(x, ["nan"])) for x in attrib]
if exoncounts:
nexons = exoncounts.get(g.accn, 0)
keyval.append(str(nexons))
Expand Down
1 change: 1 addition & 0 deletions tests/formats/test_bed.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from jcvi.formats.bed import summary


def test_summary():
cwd = os.getcwd()
os.chdir(op.join(op.dirname(__file__), "data"))
Expand Down
1 change: 1 addition & 0 deletions tests/formats/test_cblast_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import pytest
import time


# Benchmark cblast vs blast module
@pytest.mark.benchmark(
group="CBlastLine vs PyBlastLine", timer=time.time, disable_gc=True, warmup=False
Expand Down
2 changes: 1 addition & 1 deletion tests/graphics/test_grabseeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_main():
# Test calibrate
json_file = "calibrate.json"
cleanup(json_file, output_image)
json_file = calibrate(["calibrate.JPG", "1"]) # `1` for the boxsize arg
json_file = calibrate(["calibrate.JPG", "1"]) # `1` for the boxsize arg
assert op.exists(json_file)
seeds(["test.JPG", "--calibrate", json_file])

Expand Down
2 changes: 1 addition & 1 deletion tests/utils/test_range.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,4 +212,4 @@ def test_range_conflict(ranges, expected):
def test_range_chain(ranges, expected):
from jcvi.utils.range import range_chain

assert range_chain(ranges) == expected
assert range_chain(ranges) == expected

0 comments on commit b37a74a

Please sign in to comment.