Skip to content

Commit

Permalink
Decrease pinned pydantic version (#51)
Browse files Browse the repository at this point in the history
Pinned pydantic to be "pydantic>=1.10.14, <2" for compatibility with SmartSim.

[ committed by @AlyssaCote ]
[ reviewed by @MattToast ]
  • Loading branch information
AlyssaCote authored Apr 24, 2024
1 parent 9200627 commit a2d7cb2
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 18 deletions.
4 changes: 3 additions & 1 deletion doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ Development branch

Description

- Decrease the pinned version of Pydantic (SmartDashboard-PR51_)
- Bump version to 0.0.4, exclude streamlit version 1.31.X (SmartDashboard-PR50_)
- Drop Python 3.8 support, add 3.11 support. (SmartDashboard-PR49_)
- Add Database Telemetry page. (SmartDashboard-PR38_)
- Add Github Actions workflow that checks if changelog is edited
on pull requests into develop. (SmartDashboard-PR47_)
- Add manifest file tracking. (SmartDashboard-PR46_)

.. _SmartDashboard-PR51: https://github.com/CrayLabs/SmartDashboard/pull/51
.. _SmartDashboard-PR50: https://github.com/CrayLabs/SmartDashboard/pull/50
.. _SmartDashboard-PR49: https://github.com/CrayLabs/SmartDashboard/pull/49
.. _SmartDashboard-PR38: https://github.com/CrayLabs/SmartDashboard/pull/38
Expand Down Expand Up @@ -43,4 +45,4 @@ Released on 14 December 2023
Description

- The initial release of SmartDashboard includes capabilities for viewing
experiment entity properties and statuses.
experiment entity properties and statuses.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ readme = "README.md"
dependencies = [
"altair>=5.2.0",
"pandas>=2.0.0",
"pydantic>=2.5.2",
"pydantic>=1.10.14, <2", # this is pinned to keep consistency with SmartSim
"streamlit>=1.28.0, !=1.31.0, !=1.31.1",
"watchdog>=3.0.0",
]
Expand Down
4 changes: 2 additions & 2 deletions smartdashboard/schemas/orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

import typing as t

from pydantic import field_validator
from pydantic import validator

from smartdashboard.schemas.base import HasName
from smartdashboard.schemas.shard import Shard
Expand All @@ -37,7 +37,7 @@ class Orchestrator(HasName):
interface: t.List[str] = []
shards: t.List[Shard] = []

@field_validator("interface", mode="before")
@validator("interface", pre=True)
@classmethod
def convert_interface(cls, value: t.Union[str, t.List[str]]) -> t.List[str]:
if isinstance(value, str):
Expand Down
18 changes: 9 additions & 9 deletions smartdashboard/view_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,14 @@ def app_builder(manifest: Manifest) -> ApplicationView:
column=col1,
title="Batch Settings",
dict_name="batch_settings",
entity=selected_application.model_dump() if selected_application else {},
entity=selected_application.dict() if selected_application else {},
df_columns=["Name", "Value"],
)
build_dataframe_generic(
column=col2,
title="Run Settings",
dict_name="run_settings",
entity=selected_application.model_dump() if selected_application else {},
entity=selected_application.dict() if selected_application else {},
df_columns=["Name", "Value"],
)

Expand All @@ -169,14 +169,14 @@ def app_builder(manifest: Manifest) -> ApplicationView:
column=col1,
title="Parameters",
dict_name="params",
entity=selected_application.model_dump() if selected_application else {},
entity=selected_application.dict() if selected_application else {},
df_columns=["Name", "Value"],
)
build_dataframe_generic(
column=col2,
title="Files",
dict_name="files",
entity=selected_application.model_dump() if selected_application else {},
entity=selected_application.dict() if selected_application else {},
df_columns=["Type", "File"],
)

Expand Down Expand Up @@ -311,7 +311,7 @@ def ens_builder(manifest: Manifest) -> EnsembleView:
with st.expander(label="Batch Settings"):
batch = flatten_nested_keyvalue_containers(
"batch_settings",
selected_ensemble.model_dump() if selected_ensemble else {},
selected_ensemble.dict() if selected_ensemble else {},
)
render_dataframe(pd.DataFrame(batch, columns=["Name", "Value"]))

Expand Down Expand Up @@ -349,14 +349,14 @@ def ens_builder(manifest: Manifest) -> EnsembleView:
column=col1,
title="Batch Settings",
dict_name="batch_settings",
entity=member.model_dump() if member else {},
entity=member.dict() if member else {},
df_columns=["Name", "Value"],
)
build_dataframe_generic(
column=col2,
title="Run Settings",
dict_name="run_settings",
entity=member.model_dump() if member else {},
entity=member.dict() if member else {},
df_columns=["Name", "Value"],
)

Expand All @@ -367,14 +367,14 @@ def ens_builder(manifest: Manifest) -> EnsembleView:
column=col1,
title="Parameters",
dict_name="params",
entity=member.model_dump() if member else {},
entity=member.dict() if member else {},
df_columns=["Name", "Value"],
)
build_dataframe_generic(
column=col2,
title="Files",
dict_name="files",
entity=member.model_dump() if member else {},
entity=member.dict() if member else {},
df_columns=["Type", "File"],
)

Expand Down
10 changes: 5 additions & 5 deletions tests/test_helpers/test_format_mixed_nested_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,23 @@
[
pytest.param(
"batch_settings",
application_1.model_dump(),
application_1.dict(),
[("batch_cmd", "command"), ("arg1", "string1"), ("arg2", "None")],
),
pytest.param(
"run_settings",
application_1.model_dump(),
application_1.dict(),
[
("exe", "echo"),
("run_command", "srun"),
("arg1", "string1"),
("arg2", "None"),
],
),
pytest.param("params", ensemble_1.models[0].model_dump(), [("string", "Any")]),
pytest.param("params", ensemble_1.models[0].dict(), [("string", "Any")]),
pytest.param(
"files",
application_2.model_dump(),
application_2.dict(),
[
("Symlink", "file1"),
("Symlink", "file2"),
Expand All @@ -73,7 +73,7 @@
("debug", "False"),
],
),
pytest.param("doesnt_exist", ensemble_1.models[0].model_dump(), []),
pytest.param("doesnt_exist", ensemble_1.models[0].dict(), []),
pytest.param("batch_settings", None, []),
],
)
Expand Down

0 comments on commit a2d7cb2

Please sign in to comment.