Skip to content

fix: remove deprecated suggestion-mode and guard time_out assignment in preprocessing - #83

Open
sundeep8967 wants to merge 1 commit into
sede-open:mainfrom
sundeep8967:fix/pylint-config-and-scoping
Open

sundeep8967 wants to merge 1 commit into
sede-open:mainfrom
sundeep8967:fix/pylint-config-and-scoping

Conversation

@sundeep8967

Copy link
Copy Markdown

Description

This PR resolves a pylint configuration failure and a variable scoping / possible use before assignment warning in src/pyelq/preprocessing.py:

  1. Remove deprecated suggestion-mode from .pylintrc:

    • Modern versions of pylint reject the obsolete suggestion-mode option with E0015: Unrecognized option found: suggestion-mode (unrecognized-option), causing linter checks to exit with an error.
  2. Fix scoping and unassigned variable in src/pyelq/preprocessing.py:

    • In Preprocessor.regularize_data, time_out could potentially be used before assignment if no field matched or the loop did not execute.
    • Initialized time_out = None prior to the loop and added if time_out is not None: sns_new.time = time_out matching the defensive pattern in interpolate_single_met_object.
    • Renamed loop variable field to field_name to eliminate outer scope shadowing (W0621: Redefining name 'field' from outer scope).

Testing

  • Verified with uv run pylint src/pyelq/preprocessing.py (10.00/10 rating)
  • Verified with uv run pytest tests/test_preprocessing.py (64/64 passing)
  • Verified with uv run black . --check and uv run isort . --check (passing)

…in preprocessing

Remove the deprecated suggestion-mode option from .pylintrc to avoid
unrecognized option errors in modern pylint versions.
In src/pyelq/preprocessing.py, initialize time_out to None and rename the
inner loop variable to field_name to prevent outer scope shadowing and E0606
possibly-used-before-assignment.

Signed-off-by: sundeep8967 <sundeep8967@gmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant