Skip to content

Commit cb1e716

Browse files
MaximSmolskiysedatguzelsemme
authored andcommitted
Enable ruff RUF001 rule (TheAlgorithms#11378)
* Enable ruff RUF001 rule * Fix * Fix
1 parent 4be5c48 commit cb1e716

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

fuzzy_logic/fuzzy_operations.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class FuzzySet:
5757
5858
# Union Operations
5959
>>> siya.union(sheru)
60-
FuzzySet(name='Siya Sheru', left_boundary=0.4, peak=0.7, right_boundary=1.0)
60+
FuzzySet(name='Siya U Sheru', left_boundary=0.4, peak=0.7, right_boundary=1.0)
6161
"""
6262

6363
name: str
@@ -147,10 +147,10 @@ def union(self, other) -> FuzzySet:
147147
FuzzySet: A new fuzzy set representing the union.
148148
149149
>>> FuzzySet("a", 0.1, 0.2, 0.3).union(FuzzySet("b", 0.4, 0.5, 0.6))
150-
FuzzySet(name='a b', left_boundary=0.1, peak=0.6, right_boundary=0.35)
150+
FuzzySet(name='a U b', left_boundary=0.1, peak=0.6, right_boundary=0.35)
151151
"""
152152
return FuzzySet(
153-
f"{self.name} {other.name}",
153+
f"{self.name} U {other.name}",
154154
min(self.left_boundary, other.left_boundary),
155155
max(self.right_boundary, other.right_boundary),
156156
(self.peak + other.peak) / 2,

physics/basic_orbital_capture.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44

55
"""
66
These two functions will return the radii of impact for a target object
7-
of mass M and radius R as well as it's effective cross sectional area σ(sigma).
8-
That is to say any projectile with velocity v passing within σ, will impact the
7+
of mass M and radius R as well as it's effective cross sectional area sigma.
8+
That is to say any projectile with velocity v passing within sigma, will impact the
99
target object with mass M. The derivation of which is given at the bottom
1010
of this file.
1111
1212
The derivation shows that a projectile does not need to aim directly at the target
1313
body in order to hit it, as R_capture>R_target. Astronomers refer to the effective
14-
cross section for capture as σ=π*R_capture**2.
14+
cross section for capture as sigma=π*R_capture**2.
1515
1616
This algorithm does not account for an N-body problem.
1717

physics/malus_law.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
Real polarizers are also not perfect blockers of the polarization orthogonal to
3232
their polarization axis; the ratio of the transmission of the unwanted component
3333
to the wanted component is called the extinction ratio, and varies from around
34-
1:500 for Polaroid to about 1:106 for GlanTaylor prism polarizers.
34+
1:500 for Polaroid to about 1:106 for Glan-Taylor prism polarizers.
3535
3636
Reference : "https://en.wikipedia.org/wiki/Polarizer#Malus's_law_and_other_properties"
3737
"""

pyproject.toml

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ lint.ignore = [ # `ruff rule S101` for a description of that rule
1010
"PLW2901", # PLW2901: Redefined loop variable -- FIX ME
1111
"PT011", # `pytest.raises(Exception)` is too broad, set the `match` parameter or use a more specific exception
1212
"PT018", # Assertion should be broken down into multiple parts
13-
"RUF001", # String contains ambiguous {}. Did you mean {}?
1413
"RUF002", # Docstring contains ambiguous {}. Did you mean {}?
1514
"RUF003", # Comment contains ambiguous {}. Did you mean {}?
1615
"S101", # Use of `assert` detected -- DO NOT FIX

0 commit comments

Comments
 (0)