diff --git a/README.rst b/README.rst index e59b7d6..4f21961 100644 --- a/README.rst +++ b/README.rst @@ -67,7 +67,7 @@ Powertrain Analysis :alt: Open Issues .. |license| image:: https://img.shields.io/badge/License-GPLv3-blue.svg - :target: https://github.com/AndreaBlengino/gearpy/blob/v0.1.0/LICENSE + :target: https://github.com/AndreaBlengino/gearpy/blob/master/LICENSE :alt: License diff --git a/gearpy/mechanical_objects/helical_gear.py b/gearpy/mechanical_objects/helical_gear.py index f111a09..25ec3ce 100644 --- a/gearpy/mechanical_objects/helical_gear.py +++ b/gearpy/mechanical_objects/helical_gear.py @@ -1,6 +1,6 @@ from gearpy.units import AngularPosition, AngularSpeed, AngularAcceleration, Angle, Force, InertiaMoment, Length, \ Stress, Time, Torque, UnitBase -from math import sin, cos, sqrt, atan, tan +from math import sqrt, atan from .mechanical_object_base import RotatingObject, lewis_factor_function, Role from .mating_roles import MatingMaster, MatingSlave from .spur_gear import SpurGear @@ -112,7 +112,7 @@ def __init__(self, raise TypeError(f"Parameter 'helix_angle' must be an instance of {Angle.__name__!r}.") if helix_angle >= Angle(90, 'deg'): - raise ValueError(f"Parameter 'helix_angle' cannot be greater than or equal to 90 degrees.") + raise ValueError("Parameter 'helix_angle' cannot be greater than or equal to 90 degrees.") self.__helix_angle = helix_angle diff --git a/gearpy/mechanical_objects/mechanical_object_base.py b/gearpy/mechanical_objects/mechanical_object_base.py index a683114..1b652fe 100644 --- a/gearpy/mechanical_objects/mechanical_object_base.py +++ b/gearpy/mechanical_objects/mechanical_object_base.py @@ -273,7 +273,7 @@ def __init__(self, raise TypeError(f"Parameter 'elastic_modulus' must be an instance of {Stress.__name__!r}.") if elastic_modulus.value <= 0: - raise ValueError(f"Parameter 'elastic_modulus' must be positive.") + raise ValueError("Parameter 'elastic_modulus' must be positive.") self.__n_teeth = n_teeth self.__driven_by = None diff --git a/gearpy/mechanical_objects/spur_gear.py b/gearpy/mechanical_objects/spur_gear.py index 51ea5ad..553e471 100644 --- a/gearpy/mechanical_objects/spur_gear.py +++ b/gearpy/mechanical_objects/spur_gear.py @@ -1,6 +1,6 @@ from gearpy.units import AngularPosition, AngularSpeed, AngularAcceleration, Angle, Force, InertiaMoment, Length, \ Stress, Time, Torque, UnitBase -from math import sin, cos, sqrt +from math import sqrt from .mechanical_object_base import RotatingObject, GearBase, lewis_factor_function, Role from .mating_roles import MatingMaster, MatingSlave from typing import Callable, Dict, List, Union, Optional diff --git a/gearpy/mechanical_objects/worm_gear.py b/gearpy/mechanical_objects/worm_gear.py index 89fe5f9..5dd6669 100644 --- a/gearpy/mechanical_objects/worm_gear.py +++ b/gearpy/mechanical_objects/worm_gear.py @@ -89,10 +89,10 @@ def __init__(self, inertia_moment = inertia_moment) if not isinstance(n_starts, int): - raise TypeError(f"Parameter 'n_starts' must be an integer.") + raise TypeError("Parameter 'n_starts' must be an integer.") if n_starts < 1: - raise ValueError(f"Parameter 'n_starts' must be equal to or greater than one.") + raise ValueError("Parameter 'n_starts' must be equal to or greater than one.") if not isinstance(helix_angle, Angle): raise TypeError(f"Parameter 'helix_angle' must be an instance of {Angle.__name__!r}.") @@ -273,7 +273,7 @@ def self_locking(self) -> bool: @self_locking.setter def self_locking(self, self_locking: bool): if not isinstance(self_locking, bool): - raise TypeError(f"Parameter 'self_locking' must be a boolean.") + raise TypeError("Parameter 'self_locking' must be a boolean.") self.__self_locking = self_locking diff --git a/gearpy/motor_control/rules/constant_pwm.py b/gearpy/motor_control/rules/constant_pwm.py index 14983de..286f306 100644 --- a/gearpy/motor_control/rules/constant_pwm.py +++ b/gearpy/motor_control/rules/constant_pwm.py @@ -46,10 +46,10 @@ def __init__(self, raise TypeError(f"Parameter 'powertrain' must be an instance of {Powertrain.__name__!r}.") if not isinstance(target_pwm_value, float) and not isinstance(target_pwm_value, int): - raise TypeError(f"Parameter 'target_pwm_value' must be a float or an integer.") + raise TypeError("Parameter 'target_pwm_value' must be a float or an integer.") if (target_pwm_value < -1) or (target_pwm_value > 1): - raise ValueError(f"Parameter 'target_pwm_value' must be within -1 and 1.") + raise ValueError("Parameter 'target_pwm_value' must be within -1 and 1.") self.__timer = timer self.__powertrain = powertrain diff --git a/gearpy/motor_control/rules/start_proportional_to_angular_position.py b/gearpy/motor_control/rules/start_proportional_to_angular_position.py index 5929e1a..e762d2d 100644 --- a/gearpy/motor_control/rules/start_proportional_to_angular_position.py +++ b/gearpy/motor_control/rules/start_proportional_to_angular_position.py @@ -81,17 +81,17 @@ def __init__(self, raise TypeError(f"Parameter 'target_angular_position' must be an instance of {AngularPosition.__name__!r}.") if not isinstance(pwm_min_multiplier, float) and not isinstance(pwm_min_multiplier, int): - raise TypeError(f"Parameter 'pwm_min_multiplier' must be a float or an integer.") + raise TypeError("Parameter 'pwm_min_multiplier' must be a float or an integer.") if pwm_min_multiplier <= 1: - raise ValueError(f"Parameter 'pwm_min_multiplier' must be greater than 1.") + raise ValueError("Parameter 'pwm_min_multiplier' must be greater than 1.") if pwm_min is not None: if not isinstance(pwm_min, float) and not isinstance(pwm_min, int): - raise TypeError(f"Parameter 'pwm_min' must be a float or an integer.") + raise TypeError("Parameter 'pwm_min' must be a float or an integer.") if pwm_min <= 0: - raise ValueError(f"Parameter 'pwm_min' must be positive.") + raise ValueError("Parameter 'pwm_min' must be positive.") self.__encoder = encoder self.__powertrain = powertrain diff --git a/gearpy/powertrain.py b/gearpy/powertrain.py index 9d1e4f5..0e20c4d 100644 --- a/gearpy/powertrain.py +++ b/gearpy/powertrain.py @@ -689,8 +689,8 @@ def plot(self, 'bending stress': stress_unit, 'contact stress': stress_unit, 'electric current': current_unit, 'pwm': ''} - fig, ax = plt.subplots(nrows = n_variables, ncols = n_elements, sharex = 'all', - layout = 'constrained', figsize = figsize) + _, ax = plt.subplots(nrows = n_variables, ncols = n_elements, sharex = 'all', + layout = 'constrained', figsize = figsize) stress_legend_items = {} diff --git a/gearpy/utils/relations.py b/gearpy/utils/relations.py index 18c0f74..069252c 100644 --- a/gearpy/utils/relations.py +++ b/gearpy/utils/relations.py @@ -74,7 +74,7 @@ def add_gear_mating(master: GearBase, raise TypeError(f"Parameter 'slave' must be an instance of {GearBase.__name__!r}.") if master == slave: - raise ValueError(f"Parameters 'master' and 'slave' cannot be the same gear.") + raise ValueError("Parameters 'master' and 'slave' cannot be the same gear.") if not isinstance(efficiency, float) and not isinstance(efficiency, int): raise TypeError("Parameter 'efficiency' must be a float or an integer.") @@ -319,7 +319,7 @@ def add_fixed_joint(master: RotatingObject, raise TypeError(f"Parameter 'slave' is an instance of {MotorBase.__name__!r}, but motor can only be 'master'.") if master == slave: - raise ValueError(f"Parameters 'master' and 'slave' cannot be the same rotating object.") + raise ValueError("Parameters 'master' and 'slave' cannot be the same rotating object.") master.drives = slave slave.driven_by = master