Skip to content

Commit

Permalink
Rename Experiment.summary() argument (#391)
Browse files Browse the repository at this point in the history
Changes `format` argument of `Experiment.summary()` to `style`,
to avoid redefinition of builtin `format`.

[ committed by @al-rigazzi ]
[ reviewed by @mellis13  ]
  • Loading branch information
al-rigazzi authored Oct 18, 2023
1 parent b509efd commit 63d1fa5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
7 changes: 7 additions & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@ To be released at some future point in time

Description

- Change signature of `Experiment.summary()`
- Expose first_device parameter for scripts, functions, models
- Added support for MINBATCHTIMEOUT in model execution
- Remove support for RedisAI 1.2.5, use RedisAI 1.2.7 commit
- Add support for multiple databases

Detailed Notes

- Change `format` argument to `style` in `Experiment.summary()`, this is
an API break (PR391_)
- Added support for first_device parameter for scripts, functions,
and models. This causes them to be loaded to the first num_devices
beginning with first_device (PR394_)
Expand All @@ -39,12 +42,16 @@ Detailed Notes
bug has been fixed. This applies to all operating systems. (PR383_)
- Add support for creation of multiple databases with unique identifiers. (PR342_)


.. _PR391: https://github.com/CrayLabs/SmartSim/pull/391
.. _PR342: https://github.com/CrayLabs/SmartSim/pull/342
.. _PR394: https://github.com/CrayLabs/SmartSim/pull/394
.. _PR387: https://github.com/CrayLabs/SmartSim/pull/387
.. _PR383: https://github.com/CrayLabs/SmartSim/pull/383
.. _634916c: https://github.com/RedisAI/RedisAI/commit/634916c722e718cc6ea3fad46e63f7d798f9adc2
.. _PR342: https://github.com/CrayLabs/SmartSim/pull/342


0.5.1
-----

Expand Down
9 changes: 4 additions & 5 deletions smartsim/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,18 +791,17 @@ def reconnect_orchestrator(self, checkpoint: str) -> Orchestrator:
logger.error(e)
raise

# pylint: disable-next=redefined-builtin
def summary(self, format: str = "github") -> str:
def summary(self, style: str = "github") -> str:
"""Return a summary of the ``Experiment``
The summary will show each instance that has been
launched and completed in this ``Experiment``
:param format: the style in which the summary table is formatted,
:param style: the style in which the summary table is formatted,
for a full list of styles see:
https://github.com/astanin/python-tabulate#table-format,
defaults to "github"
:type format: str, optional
:type style: str, optional
:return: tabulate string of ``Experiment`` history
:rtype: str
"""
Expand Down Expand Up @@ -833,7 +832,7 @@ def summary(self, format: str = "github") -> str:
values,
headers,
showindex=True,
tablefmt=format,
tablefmt=style,
missingval="None",
disable_numparse=True,
)
Expand Down
2 changes: 1 addition & 1 deletion tests/on_wlm/test_simple_entity_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def test_summary(fileutils, wlmutils):
assert exp.get_status(bad)[0] == status.STATUS_FAILED
assert exp.get_status(sleep)[0] == status.STATUS_COMPLETED

summary_str = exp.summary(format="plain")
summary_str = exp.summary(style="plain")
print(summary_str)

rows = [s.split() for s in summary_str.split("\n")]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def test_summary(fileutils):
"model", path=test_dir, run_settings=RunSettings("echo", "Hello")
)
exp.start(m)
summary_str = exp.summary(format="plain")
summary_str = exp.summary(style="plain")
print(summary_str)

summary_lines = summary_str.split("\n")
Expand Down

0 comments on commit 63d1fa5

Please sign in to comment.