Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
205 changes: 0 additions & 205 deletions .github/workflows/check_pylint_diff.sh

This file was deleted.

25 changes: 14 additions & 11 deletions .github/workflows/lint_workflow.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lint workflow
name: Lint

on:
push:
Expand All @@ -11,17 +11,20 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]

steps:
- uses: actions/checkout@v2
with:
fetch-depth: '2'
- name: Setup Python
uses: actions/setup-python@v1
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: ${{ matrix.python-version }}

- name: Install Tox
run: pip install tox
- name: Install dependencies
run: |
python -m pip install pre-commit

- name: Run Pylint
run: tox -e pylint-ci
- name: Lint
run: pre-commit run --all-files --show-diff-on-failure
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ __pycache__
# Coverage reports
htmlcov/*
.coverage
coverage.xml

# check_pylint_diff
.pylint_cache
Expand Down
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.14.14
hooks:
# Run the linter.
- id: ruff-check
args: [ --fix ]
# Run the formatter.
- id: ruff-format
4 changes: 4 additions & 0 deletions doc/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[tool.ruff]
extend = "../pyproject.toml"
# Exclude conf.py
extend-exclude = ["conf.py"]
9 changes: 5 additions & 4 deletions orangecontrib/spectroscopy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ def get_sample_datasets_dir():
try:
import dask
import dask.distributed
dask_client = dask.distributed.Client(processes=False, n_workers=2,
set_as_default=False,
dashboard_address=None)

dask_client = dask.distributed.Client(
processes=False, n_workers=2, set_as_default=False, dashboard_address=None
)
except ImportError:
dask = None
dask_client = None
dask_client = None
26 changes: 19 additions & 7 deletions orangecontrib/spectroscopy/data.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
# pylint: disable=unused-import
# ruff: noqa: F401

# import for compatibility before the restructure
import Orange.data.io # legacy import so that file readers are registered
from orangecontrib.spectroscopy.io.util import \
_metatable_maplocs, _spectra_from_image, _spectra_from_image_2d,\
build_spec_table
from orangecontrib.spectroscopy.io.util import (
_metatable_maplocs,
_spectra_from_image,
_spectra_from_image_2d,
build_spec_table,
)

from orangecontrib.spectroscopy.util import getx, spectra_mean

# imports for workflow compatibility when a reader was explicitly selected
# In the owfile settings, explicitly selected selected readers are stored with
# full module and class name. Moving but not adding imports would show
# the missing reader error.
from orangecontrib.spectroscopy.io.agilent import AgilentImageReader, AgilentImageIFGReader,\
agilentMosaicReader, agilentMosaicIFGReader, agilentMosaicTileReader
from orangecontrib.spectroscopy.io.agilent import (
AgilentImageReader,
AgilentImageIFGReader,
agilentMosaicReader,
agilentMosaicIFGReader,
agilentMosaicTileReader,
)
from orangecontrib.spectroscopy.io.ascii import AsciiColReader, AsciiMapReader
from orangecontrib.spectroscopy.io.diamond import NXS_STXM_Diamond_I08
from orangecontrib.spectroscopy.io.envi import EnviMapReader
Expand All @@ -25,6 +34,9 @@
from orangecontrib.spectroscopy.io.omnic import OmnicMapReader, SPCReader, SPAReader
from orangecontrib.spectroscopy.io.opus import OPUSReader
from orangecontrib.spectroscopy.io.ptir import PTIRFileReader
from orangecontrib.spectroscopy.io.soleil import SelectColumnReader, HDF5Reader_HERMES, \
HDF5Reader_ROCK
from orangecontrib.spectroscopy.io.soleil import (
SelectColumnReader,
HDF5Reader_HERMES,
HDF5Reader_ROCK,
)
from orangecontrib.spectroscopy.io.wire import WiREReaders
9 changes: 7 additions & 2 deletions orangecontrib/spectroscopy/io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@
from .matlab import MatlabReader

# Instrument-specific readers
from .agilent import AgilentImageReader, AgilentImageIFGReader, agilentMosaicReader,\
agilentMosaicIFGReader, agilentMosaicTileReader
from .agilent import (
AgilentImageReader,
AgilentImageIFGReader,
agilentMosaicReader,
agilentMosaicIFGReader,
agilentMosaicTileReader,
)
from .neaspec import NeaReader, NeaReaderGSF, NeaReaderMultiChannel
from .omnic import OmnicMapReader, SPAReader, SPCReader
from .opus import OPUSReader
Expand Down
Loading
Loading