From d8b41dcad6328ff9ea0b9984dba000f7e69ac1e5 Mon Sep 17 00:00:00 2001 From: Ryan Herbst Date: Sun, 6 Aug 2023 23:29:13 -0700 Subject: [PATCH 1/2] Reset fifo counters when countReset chain is called --- python/pyrogue/interfaces/stream/_Fifo.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/pyrogue/interfaces/stream/_Fifo.py b/python/pyrogue/interfaces/stream/_Fifo.py index bcd291fcb..d195479b8 100644 --- a/python/pyrogue/interfaces/stream/_Fifo.py +++ b/python/pyrogue/interfaces/stream/_Fifo.py @@ -67,3 +67,7 @@ def __lshift__(self,other): def __rshift__(self,other): pyrogue.streamConnect(self,other) return other + + def countReset(self): + self._fifo.clearCnt() + From 0fa5a6a026c0865a747ed45b663848f7c0e98b73 Mon Sep 17 00:00:00 2001 From: Larry Ruckman Date: Mon, 7 Aug 2023 10:22:17 -0700 Subject: [PATCH 2/2] flake8 bug fixes --- python/pyrogue/_HelperFunctions.py | 6 +++--- python/pyrogue/_Variable.py | 2 +- python/pyrogue/interfaces/stream/_Fifo.py | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/python/pyrogue/_HelperFunctions.py b/python/pyrogue/_HelperFunctions.py index bf5b77761..812c82a2f 100644 --- a/python/pyrogue/_HelperFunctions.py +++ b/python/pyrogue/_HelperFunctions.py @@ -349,13 +349,13 @@ def _var_representer(dumper, data): ------- """ - if type(data.value) == bool: + if isinstance(type(data.value), bool): enc = 'tag:yaml.org,2002:bool' elif data.enum is not None: enc = 'tag:yaml.org,2002:str' - elif type(data.value) == int: + elif isinstance(type(data.value), int): enc = 'tag:yaml.org,2002:int' - elif type(data.value) == float: + elif isinstance(type(data.value), float): enc = 'tag:yaml.org,2002:float' else: enc = 'tag:yaml.org,2002:str' diff --git a/python/pyrogue/_Variable.py b/python/pyrogue/_Variable.py index 4d22400d5..17df32573 100644 --- a/python/pyrogue/_Variable.py +++ b/python/pyrogue/_Variable.py @@ -214,7 +214,7 @@ def __init__(self, *, self._enum = disp elif isinstance(disp, list): self._enum = {k:str(k) for k in disp} - elif type(value) == bool and enum is None: + elif isinstance(type(value), bool) and enum is None: self._enum = {False: 'False', True: 'True'} if self._enum is not None: diff --git a/python/pyrogue/interfaces/stream/_Fifo.py b/python/pyrogue/interfaces/stream/_Fifo.py index d195479b8..bcd3a6e1b 100644 --- a/python/pyrogue/interfaces/stream/_Fifo.py +++ b/python/pyrogue/interfaces/stream/_Fifo.py @@ -70,4 +70,3 @@ def __rshift__(self,other): def countReset(self): self._fifo.clearCnt() -