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

fix codacy issues #4

Merged
merged 1 commit into from
Dec 2, 2023
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
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