From a67b2485147d87fa87f207f896990674c9ef7c11 Mon Sep 17 00:00:00 2001 From: Chris McComb Date: Sat, 16 Dec 2023 13:50:01 -0500 Subject: [PATCH] Adding newline --- trussme/member.py | 11 +++++++---- trussme/report.py | 2 +- trussme/truss.py | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/trussme/member.py b/trussme/member.py index 1bb3f8c..73e6ea6 100644 --- a/trussme/member.py +++ b/trussme/member.py @@ -42,6 +42,13 @@ class Shape(abc.ABC): + @abc.abstractmethod + def __init__(self): + self.w = "N/A" + self.h = "N/A" + self.t = "N/A" + self.r = "N/A" + @abc.abstractmethod def moi(self) -> float: pass @@ -68,7 +75,6 @@ def moi(self) -> float: def area(self) -> float: return numpy.pi * (self.r ** 2 - (self.r - self.t) ** 2) - @property def name(self) -> str: return "pipe" @@ -86,7 +92,6 @@ def moi(self) -> float: def area(self) -> float: return numpy.pi*self.r**2 - @property def name(self) -> str: return "bar" @@ -107,7 +112,6 @@ def moi(self) -> float: def area(self) -> float: return self.w * self.h - @property def name(self) -> str: return "square" @@ -130,7 +134,6 @@ def moi(self) -> float: def area(self) -> float: return self.w*self.h - (self.h - 2*self.t)*(self.w - 2*self.t) - @property def name(self) -> str: return "box" diff --git a/trussme/report.py b/trussme/report.py index 4be930a..e67f334 100644 --- a/trussme/report.py +++ b/trussme/report.py @@ -114,7 +114,7 @@ def print_instantiation_information(f, the_truss, verbose=False): data.append([str(m.joints[0].idx), str(m.joints[1].idx), m.material_name, - m.shape.name, + m.shape.name(), m.shape.h, m.shape.w, m.shape.r, diff --git a/trussme/truss.py b/trussme/truss.py index 208b754..0987312 100644 --- a/trussme/truss.py +++ b/trussme/truss.py @@ -223,7 +223,7 @@ def save_truss(self, file_name: str): + str(m.joints[0].idx) + "\t" + str(m.joints[1].idx) + "\t" + m.material["name"] + "\t" - + m.shape.name + "\t") + + m.shape.name() + "\t") if str(m.shape.t) != "N/A": f.write("t=" + str(m.shape.t) + "\t") if str(m.shape.r) != "N/A":