Bobby Bruce has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/63711?usp=email )
(
9 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the
submitted one.
)Change subject: misc: Update black to process src/python/m5/ext/pystats
......................................................................
misc: Update black to process src/python/m5/ext/pystats
The exclusion in .pre-commit-config.yaml covered all files in
src/python/m5/ext. This excludes src/python/m5/exit/pystats, which we
want covered by black. This commit updates .pre-commit-config.yaml to
only exclude src/python/m5/ext/pyfdt.
This change also runs black on these files.
Change-Id: Iecff45ea2a27a37fc0d00b867d41300aad911c7a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63711
Tested-by: kokoro <noreply+kok...@google.com>
Reviewed-by: Bobby Bruce <bbr...@ucdavis.edu>
Maintainer: Bobby Bruce <bbr...@ucdavis.edu>
---
M .pre-commit-config.yaml
M src/python/m5/ext/pystats/group.py
M src/python/m5/ext/pystats/serializable_stat.py
M src/python/m5/ext/pystats/simstat.py
4 files changed, 27 insertions(+), 4 deletions(-)
Approvals:
kokoro: Regressions pass
Bobby Bruce: Looks good to me, approved; Looks good to me, approved
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 9fcca88..8cbc6af 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -44,7 +44,7 @@
build/.*|
src/systemc/ext/.*|
src/systemc/tests/.*/.*|
- src/python/m5/ext/.*|
+ src/python/m5/ext/pyfdt/.*|
tests/.*/ref/.*
)$
diff --git a/src/python/m5/ext/pystats/group.py
b/src/python/m5/ext/pystats/group.py
index 55ec4b2..6e2da87 100644
--- a/src/python/m5/ext/pystats/group.py
+++ b/src/python/m5/ext/pystats/group.py
@@ -40,6 +40,7 @@
from .statistic import Scalar, Statistic
from .timeconversion import TimeConversion
+
class Group(SerializableStat):
"""
Used to create the heirarchical stats structure. A Group object
contains a
@@ -70,7 +71,7 @@
def children(
self, predicate: Optional[Callable[[str], bool]] = None
) -> Iterator[Union["Group", Statistic]]:
- """ Iterate through all of the children, optionally with a
predicate
+ """Iterate through all of the children, optionally with a predicate
```
>>> system.children(lambda _name: 'cpu' in name)
@@ -91,7 +92,7 @@
yield obj
def find(self, name: str) -> Iterator[Union["Group", Statistic]]:
- """ Find all stats that match the name
+ """Find all stats that match the name
This function searches all of the "children" in this group. It
yields
the set of attributes (children) that have the `name` as a
substring.
@@ -117,7 +118,7 @@
def find_re(
self, regex: Union[str, Pattern]
) -> Iterator[Union["Group", Statistic]]:
- """ Find all stats that match the name
+ """Find all stats that match the name
This function searches all of the "children" in this group. It
yields
the set of attributes (children) that have the `name` mathing the
diff --git a/src/python/m5/ext/pystats/serializable_stat.py
b/src/python/m5/ext/pystats/serializable_stat.py
index 3ad9b50..c4de181 100644
--- a/src/python/m5/ext/pystats/serializable_stat.py
+++ b/src/python/m5/ext/pystats/serializable_stat.py
@@ -30,6 +30,7 @@
from .storagetype import StorageType
+
class SerializableStat:
"""
Classes which inherit from SerializableStat can be serialized as JSON
diff --git a/src/python/m5/ext/pystats/simstat.py
b/src/python/m5/ext/pystats/simstat.py
index 3cea133..bab47cc 100644
--- a/src/python/m5/ext/pystats/simstat.py
+++ b/src/python/m5/ext/pystats/simstat.py
@@ -32,6 +32,7 @@
from .statistic import Statistic
from .timeconversion import TimeConversion
+
class SimStat(SerializableStat):
"""
Contains all the statistics for a given simulation.
--
To view, visit
https://gem5-review.googlesource.com/c/public/gem5/+/63711?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Iecff45ea2a27a37fc0d00b867d41300aad911c7a
Gerrit-Change-Number: 63711
Gerrit-PatchSet: 11
Gerrit-Owner: Bobby Bruce <bbr...@ucdavis.edu>
Gerrit-Reviewer: Bobby Bruce <bbr...@ucdavis.edu>
Gerrit-Reviewer: Jason Lowe-Power <ja...@lowepower.com>
Gerrit-Reviewer: Jason Lowe-Power <power...@gmail.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org