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

Bump version 0.8.1 #234

Merged
merged 3 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry]
# Check https://python-poetry.org/docs/pyproject/ for all available sections
name = "ansys-fluent-parametric"
version = "0.8.0"
version = "0.8.1"
description = "A python wrapper for Ansys Fluent parametric workflows"
license = "MIT"
authors = ["ANSYS, Inc. <[email protected]>"]
Expand Down
4 changes: 2 additions & 2 deletions src/ansys/fluent/parametric/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,11 @@ def get_unit_label(self, name: str) -> str:

"""
value = str(self[name])
value_split = value.split(maxsplit=1)
value_split = value.split("[", maxsplit=1)
if len(value_split) == 1:
return ""
else:
return value_split[1].lstrip("[").rstrip("]")
return value_split[-1].strip().rstrip("]")

def __setitem__(self, name: str, value: V) -> None:
"""Set value of an input parameter.
Expand Down
8 changes: 8 additions & 0 deletions tests/test_input_output_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ def test_input_output_parameters():
assert inp["inlet_pressure"] == "90001 [Pa]"
assert inp.get_unit_label("inlet_pressure") == "Pa"

inp["inlet_pressure"] = "90002[Pa]"
assert inp["inlet_pressure"] == "90002[Pa]"
assert inp.get_unit_label("inlet_pressure") == "Pa"

inp["inlet_pressure"] = 90003
assert inp["inlet_pressure"] == "90003 [Pa]"
assert inp.get_unit_label("inlet_pressure") == "Pa"

outp = OutputParameters(solver_session)
assert len(outp) == 1
assert outp["mass-outlet-op"] == "0.0 [kg/s]"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


def test_pkg_version():
assert __version__ == "0.8.0"
assert __version__ == "0.8.1"
Loading