Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable ruff RUF001 rule #11378

Merged
merged 3 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions fuzzy_logic/fuzzy_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class FuzzySet:

# Union Operations
>>> siya.union(sheru)
FuzzySet(name='Siya Sheru', left_boundary=0.4, peak=0.7, right_boundary=1.0)
FuzzySet(name='Siya U Sheru', left_boundary=0.4, peak=0.7, right_boundary=1.0)
"""

name: str
Expand Down Expand Up @@ -147,10 +147,10 @@ def union(self, other) -> FuzzySet:
FuzzySet: A new fuzzy set representing the union.

>>> FuzzySet("a", 0.1, 0.2, 0.3).union(FuzzySet("b", 0.4, 0.5, 0.6))
FuzzySet(name='a b', left_boundary=0.1, peak=0.6, right_boundary=0.35)
FuzzySet(name='a U b', left_boundary=0.1, peak=0.6, right_boundary=0.35)
"""
return FuzzySet(
f"{self.name} {other.name}",
f"{self.name} U {other.name}",
min(self.left_boundary, other.left_boundary),
max(self.right_boundary, other.right_boundary),
(self.peak + other.peak) / 2,
Expand Down
6 changes: 3 additions & 3 deletions physics/basic_orbital_capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

"""
These two functions will return the radii of impact for a target object
of mass M and radius R as well as it's effective cross sectional area σ(sigma).
That is to say any projectile with velocity v passing within σ, will impact the
of mass M and radius R as well as it's effective cross sectional area sigma.
That is to say any projectile with velocity v passing within sigma, will impact the
target object with mass M. The derivation of which is given at the bottom
of this file.

The derivation shows that a projectile does not need to aim directly at the target
body in order to hit it, as R_capture>R_target. Astronomers refer to the effective
cross section for capture as σ=π*R_capture**2.
cross section for capture as sigma=π*R_capture**2.

This algorithm does not account for an N-body problem.

Expand Down
2 changes: 1 addition & 1 deletion physics/malus_law.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
Real polarizers are also not perfect blockers of the polarization orthogonal to
their polarization axis; the ratio of the transmission of the unwanted component
to the wanted component is called the extinction ratio, and varies from around
1:500 for Polaroid to about 1:106 for GlanTaylor prism polarizers.
1:500 for Polaroid to about 1:106 for Glan-Taylor prism polarizers.

Reference : "https://en.wikipedia.org/wiki/Polarizer#Malus's_law_and_other_properties"
"""
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ lint.ignore = [ # `ruff rule S101` for a description of that rule
"PLW2901", # PLW2901: Redefined loop variable -- FIX ME
"PT011", # `pytest.raises(Exception)` is too broad, set the `match` parameter or use a more specific exception
"PT018", # Assertion should be broken down into multiple parts
"RUF001", # String contains ambiguous {}. Did you mean {}?
"RUF002", # Docstring contains ambiguous {}. Did you mean {}?
"RUF003", # Comment contains ambiguous {}. Did you mean {}?
"S101", # Use of `assert` detected -- DO NOT FIX
Expand Down