Skip to content

Commit 99f7bdf

Browse files
Added flake
1 parent 5598b96 commit 99f7bdf

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ repos:
1111
hooks:
1212
- id: ruff-check
1313
- id: ruff-format
14+
- repo: https://github.com/PyCQA/flake8
15+
rev: 7.2.0
16+
hooks:
17+
- id: flake8
18+
args: ["--ignore=E501,W503,E203"]
1419
- repo: https://github.com/asottile/add-trailing-comma
1520
rev: v3.2.0
1621
hooks:

gridFM/datasets/powergrid.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def process(self):
8989
# Ensure node and edge data match
9090
assert (scenarios == edge_df["scenario"].unique()).all()
9191

92-
## normalize node attributes
92+
# normalize node attributes
9393
cols_to_normalize = ["Pd", "Qd", "Pg", "Qg", "Vm", "Va"]
9494
to_normalize = torch.tensor(
9595
node_df[cols_to_normalize].values,
@@ -100,7 +100,7 @@ def process(self):
100100
to_normalize,
101101
).numpy()
102102

103-
## normalize edge attributes
103+
# normalize edge attributes
104104
cols_to_normalize = ["G", "B"]
105105
to_normalize = torch.tensor(
106106
edge_df[cols_to_normalize].values,
@@ -117,7 +117,7 @@ def process(self):
117117
to_normalize,
118118
).numpy()
119119

120-
## save stats
120+
# save stats
121121
node_stats_path = osp.join(
122122
self.processed_dir,
123123
f"node_stats_{self.norm_method}.pt",
@@ -135,7 +135,7 @@ def process(self):
135135

136136
data_list = []
137137
for scenario_idx in tqdm(scenarios):
138-
## NODE DATA
138+
# NODE DATA
139139
node_data = node_groups.get_group(scenario_idx)
140140
x = torch.tensor(
141141
node_data[
@@ -145,7 +145,7 @@ def process(self):
145145
)
146146
y = x[:, : self.mask_dim]
147147

148-
## EDGE DATA
148+
# EDGE DATA
149149
edge_data = edge_groups.get_group(scenario_idx)
150150
edge_attr = torch.tensor(edge_data[["G", "B"]].values, dtype=torch.float)
151151
edge_index = torch.tensor(

0 commit comments

Comments
 (0)