Skip to content

Commit 6b9b0fb

Browse files
Run pre-commit hooks on all files
1 parent c3e3fae commit 6b9b0fb

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ Below are some examples of how CMake can be called to compile this software.
203203

204204
```bash
205205
# Configure and compile in release configuration
206-
cmake --preset release
206+
cmake --preset release
207207
cmake --build --preset release
208208

209209
# Use the release configuration but don't build Doxygen docs

src/ITS/PropLibTemplate/proplib_loader.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,12 @@
4141
lib.err_check(return_code)
4242
```
4343
"""
44+
4445
import platform
4546
from ctypes import *
4647
from pathlib import Path
4748

49+
4850
class PropLibCDLL(CDLL):
4951
def __init__(self, name):
5052
full_name = self.get_lib_name(name)
@@ -62,7 +64,7 @@ def get_lib_name(lib_name: str) -> str:
6264
This function appends the correct file extension based on the current platform,
6365
and prepends the full absolute file path. The shared library is expected
6466
to exist in the same directory as this file.
65-
67+
6668
:param lib_name: The library name, with no extension or path, e.g., "P2108-1.0"
6769
:raises NotImplementedError: For platforms other than Windows, Linux, or macOS.
6870
:return: The full filename, including path and extension, of the library.
@@ -80,7 +82,6 @@ def get_lib_name(lib_name: str) -> str:
8082
lib_path = Path(__file__).parent / lib_name
8183
return str(lib_path.resolve())
8284

83-
8485
def err_check(self, rtn_code: int) -> None:
8586
"""Parse the library's return code and raise an error if one occurred.
8687

src/ITS/PropLibTemplate/proplib_template.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# TODO-TEMPLATE: Rename this file and fix the import namespace
2-
from ITS.PropLibTemplate.proplib_loader import PropLibCDLL
1+
# TODO-TEMPLATE: Rename this file to your library name
32
from ctypes import *
43

4+
from .proplib_loader import PropLibCDLL
5+
56
# TODO-TEMPLATE: Load the shared library. Example:
67
# lib = PropLibCDLL("P2108-1.0")
78

@@ -15,5 +16,5 @@
1516
# c_double,
1617
# POINTER(c_double),
1718
# )
18-
19+
1920
# TODO-TEMPLATE: Populate this file with wrapper functions which call the library

tests/test_proplib_template.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212
TEST_DATA_DIR = (Path(__file__).parent.parent.parent.parent / "tests") / "data"
1313
ABSTOL__DB = 0.1 # Absolute tolerance, in dB, to ensure outputs match expected value
1414

15+
1516
def read_csv_test_data(filename: str):
1617
with open(TEST_DATA_DIR / filename) as f:
1718
reader = csv.reader(f)
1819
next(reader) # Skip header row
1920
for row in reader:
2021
# yield (inputs, rtn, output)
21-
yield tuple(map(float, row[:-2])), int(row[-2]), float(row[-1])
22+
yield tuple(map(float, row[:-2])), int(row[-2]), float(row[-1])

0 commit comments

Comments
 (0)