From a45fe22cbb32ea3fffc465308a2dd76708b77a8e Mon Sep 17 00:00:00 2001 From: Luca Colagrande Date: Fri, 9 Feb 2024 13:32:26 +0100 Subject: [PATCH] ci: Fix linting --- .github/workflows/build-docker.yml | 2 +- util/sim/data_utils.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 88c47907be..92b5f68958 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -23,7 +23,7 @@ jobs: haskell: true large-packages: true - name: Disk usage after freeing up space - run: df -h + run: df -h # Actually build the Docker container - uses: actions/checkout@v2 - uses: docker/setup-buildx-action@v1 diff --git a/util/sim/data_utils.py b/util/sim/data_utils.py index 97954ed53e..a6b1350ad2 100644 --- a/util/sim/data_utils.py +++ b/util/sim/data_utils.py @@ -14,7 +14,7 @@ def emit_license(): """Emit license header. - + Returns: A header string. """ @@ -68,7 +68,7 @@ def ctype_from_precision_t(prec): def flatten(array): """Flatten various array types with a homogeneous API. - + Args: array: Can be a Numpy array, a PyTorch tensor or a nested list. """ @@ -120,7 +120,7 @@ def format_array_definition(dtype, uid, array, alignment=None, section=None): def format_scalar_definition(dtype, uid, scalar): - s = f'{alias_dtype(dtype)} {uid} = {scalar};' + s = f'{_alias_dtype(dtype)} {uid} = {scalar};' return s @@ -154,7 +154,7 @@ def format_value(value): return int(value) else: return str(value) - s = f'{alias_dtype(dtype)} {uid} = {{\n' + s = f'{_alias_dtype(dtype)} {uid} = {{\n' s += ',\n'.join([f'\t.{key} = {format_value(value)}' for (key, value) in map.items()]) s += '\n};' return s @@ -172,7 +172,7 @@ def from_buffer(byte_array, ctype='uint32_t'): If `ctype` is a C type string, it returns a homogeneous list of the specified type from the raw data. - + Alternatively, a dictionary can be passed to `ctype` to extract a struct from the raw data. In this case, it returns a dictionary with the same keys as in `ctype`. The values in the `ctype` dictionary