Skip to content

Commit

Permalink
Update ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhollas committed Aug 21, 2024
1 parent 18dfd9e commit a0c5364
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ repos:
- id: nbstripout

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.5
rev: v0.6.1
hooks:
- id: ruff
types_or: [python, pyi, jupyter]
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ line-length = 88
show-fixes = true
output-format = "full"
target-version = "py39"
extend-include = ["*.ipynb"]

[tool.ruff.lint]
ignore = ["E501", "E402", "TRY003", "RUF012", "N806"]
Expand Down
3 changes: 1 addition & 2 deletions tests/configuration/test_advanced.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,8 @@ def test_advanced_tot_charge_settings():

def test_advanced_kpoints_mesh():
"""Test Mesh Grid HTML widget."""
from aiidalab_qe.app.configuration.advanced import AdvancedSettings

from aiida import orm
from aiidalab_qe.app.configuration.advanced import AdvancedSettings

w = AdvancedSettings()

Expand Down
5 changes: 2 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import tempfile

import pytest
from aiidalab_qe.setup.pseudos import SSSP_VERSION

from aiida import orm
from aiidalab_qe.setup.pseudos import SSSP_VERSION

pytest_plugins = ["aiida.manage.tests.pytest_fixtures"]

Expand Down Expand Up @@ -630,12 +630,11 @@ def _generate_qeapp_workchain(
):
from copy import deepcopy

from aiida.orm.utils.serialize import serialize
from aiidalab_qe.app.configuration import ConfigureQeAppWorkChainStep
from aiidalab_qe.app.submission import SubmitQeAppWorkChainStep
from aiidalab_qe.workflows import QeAppWorkChain

from aiida.orm.utils.serialize import serialize

# Step 1: select structure from example
s1 = app.structure_step
if structure is None:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import time

import aiidalab_qe.__main__ as cli
from click.testing import CliRunner, Result

import aiida
import aiidalab_qe.__main__ as cli

# To learn more about testing click applications, see: https://click.palletsprojects.com/en/8.1.x/testing/

Expand Down
1 change: 1 addition & 0 deletions tests/test_plugins_bands.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
@pytest.mark.usefixtures("sssp")
def test_result(generate_qeapp_workchain):
import plotly.graph_objects as go

from aiidalab_qe.common.bandpdoswidget import BandPdosWidget
from aiidalab_qe.plugins.bands.result import Result

Expand Down
4 changes: 2 additions & 2 deletions tests/test_plugins_electronic_structure.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
def test_electronic_structure(generate_qeapp_workchain):
"""Test the electronic structure tab."""
import plotly.graph_objects as go

from aiida import engine
from aiidalab_qe.app.result.workchain_viewer import WorkChainViewer
from aiidalab_qe.common.bandpdoswidget import BandPdosWidget
from aiidalab_qe.plugins.electronic_structure.result import Result

from aiida import engine

wkchain = generate_qeapp_workchain()
wkchain.node.set_exit_status(0)
wkchain.node.set_process_state(engine.ProcessState.FINISHED)
Expand Down
1 change: 1 addition & 0 deletions tests/test_plugins_pdos.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
@pytest.mark.usefixtures("sssp")
def test_result(generate_qeapp_workchain):
import plotly.graph_objects as go

from aiidalab_qe.common.bandpdoswidget import BandPdosWidget
from aiidalab_qe.plugins.pdos.result import Result

Expand Down
2 changes: 1 addition & 1 deletion tests/test_plugins_xps.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
def test_settings():
"""Test the settings of the xps app."""

from aiidalab_qe.app.configuration import ConfigureQeAppWorkChainStep
from ase.build import molecule

from aiida.orm import StructureData
from aiidalab_qe.app.configuration import ConfigureQeAppWorkChainStep

configure_step = ConfigureQeAppWorkChainStep()
# set the input structure
Expand Down
4 changes: 2 additions & 2 deletions tests/test_pseudo.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import pytest

from aiida import orm
from aiidalab_qe.setup.pseudos import (
PSEUDODOJO_VERSION,
SSSP_VERSION,
Expand All @@ -7,8 +9,6 @@
pseudos_to_install,
)

from aiida import orm


def test_setup_pseudos_cmd(tmp_path):
"""Test _construct_cmd function in setup.pseudos"""
Expand Down
3 changes: 2 additions & 1 deletion tests/test_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ def test_summary_report_advanced_settings(data_regression, generate_qeapp_workch

def test_summary_view(generate_qeapp_workchain):
"""Test the report html can be properly generated."""
from aiidalab_qe.app.result.summary_viewer import SummaryView
from bs4 import BeautifulSoup

from aiidalab_qe.app.result.summary_viewer import SummaryView

wkchain = generate_qeapp_workchain()
viewer = SummaryView(wkchain.node)
report_html = viewer.report_html
Expand Down

0 comments on commit a0c5364

Please sign in to comment.