Skip to content

Commit

Permalink
Lint (#352)
Browse files Browse the repository at this point in the history
* ruff fix all auto

* fix: incorrect import

* lint: add param import

* switch linting workflow to ruff

* workflow name

* fix: update ruff check cmd

* restore missing import, add __all__
  • Loading branch information
Jhsmit committed Jun 14, 2024
1 parent ab31606 commit 16700b7
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 15 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
name: Linting
on: [push]
name: Lint
on: [push, pull_request]

jobs:
lint:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- run: python -m pip install black[jupyter]
- run: |
black . --check
- run: python -m pip install ruff
- run: ruff check .
22 changes: 17 additions & 5 deletions pyhdx/__init__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
from pyhdx.__version__ import __version__
from pyhdx.datasets import read_dynamx
from pyhdx.fitting_torch import TorchFitResult, TorchFitResultSet
from pyhdx.models import (
HDXTimepoint,
HDXMeasurement,
Coverage,
HDXMeasurement,
HDXMeasurementSet,
HDXTimepoint,
)
from pyhdx.datasets import read_dynamx
from pyhdx.fitting_torch import TorchFitResult, TorchFitResultSet
from pyhdx.__version__ import __version__

VERSION_STRING = f"PyHDX {__version__}"

try:
from pyhdx.output import FitReport
except ModuleNotFoundError:
pass


__all__ = [
"HDXTimepoint",
"HDXMeasurement",
"Coverage",
"HDXMeasurementSet",
"read_dynamx",
"TorchFitResult",
"TorchFitResultSet",
"FitReport",
]
2 changes: 1 addition & 1 deletion pyhdx/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from contextlib import contextmanager
from os import PathLike
from pathlib import Path
from typing import Union, Dict, Any, Optional, Generator
from typing import Union, Any, Optional, Generator

import torch
from omegaconf import OmegaConf, DictConfig, DictKeyType
Expand Down
3 changes: 2 additions & 1 deletion pyhdx/web/constructor.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import collections

import param
from distributed import Client

from pyhdx.support import gen_subclasses
from pyhdx.web.cache import Cache
from pyhdx.web.controllers import *
from pyhdx.web.main_controllers import MainController
from pyhdx.web.opts import OptsBase
from pyhdx.web.sources import *
from pyhdx.web.tools import supported_tools
from pyhdx.web.transforms import *
from pyhdx.web.views import View
from pyhdx.web.cache import Cache

element_count = 0

Expand Down
1 change: 0 additions & 1 deletion pyhdx/web/tools.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from bokeh.models.tools import *


supported_tools = {
"pan": PanTool,
"wheel_pan": WheelPanTool,
Expand Down
3 changes: 2 additions & 1 deletion templates/01_load_secb_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

import numpy as np

from pyhdx import HDXMeasurement, read_dynamx
from pyhdx.datasets import filter_peptides
from pyhdx.fileIO import read_dynamx
from pyhdx.models import HDXMeasurement
from pyhdx.process import apply_control, correct_d_uptake

# %%
Expand Down

0 comments on commit 16700b7

Please sign in to comment.