summaryrefslogtreecommitdiff
path: root/creator/base.py
diff options
context:
space:
mode:
authorblendoit <blendoit@gmail.com>2019-10-07 02:57:01 -0700
committerblendoit <blendoit@gmail.com>2019-10-07 02:57:01 -0700
commit76f3f92a300121f30998d60bd12b10f8c6fd0e2a (patch)
tree29ebfcf8eb40851c72444e51b9fec1238acaf8b8 /creator/base.py
parent445a834e6a5e790a7f37730d6e5d8824b8f598f4 (diff)
final Evaluator implementation
Diffstat (limited to 'creator/base.py')
-rw-r--r--creator/base.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/creator/base.py b/creator/base.py
index 5d90efd..33ea680 100644
--- a/creator/base.py
+++ b/creator/base.py
@@ -20,6 +20,9 @@ class Aircraft:
self.propulsion = None
self.wing = None
+ def __str__(self):
+ return self.name
+
class Component:
"""Basic component providing coordinates, tools and a component tree."""
@@ -38,11 +41,11 @@ class Component:
print(num_of_dashes * '-')
print(name)
for k, v in self.__dict__.items():
- if type(v) != list:
+ if type(v) is not np.ndarray:
print(f'{k}:\n', v)
print(num_of_dashes * '-')
for k, v in self.__dict__.items():
- if type(v) == list:
+ if type(v) is np.ndarray:
print(f'{k}:\n', np.around(v, round))
return None
@@ -54,14 +57,16 @@ class Component:
try:
with open(full_path, 'w') as f:
for k, v in self.__dict__.items():
- if type(v) != list:
- f.write(f'{k}:\n')
+ if type(v) is not np.ndarray:
+ f.write(f'{k}=\n')
f.write(str(v))
+ f.write("\n")
# print(num_of_dashes * '-')
for k, v in self.__dict__.items():
- if type(v) == list:
- f.write(f'{k}:\n')
+ if type(v) is np.ndarray:
+ f.write(f'{k}=\n')
f.write(str(v))
+ f.write("\n")
logging.debug(f'Successfully wrote to file {full_path}')
except IOError:
print(f'Unable to write {file_name} to specified directory.\n',
Copyright 2019--2024 Marius PETER