From 56a6d936805fe05dc412350aacd64beea3eed6e9 Mon Sep 17 00:00:00 2001 From: Jochem Smit Date: Fri, 14 Jun 2024 10:11:03 +0200 Subject: [PATCH 1/7] ruff fix all auto --- pyhdx/__init__.py | 8 -------- pyhdx/config.py | 2 +- pyhdx/web/tools.py | 1 - 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/pyhdx/__init__.py b/pyhdx/__init__.py index 12af1371..3a67c7a0 100644 --- a/pyhdx/__init__.py +++ b/pyhdx/__init__.py @@ -1,11 +1,3 @@ -from pyhdx.models import ( - HDXTimepoint, - HDXMeasurement, - Coverage, - HDXMeasurementSet, -) -from pyhdx.datasets import read_dynamx -from pyhdx.fitting_torch import TorchFitResult, TorchFitResultSet from pyhdx.__version__ import __version__ VERSION_STRING = f"PyHDX {__version__}" diff --git a/pyhdx/config.py b/pyhdx/config.py index faa22ead..2e6c446a 100644 --- a/pyhdx/config.py +++ b/pyhdx/config.py @@ -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 diff --git a/pyhdx/web/tools.py b/pyhdx/web/tools.py index 5f9ca5fd..498eb916 100644 --- a/pyhdx/web/tools.py +++ b/pyhdx/web/tools.py @@ -1,6 +1,5 @@ from bokeh.models.tools import * - supported_tools = { "pan": PanTool, "wheel_pan": WheelPanTool, From a8ce455e903799ecf4eaf273b537283c2cdd7051 Mon Sep 17 00:00:00 2001 From: Jochem Smit Date: Fri, 14 Jun 2024 10:13:40 +0200 Subject: [PATCH 2/7] fix: incorrect import --- templates/01_load_secb_data.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/01_load_secb_data.py b/templates/01_load_secb_data.py index 7e1bcd9b..8e9a157c 100644 --- a/templates/01_load_secb_data.py +++ b/templates/01_load_secb_data.py @@ -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 # %% From 72bb2cbac91634f53edefde62256cb7b2c3f53f7 Mon Sep 17 00:00:00 2001 From: Jochem Smit Date: Fri, 14 Jun 2024 10:15:25 +0200 Subject: [PATCH 3/7] lint: add param import --- pyhdx/web/constructor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyhdx/web/constructor.py b/pyhdx/web/constructor.py index 46fa0ea9..1cf1a0d0 100644 --- a/pyhdx/web/constructor.py +++ b/pyhdx/web/constructor.py @@ -1,8 +1,10 @@ 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 @@ -10,7 +12,6 @@ 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 From 91881e779e468b6d311f5d50311785396aff49a8 Mon Sep 17 00:00:00 2001 From: Jochem Smit Date: Fri, 14 Jun 2024 10:18:07 +0200 Subject: [PATCH 4/7] switch linting workflow to ruff --- .github/workflows/lint.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5f19725e..e9e35908 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,14 +1,13 @@ -name: Linting -on: [push] +name: Formatting Check +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 . From 48b0067259448cfcccd7db7f5750de82382fe390 Mon Sep 17 00:00:00 2001 From: Jochem Smit Date: Fri, 14 Jun 2024 10:18:22 +0200 Subject: [PATCH 5/7] workflow name --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e9e35908..d2602f28 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,4 @@ -name: Formatting Check +name: Lint on: [push, pull_request] jobs: From e8fb69a36f32829f458ebdee3eaafbd204287778 Mon Sep 17 00:00:00 2001 From: Jochem Smit Date: Fri, 14 Jun 2024 10:19:31 +0200 Subject: [PATCH 6/7] fix: update ruff check cmd --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index d2602f28..808f91ea 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -10,4 +10,4 @@ jobs: with: python-version: "3.9" - run: python -m pip install ruff - - run: ruff --check . + - run: ruff check . From ca506060342a65927314acb3d33ee2e950b07ad5 Mon Sep 17 00:00:00 2001 From: Jochem Smit Date: Fri, 14 Jun 2024 10:23:52 +0200 Subject: [PATCH 7/7] restore missing import, add __all__ --- pyhdx/__init__.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pyhdx/__init__.py b/pyhdx/__init__.py index 3a67c7a0..acdffeb2 100644 --- a/pyhdx/__init__.py +++ b/pyhdx/__init__.py @@ -1,4 +1,12 @@ from pyhdx.__version__ import __version__ +from pyhdx.datasets import read_dynamx +from pyhdx.fitting_torch import TorchFitResult, TorchFitResultSet +from pyhdx.models import ( + Coverage, + HDXMeasurement, + HDXMeasurementSet, + HDXTimepoint, +) VERSION_STRING = f"PyHDX {__version__}" @@ -6,3 +14,15 @@ from pyhdx.output import FitReport except ModuleNotFoundError: pass + + +__all__ = [ + "HDXTimepoint", + "HDXMeasurement", + "Coverage", + "HDXMeasurementSet", + "read_dynamx", + "TorchFitResult", + "TorchFitResultSet", + "FitReport", +]