Skip to content

Commit

Permalink
Use of Black in formatting changed files.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurIasbeck committed Sep 5, 2024
1 parent f0d5056 commit 8d1dff7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
7 changes: 4 additions & 3 deletions ross/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -1855,6 +1855,7 @@ class SensitivityResults(Results):
subplots : Plotly graph_objects.make_subplots()
Plotly figure with Amplitude vs Frequency and Phase vs Frequency plots.
"""

def __init__(self, sensitivities, max_abs_sensitivities, compute_sensitivity_at):
self.sensitivities = sensitivities
self.max_abs_sensitivities = max_abs_sensitivities
Expand Down Expand Up @@ -1928,8 +1929,8 @@ def plot(
mag_sensitivity = [abs(z) for z in self.sensitivities[amb_tag]]
phase_sensitivity = [cmath.phase(z) for z in self.sensitivities[amb_tag]]

inp_dof = self.compute_sensitivity_at[amb_tag]['inp']
out_dof = self.compute_sensitivity_at[amb_tag]['out']
inp_dof = self.compute_sensitivity_at[amb_tag]["inp"]
out_dof = self.compute_sensitivity_at[amb_tag]["out"]
inp_node = inp_dof // 4
out_node = out_dof // 4

Expand Down Expand Up @@ -2033,7 +2034,7 @@ def __init__(
accl_resp,
speed_range,
number_dof,
sensitivity_results
sensitivity_results,
):
self.freq_resp = freq_resp
self.velc_resp = velc_resp
Expand Down
12 changes: 7 additions & 5 deletions ross/rotor_assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -1785,7 +1785,7 @@ def run_freq_response(
Set the compute_sensitivity_at parameter to indicate which magnetic bearings require sensitivity computation.
Use the bearing tags to specify the bearings. Additionally, define the degrees of freedom to be considered for
both disturbance input and displacement measurement output during the sensitivity computation.
>>> rotor = rs.amb_rotor_example()
>>> compute_sensitivite_dofs = {"Bearing 0": {"inp": 9, "out": 9}}
>>> response = rotor.run_freq_response(speed_range=speed, compute_sensitivity_at=compute_sensitivite_dofs)
Expand Down Expand Up @@ -1903,13 +1903,13 @@ def compute_sensitivity(self, speed_range, freq_resp, compute_sensitivity_at):
try:
amb = ambs[amb_tag]
except KeyError:
raise KeyError(
f"No AMB found associated with tag {amb_tag}."
)
raise KeyError(f"No AMB found associated with tag {amb_tag}.")

# Get disturbance frequency response
freq_response_at_mma = freq_resp[
compute_sensitivity_at[amb_tag]["inp"], compute_sensitivity_at[amb_tag]["out"], :
compute_sensitivity_at[amb_tag]["inp"],
compute_sensitivity_at[amb_tag]["out"],
:,
]
mag_w = [abs(z) for z in freq_response_at_mma]
phase_w = [cmath.phase(z) for z in freq_response_at_mma]
Expand Down Expand Up @@ -4434,6 +4434,7 @@ def rotor_example():

return Rotor(shaft_elem, [disk0, disk1], [bearing0, bearing1])


def amb_rotor_example():
"""Creates an example rotor supported by a journal bearing and a magnetic bearing.
Expand Down Expand Up @@ -4512,6 +4513,7 @@ def amb_rotor_example():

return Rotor(shaft_elem, [disk], [bearing0, bearing1])


def compressor_example():
"""Create a rotor as example.
Expand Down

0 comments on commit 8d1dff7

Please sign in to comment.