Skip to content

Align src codebase with latest Ruff ruleset - #47

Merged
enryH merged 3 commits into
mainfrom
copilot/update-to-match-latest-ruff-version
Aug 12, 2026
Merged

Align src codebase with latest Ruff ruleset#47
enryH merged 3 commits into
mainfrom
copilot/update-to-match-latest-ruff-version

Conversation

Copilot AI commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

This updates src to satisfy the latest ruff check src requirements by addressing each reported error type with targeted refactors. Changes are scoped to lint-driven correctness/style updates without introducing new features.

  • Lint-driven cleanups across src

    • Applied safe Ruff autofixes for import ordering, string formatting modernizations, annotation rewrites, and minor simplifications.
    • Removed redundant expressions and dead/no-op statements flagged by Ruff.
  • Manual fixes for non-auto-fixable findings

    • Replaced bare open(...) usage with context managers in file-upload helpers.
    • Reworked index-counter loops to enumerate(...) where required.
    • Collapsed nested if blocks into single conditions where semantics were unchanged.
    • Replaced broad except Exception handlers with narrower exception tuples in touched paths.
    • Updated dictionary iteration patterns to use .items() when both key/value are used.
  • Behavior-preserving return-path corrections

    • Fixed branches that evaluated values without returning them (e.g., returning xticks directly in fallback paths).
# before
for field in fields:
    if field in record:
        aux[fields[field]] = record[field]

# after
for field, value in fields.items():
    if field in record:
        aux[value] = record[field]

Copilot AI linked an issue Aug 11, 2026 that may be closed by this pull request
Co-authored-by: enryH <2833836+enryH@users.noreply.github.com>
Copilot AI changed the title [WIP] Update to match latest ruff version Align src codebase with latest Ruff ruleset Aug 11, 2026
Copilot AI requested a review from enryH August 11, 2026 14:53
@enryH
enryH marked this pull request as ready for review August 12, 2026 09:23
Comment thread src/vuecore/__init__.py
if offset > 1:
return xticks[::offset]
else:
xticks

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was an actual error...

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b25e7d7657

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/vuecore/viz.py Outdated
nx.set_node_attributes(graph, betweenness, "betweenness")
nx.set_node_attributes(graph, ev_centrality, "eigenvector")
except Exception as e:
except (nx.NetworkXException, ValueError) as e:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep handling eigensolver convergence failures

When nx.eigenvector_centrality_numpy fails to converge for a valid 6–149-edge input graph, SciPy raises scipy.sparse.linalg.ArpackNoConvergence, which is neither a NetworkXException nor a ValueError. The previous broad handler allowed get_network to continue rendering with degree-based sizing, but this narrowed tuple now lets that exception abort the entire network visualization; include the documented eigensolver exception in the fallback handling.

Useful? React with 👍 / 👎.

@enryH
enryH merged commit e522452 into main Aug 12, 2026
8 checks passed
@enryH
enryH deleted the copilot/update-to-match-latest-ruff-version branch August 12, 2026 10:38
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.

Update to match latest ruff version

2 participants