Skip to content

Commit

Permalink
Auto format from pre-commit.com hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Jan 13, 2025
1 parent 320d54e commit 0968feb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
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

0 comments on commit 0968feb

Please sign in to comment.