Skip to content

Commit

Permalink
Style: Reformat code with latest version of Black
Browse files Browse the repository at this point in the history
  • Loading branch information
sanssecours committed Nov 27, 2023
1 parent a0b7bf7 commit ec2ec5a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
20 changes: 14 additions & 6 deletions icolyzer/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
@author: Clemens
"""


import argparse
from pathlib import Path
from sys import stderr
Expand Down Expand Up @@ -162,7 +161,7 @@ def main():
if datapoint > test_value_max or datapoint < test_value_min:
out_of_range[axis] += 1
if so is True:
sigma[axis] += (datapoint-offset[axis])**2
sigma[axis] += (datapoint - offset[axis]) ** 2
if so is True:
sigma[axis] = sigma[axis] / len(acceleration_values)

Expand All @@ -185,10 +184,19 @@ def main():
f"or below {test_value_min}g ({percent_overflow}%)"
)
if so is True:
print("The average value of the " + axis
+ " axis was: " + str((round(offset[axis], 2))) + "g")
print("The standard deviation(σ²) of the " + axis
+ " axis was: " + str((round(sigma[axis], 7))))
print(
"The average value of the "
+ axis
+ " axis was: "
+ str((round(offset[axis], 2)))
+ "g"
)
print(
"The standard deviation(σ²) of the "
+ axis
+ " axis was: "
+ str((round(sigma[axis], 7)))
)

with open_file(filepath, mode="r") as file:
start_time = file.get_node("/acceleration").attrs["Start_Time"]
Expand Down
7 changes: 3 additions & 4 deletions icolyzer/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
@author: Clemens
"""

import argparse
import glob
from pathlib import Path
Expand Down Expand Up @@ -61,10 +62,8 @@ def main():
print(f"Skipping non existing file “{filepath}”", file=stderr)
else:
print(
(
f"Skipping “{filepath}” since it is "
"neither a directory nor a file"
),
f"Skipping “{filepath}” since it is "
"neither a directory nor a file",
file=stderr,
)

Expand Down
10 changes: 4 additions & 6 deletions icolyzer/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,10 @@ def print_info(self) -> None:
sys.exit(1)

print(
" ".join(
[
f"Avg {axis.upper()}: {int(stats.loc['mean'][axis])}"
for axis in self.axes
]
)
" ".join([
f"Avg {axis.upper()}: {int(stats.loc['mean'][axis])}"
for axis in self.axes
])
)

std_dev = stats.loc["std", self.axes]
Expand Down

0 comments on commit ec2ec5a

Please sign in to comment.