Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pre-commit autoupdate #77

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.4
rev: v0.9.1
hooks:
# Run the linter.
- id: ruff
Expand All @@ -27,7 +27,7 @@ repos:
- id: ruff-format
types_or: [python, pyi, jupyter]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.14.0"
rev: "v1.14.1"
hooks:
- id: mypy
exclude: docs/conf.py
Expand Down
2 changes: 1 addition & 1 deletion xcompact3d_toolbox/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def set(self, **kwargs) -> None:
@traitlets.validate("grid_size")
def _validate_grid_size(self, proposal):
if not _validate_grid_size(proposal.get("value"), self.is_periodic):
msg = f'{proposal.get("value")} is an invalid value for grid size'
msg = f"{proposal.get('value')} is an invalid value for grid size"
raise traitlets.TraitError(msg)
return proposal.get("value")

Expand Down
8 changes: 4 additions & 4 deletions xcompact3d_toolbox/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -983,16 +983,16 @@ def __str__(self):
# Check if param is a list or not
if isinstance(paramvalue, list):
for n, p in enumerate(paramvalue):
string += f"{paramkey+'('+str(n+1)+')':>15} = {p:<15} {'! '+description}\n"
string += f"{paramkey + '(' + str(n + 1) + ')':>15} = {p:<15} {'! ' + description}\n"
# Check if param is a string
elif isinstance(paramvalue, str):
new_paramvalue = "'" + paramvalue + "'"
string += f"{paramkey:>15} = {new_paramvalue:<15} {'! '+description}\n"
string += f"{paramkey:>15} = {new_paramvalue:<15} {'! ' + description}\n"
elif isinstance(paramvalue, bool):
new_paramvalue = ".true." if paramvalue else ".false."
string += f"{paramkey:>15} = {new_paramvalue:<15} {'! '+description}\n"
string += f"{paramkey:>15} = {new_paramvalue:<15} {'! ' + description}\n"
else:
string += f"{paramkey:>15} = {paramvalue:<15} {'! '+description}\n"
string += f"{paramkey:>15} = {paramvalue:<15} {'! ' + description}\n"
string += "\n"
string += "/End\n"

Expand Down
8 changes: 4 additions & 4 deletions xcompact3d_toolbox/sandbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ def init_dataset(prm: Parameters) -> xr.Dataset:
coords=[ds.y, ds.z],
attrs={
"file_name": var,
"name": f"Inflow Plane for {description.get(i,'')} Velocity",
"long_name": rf"$u_{i+1} (x_1=0,x_2,x_3)$",
"name": f"Inflow Plane for {description.get(i, '')} Velocity",
"long_name": rf"$u_{i + 1} (x_1=0,x_2,x_3)$",
},
)
ds.noise_mod_x1.attrs["name"] = "Modulation function for Random Numbers at Inflow Plane"
Expand Down Expand Up @@ -253,8 +253,8 @@ def init_dataset(prm: Parameters) -> xr.Dataset:
coords=[ds.x, ds.y, ds.z],
attrs={
"file_name": var,
"name": f"Initial Condition for {description.get(i,'')} Velocity",
"long_name": rf"$u_{i+1!s} (x_1,x_2,x_3,t=0)$",
"name": f"Initial Condition for {description.get(i, '')} Velocity",
"long_name": rf"$u_{i + 1!s} (x_1,x_2,x_3,t=0)$",
"BC": prm.get_boundary_condition(var),
},
)
Expand Down
Loading