Skip to content

Commit

Permalink
Merge pull request #181 from DiamondLightSource/fix_linter
Browse files Browse the repository at this point in the history
Fix issues in the Docs and Code-lint stages of the CI
  • Loading branch information
AlexanderWells-diamond authored Jan 20, 2025
2 parents 27ae663 + 685ab3e commit e1f104a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.7"
python-version: "3.12"

- name: Install Python Dependencies
run: pip install flake8
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
jobs:
build:
name: "Docs CI"
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- name: Checkout Source
Expand Down
9 changes: 6 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,12 @@ dev =
[flake8]
max-line-length = 80
extend-ignore =
F401 F403 F405 # Allow from module import *
E251 # Allow call(param = value)
E301 E302 E303 E305 # Allow any number of blank lines
# Allow from module import *
F401 F403 F405
# Allow call(param = value)
E251
# Allow any number of blank lines
E301 E302 E303 E305

[tool:pytest]
# Run pytest with all our checkers, and don't spam us with massive tracebacks on error
Expand Down
1 change: 0 additions & 1 deletion softioc/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@ def ClearRecords():

SetSimpleRecordNames(None, ':')

SetDeviceName = SetPrefix
def SetDeviceName(name):
SetPrefix(name)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_record_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,15 +294,15 @@ def record_value_asserts(
# This function is shared between functions that may pass in either a
# native Python type, or the value returned from p4p, which must be
# unwrapped
if type(actual_value) == p4p.nt.enum.ntenum:
if type(actual_value) is p4p.nt.enum.ntenum:
actual_val_type = type(actual_value.raw["value"].get("index"))
elif isinstance(actual_value, p4p.nt.scalar.ntwrappercommon):
actual_val_type = type(actual_value.raw["value"])
else:
actual_val_type = type(actual_value)

try:
if type(expected_value) == float and isnan(expected_value):
if type(expected_value) is float and isnan(expected_value):
assert isnan(actual_value) # NaN != Nan, so needs special case
elif creation_func in [builder.WaveformOut, builder.WaveformIn]:
assert numpy.array_equal(actual_value, expected_value)
Expand Down

0 comments on commit e1f104a

Please sign in to comment.