Skip to content

Commit

Permalink
comply with ruff linter
Browse files Browse the repository at this point in the history
  • Loading branch information
kmario23 committed Oct 20, 2024
1 parent 1c2d564 commit a60ec47
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 12 deletions.
4 changes: 1 addition & 3 deletions pdebench/data_download/download_direct.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ def parse_metadata(pde_names):
"3d_cfd",
]

assert all(
name.lower() in pde_list for name in pde_names
), "PDE name not defined."
assert all(name.lower() in pde_list for name in pde_names), "PDE name not defined."

# Filter the files to be downloaded
meta_df["PDE"] = meta_df["PDE"].str.lower()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
save: '../save/ReacDiff/'
save: "../save/ReacDiff/"
dt_save: 0.01
ini_time: 0.
fin_time: 1.
Expand All @@ -8,9 +8,9 @@ xL: 0.
xR: 6.28318530718
yL: 0.
yR: 6.28318530718
nu : 1.e0
nu: 1.e0
rho: 1.e0
CFL: 2.5e-1
if_show: 1
show_steps: 100
init_mode: 'react'
init_mode: "react"
2 changes: 1 addition & 1 deletion pdebench/data_gen/data_gen_NLE/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ hydra:
dir: .

args:
type: 'ReacDiff' # 'advection'/'ReacDiff'/'burgers'/'CFD'
type: "ReacDiff" # "advection"/"ReacDiff"/"burgers"/"CFD"
dim: 1
bd: "periodic"
nbatch: 1000
Expand Down
3 changes: 1 addition & 2 deletions pdebench/data_gen/velocity2vorticity.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ def convert_velocity() -> None:
[vx[..., None], vy[..., None], vz[..., None]], axis=-1
)

vorticity = compute_spectral_vorticity_jnp(
jnp.array(velocity), dx, dy, dz)
vorticity = compute_spectral_vorticity_jnp(jnp.array(velocity), dx, dy, dz)

outfile["omega_x"][i] = np.array(vorticity[..., 0])
outfile["omega_y"][i] = np.array(vorticity[..., 1])
Expand Down
2 changes: 1 addition & 1 deletion pdebench/models/fno/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import numpy as np
import torch
from torch import nn
import torch.nn as nn

from pdebench.models.fno.fno import FNO1d, FNO2d, FNO3d
from pdebench.models.fno.utils import FNODatasetMult, FNODatasetSingle
Expand Down
1 change: 0 additions & 1 deletion pdebench/models/fno/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@
from __future__ import annotations

import math as mt
import os
from pathlib import Path

import h5py
Expand Down
1 change: 0 additions & 1 deletion pdebench/models/unet/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@
from __future__ import annotations

import math as mt
import os
from pathlib import Path

import h5py
Expand Down

0 comments on commit a60ec47

Please sign in to comment.