Skip to content

Commit

Permalink
Adding newline
Browse files Browse the repository at this point in the history
  • Loading branch information
cmccomb committed Dec 16, 2023
1 parent dbe631b commit a67b248
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
11 changes: 7 additions & 4 deletions trussme/member.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"

Expand All @@ -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"

Expand All @@ -107,7 +112,6 @@ def moi(self) -> float:
def area(self) -> float:
return self.w * self.h

@property
def name(self) -> str:
return "square"

Expand All @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion trussme/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion trussme/truss.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down

0 comments on commit a67b248

Please sign in to comment.