From cd8be953bc11b3ca63c05d4b1753fcf3196400e2 Mon Sep 17 00:00:00 2001 From: vb64 Date: Tue, 12 Dec 2023 12:22:07 +0400 Subject: [PATCH] `Material` class replaced by external `pipeline-material` package. --- history.txt | 9 ++++++-- pipeline_integrity/material.py | 21 ------------------- requirements.txt | 1 + setup.cfg | 6 ++++-- tests/test/__init__.py | 2 +- tests/test/test_method/test_asme/__init__.py | 2 +- .../test_method/test_asme/test_b31g_1991.py | 2 +- 7 files changed, 15 insertions(+), 28 deletions(-) delete mode 100644 pipeline_integrity/material.py diff --git a/history.txt b/history.txt index ae3c849..aae94af 100644 --- a/history.txt +++ b/history.txt @@ -1,8 +1,13 @@ +12.12.2023 ver.1.5 +------------------ + * Replace pep257 - > pydocstyle in tests. -+ String representation for classes `Material`, `metal_loss.Item`, `Pipe`, `Context`. ++ String representation for classes `metal_loss.Item`, `Pipe`, `Context`. + +* Named constant 777. -* Named constant 777 +* `Material` class replaced by external `pipeline-material` package. 01.03.2023 ver.1.4 ------------------ diff --git a/pipeline_integrity/material.py b/pipeline_integrity/material.py deleted file mode 100644 index a5b9e88..0000000 --- a/pipeline_integrity/material.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -"""Material of the pipe.""" - - -class Material: - """Pipe material.""" - - def __init__(self, name, smys): - """Create new material.""" - self.name = name - self.smys = smys # предел текучести - self.smts = None # предел прочности при растяжении - self.toughness = None # вязкость - - def __str__(self): - """Return as text.""" - return "{} smys {} smts {}".format( - self.name, - round(self.smys, 2) if self.smys else '', - round(self.smts, 2) if self.smts else '' - ) diff --git a/requirements.txt b/requirements.txt index e9d95cb..58d9841 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ py23==1.2 +pipeline-material==1.0 diff --git a/setup.cfg b/setup.cfg index d1d7d0b..b14699a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = pipeline_integrity -version = 1.4 +version = 1.5 author = Vitaly Bogomolov author_email = mail@vitaly-bogomolov.ru description = Pipeline integrity calculation @@ -18,4 +18,6 @@ classifiers = package_dir = packages = pipeline_integrity include_package_data=True -install_requires = py23 +install_requires = + py23 + pipeline-material diff --git a/tests/test/__init__.py b/tests/test/__init__.py index bdf49ae..4343181 100644 --- a/tests/test/__init__.py +++ b/tests/test/__init__.py @@ -8,7 +8,7 @@ class TestBase(TestCase): def setUp(self): """Set up test data.""" super(TestBase, self).setUp() - from pipeline_integrity.material import Material + from pipeline_material import PipeMaterial as Material from pipeline_integrity.pipe import Pipe self.material = Material("Steel", 20000) diff --git a/tests/test/test_method/test_asme/__init__.py b/tests/test/test_method/test_asme/__init__.py index 0a52b9a..68bc8e3 100644 --- a/tests/test/test_method/test_asme/__init__.py +++ b/tests/test/test_method/test_asme/__init__.py @@ -10,7 +10,7 @@ def setUp(self): """Set up test data.""" super(TestAsme, self).setUp() - from pipeline_integrity.material import Material + from pipeline_material import PipeMaterial as Material from pipeline_integrity.pipe import Pipe self.pipe_en = Pipe( diff --git a/tests/test/test_method/test_asme/test_b31g_1991.py b/tests/test/test_method/test_asme/test_b31g_1991.py index dc73607..6a044dd 100644 --- a/tests/test/test_method/test_asme/test_b31g_1991.py +++ b/tests/test/test_method/test_asme/test_b31g_1991.py @@ -100,7 +100,7 @@ class TestsCrvlBas(TestAsme): def setUp(self): """All units as inches.""" super(TestsCrvlBas, self).setUp() - from pipeline_integrity.material import Material + from pipeline_material import PipeMaterial as Material from pipeline_integrity.pipe import Pipe from pipeline_integrity.method.asme.b31g_1991 import Context, State