Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #53 from fusion-energy/develop
Browse files Browse the repository at this point in the history
upgrading the automatic pep8 formatting
  • Loading branch information
shimwell authored Nov 22, 2021
2 parents f34321b + 375d13d commit a6fa763
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 35 deletions.
24 changes: 0 additions & 24 deletions .github/workflows/autopep8.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: black

on:
push:
paths:
- '**.py'

defaults:
run:
shell: bash

jobs:
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Install black
run: |
python -m pip install --upgrade pip
pip install black
- name: Run black
run: |
black .
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "[skip ci] Apply formatting changes"
6 changes: 3 additions & 3 deletions cad_to_h5m/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ def cad_to_h5m(
cubit,
verbose,
)
#resets cubit workspace

# resets cubit workspace
cubit.cmd('reset')

return h5m_filename


Expand Down
12 changes: 4 additions & 8 deletions tests/test_python_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ def test_h5m_file_creation(self):
"""Checks that a h5m file is created from stp files when make_watertight
is set to false"""

os.system("rm test_dagmc.h5m")

test_h5m_filename = "test_dagmc.h5m"
os.system(f"rm {test_h5m_filename}")

returned_filename = cad_to_h5m(
files_with_tags=[
Expand All @@ -59,9 +58,8 @@ def test_h5m_file_creation_in_subfolder(self):
"""Checks that a h5m file is created from stp files when make_watertight
is set to false"""

os.system("rm test_dagmc.h5m")

test_h5m_filename = "subfolder/test_dagmc.h5m"
os.system(f"rm {test_h5m_filename}")

returned_filename = cad_to_h5m(
files_with_tags=[
Expand Down Expand Up @@ -239,9 +237,8 @@ def test_h5m_file_creation_with_scaling(self):
"""Checks that a h5m file is created from stp files when volumes are
scaled """

os.system("rm test_dagmc.h5m")

test_h5m_filename = "test_dagmc.h5m"
os.system(f"rm {test_h5m_filename}")

returned_filename = cad_to_h5m(
files_with_tags=[
Expand All @@ -261,9 +258,8 @@ def test_implicit_complement_assignment(self):
"""Checks h5m file creation and that the resulting h5m file contains
the material tag assigned to the implicit complement"""

os.system("rm test_dagmc.h5m")

test_h5m_filename = "test_dagmc.h5m"
os.system(f"rm {test_h5m_filename}")

implicit_complement_material = "air"

Expand Down

0 comments on commit a6fa763

Please sign in to comment.