Skip to content

Commit

Permalink
feat(ruff): enable pydocstyle and flake8-async (#22398)
Browse files Browse the repository at this point in the history
  • Loading branch information
hongbo-miao authored Jan 7, 2025
1 parent 3a6b787 commit a84b25b
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 30 deletions.
46 changes: 29 additions & 17 deletions .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -171,28 +171,40 @@ exclude = [
# https://docs.astral.sh/ruff/rules/
[lint]
select = [
"AIR", # Airflow
"C90", # mccabe
"COM", # flake8-commas
"E", # pycodestyle
"F", # Pyflakes
"FAST", # FastAPI
"FLY", # flynt
"FURB", # Refurb
"I", # isort
"N", # pep8-naming
"NPY", # NumPy
"PERF", # Perflint
"PGH", # pygrep-hooks
"PL", # Pylint
"RUF", # Ruff
"TRY", # tryceratops
"UP", # pyupgrade
"AIR", # Airflow
"ASYNC", # flake8-async
"C90", # mccabe
"COM", # flake8-commas
"D", # pydocstyle
"E", # pycodestyle
"F", # Pyflakes
"FAST", # FastAPI
"FLY", # flynt
"FURB", # Refurb
"I", # isort
"N", # pep8-naming
"NPY", # NumPy
"PERF", # Perflint
"PGH", # pygrep-hooks
"PL", # Pylint
"RUF", # Ruff
"TRY", # tryceratops
"UP", # pyupgrade
]
ignore = [
"D100",
"D101",
"D102",
"D103",
"D104",
"D105",
"D107",
"D203",
"D212",
"E501",
"PLR0913",
"PLR0915",
"PLR2004",
"TRY003",
"COM812",
]
3 changes: 2 additions & 1 deletion api-python/routers/motor.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import asyncio
import json
import random
import time
Expand Down Expand Up @@ -37,5 +38,5 @@ async def generate_motor_data(
json.dumps(data).encode("utf-8"),
callback=delivery_report,
)
time.sleep(1)
await asyncio.sleep(1)
return {"body": True}
6 changes: 0 additions & 6 deletions data-analytics/hm-networkx/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ def analyze_network(graph: nx.Graph) -> None:


def visualize_network(graph: nx.Graph) -> None:
"""
Create and display a visualization of the network.
"""
plt.figure(figsize=(10, 8))
pos = nx.spring_layout(graph)

Expand All @@ -79,9 +76,6 @@ def visualize_network(graph: nx.Graph) -> None:


def main() -> None:
"""
Main function to execute the network analysis.
"""
graph = create_network()
analyze_network(graph)
visualize_network(graph)
Expand Down
1 change: 0 additions & 1 deletion machine-learning/graph-neural-network/src/model/conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ def forward(self, batched_data):
return node_representation


# Virtual GNN to generate node embedding
class GNNVirtualNode(torch.nn.Module):
def __init__(
self,
Expand Down
5 changes: 0 additions & 5 deletions machine-learning/graph-neural-network/src/model/gnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ def __init__(
jk="last",
graph_pooling="mean",
):
"""
num_tasks (int): number of labels to be predicted
virtual_node (bool): whether to add virtual node or not
"""

super().__init__()

self.num_layer = num_layer
Expand Down

0 comments on commit a84b25b

Please sign in to comment.