Skip to content

Commit

Permalink
fix codacy issues (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
vb64 authored Dec 2, 2023
1 parent ea42b9e commit ae8b72d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
9 changes: 3 additions & 6 deletions pipeline_integrity/method/asme/b31g_2012.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,9 @@ def get_stress_fail(self):
),
'\n', "stress_fail = {} * (1 - 2/3 * ({} / {})) / (1 - 2/3 * ({} / {} / {})) = {}.".format(
round(s_f, EXPL_ROUND),
round(self.anomaly.depth, EXPL_ROUND),
round(self.anomaly.pipe.wallthickness, EXPL_ROUND),
round(self.anomaly.depth, EXPL_ROUND),
round(self.anomaly.pipe.wallthickness, EXPL_ROUND),
round(m_val, EXPL_ROUND),
round(s_p, EXPL_ROUND),
round(self.anomaly.depth, EXPL_ROUND), round(self.anomaly.pipe.wallthickness, EXPL_ROUND),
round(self.anomaly.depth, EXPL_ROUND), round(self.anomaly.pipe.wallthickness, EXPL_ROUND),
round(m_val, EXPL_ROUND), round(s_p, EXPL_ROUND),
),
])

Expand Down
6 changes: 3 additions & 3 deletions tests/test/test_i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
class TestsI18n(TestBase):
"""Module i18n.py."""

def test_fake_gettext(self):
"""Function fake_gettext."""
def test_fgettext(self):
"""Check fake_gettext function."""
from pipeline_integrity.i18n import fake_gettext, Lang
from pipeline_integrity.method.asme.b31g_1991 import Context

Expand All @@ -26,7 +26,7 @@ def test_fake_gettext(self):

@staticmethod
def test_load_po():
"""Function load_po."""
"""Check load_po function."""
from pipeline_integrity.i18n import load_po

data = load_po(os.path.join(
Expand Down
6 changes: 3 additions & 3 deletions tests/test/test_method/test_asme/test_b31g_1991.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,13 @@ def test_example3(self):
self.pipe.diameter = 24
self.pipe.wallthickness = 0.432
self.defect.depth = 0.13
self.defect.length = 30.0
self.pipe.maop = 910
self.defect.length = 30.0

assert round(self.asme.get_a(self.defect.length), 3) == 7.668 # 8.320
assert round(self.asme.get_design_pressure()) == 1348
assert round(self.asme.get_safe_pressure()) == 1036 # 1037
assert round(self.asme.defect_max_length(), 3) == 4.789 # INFINITY ?
assert round(self.asme.get_a(self.defect.length), 3) == 7.668 # 8.320
assert round(self.asme.get_design_pressure()) == 1348

self.defect.depth = 0.167
assert round(self.asme.defect_max_length(), 3) == 3.557 # 30.0
Expand Down

0 comments on commit ae8b72d

Please sign in to comment.