Skip to content

Commit

Permalink
Merge pull request #164 from brews/ruff_refresh
Browse files Browse the repository at this point in the history
Ruff refresh
  • Loading branch information
brews authored Apr 4, 2024
2 parents 2602d1e + 5ec602b commit 95870b0
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pythonpackage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
pip install -r requirements.txt
- name: Format check with ruff
run: |
ruff check .
ruff check . --diff
test:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ History
Unreleased
----------

*
* Minor code format cleanup, ruff config update.


0.2.0 (2023-09-01)
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ exclude = [
".eggs",
"docs",
]

[tool.ruff.lint]
# E402: module level import not at top of file
ignore = [
"E402",
Expand All @@ -65,4 +67,4 @@ select = [
"W",
# Pyupgrade
"UP",
]
]
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
numpy==1.26.4
pytest==8.1.1
pytest-cov==5.0.0
ruff==0.3.0
ruff==0.3.5
10 changes: 6 additions & 4 deletions src/parameterize_jobs/parameterize_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ def __getitem__(self, idx):
elif isinstance(idx, int):

if (idx >= len(self)) or (idx < -1 * len(self)):
name = self.__class__.__name__
n = len(self)
raise KeyError(
'index {} out of bounds for {} with length {}'
.format(idx, self.__class__.__name__, len(self)))
f'index {idx} out of bounds for {name} with length {n}')

lens = list(map(len, self._sets.values()))
cplens = list(_cumprod(list(
Expand Down Expand Up @@ -137,9 +138,10 @@ def __len__(self):

def __getitem__(self, idx):
if (idx >= len(self)) or (idx < -1 * len(self)):
name = self.__class__.__name__
n = len(self)
raise KeyError(
'index {} out of bounds for {} with length {}'
.format(idx, self.__class__.__name__, len(self)))
f'index {idx} out of bounds for {name} with length {n}')

idx = idx % len(self)

Expand Down

0 comments on commit 95870b0

Please sign in to comment.