Skip to content

Commit

Permalink
Output model info in cases directory
Browse files Browse the repository at this point in the history
  • Loading branch information
ngoiz committed Dec 5, 2021
1 parent 5e9625f commit d925085
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions aircraft.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ def create_settings(self, settings):
config.write()
self.settings = settings

# git model filename
git_file_name = self.case_route + '/' + 'flexop_model_info' + self.case_name + '.txt'
with open(git_file_name, 'w') as f:
f.write(print_git_status())

def clean(self):
list_files = ['.fem.h5', '.aero.h5', '.nonlifting_body.h5', '.dyn.h5', '.mb.h5', '.sharpy', '.flightcon.txt']
for file in list_files:
Expand Down Expand Up @@ -100,12 +105,10 @@ def get_git_tag(di=FLEXOP_DIRECTORY):


def print_git_status():
# try:
# version_msg = get_git_tag()
# except subprocess.CalledProcessError:
# version_msg = 'unreleased'
version_msg = 'unreleased' # The above produces an annoying print(Fatal) statement, just overwrite until there is
# at least one git tag
try:
version_msg = get_git_tag()
except subprocess.CalledProcessError:
version_msg = 'unreleased'

return ('FLEXOP Model Git info:'
'\tThe branch being run is ' + get_git_revision_branch() +
Expand All @@ -116,4 +119,4 @@ def print_git_status():

if __name__ == '__main__':
print(FLEXOP_DIRECTORY)
print(print_git_status())
print(print_git_status())

0 comments on commit d925085

Please sign in to comment.