changed all __main__ scripts to console_main() functions to be used as entry points

This commit is contained in:
Mayeul Aubin 2025-05-27 14:46:17 +02:00
parent f487691e03
commit 00124bbdcc
8 changed files with 45 additions and 18 deletions

View file

@ -263,7 +263,9 @@ def get_ylims_and_yticks(ylims):
return ylims, yticks
if __name__ == "__main__":
def console_main():
from argparse import ArgumentParser
parser = ArgumentParser(description='Plot power spectra of fields')
@ -403,5 +405,8 @@ if __name__ == "__main__":
fig.savefig(args.output)
else:
fig.savefig(args.directory+'power_spectrum.png')
if __name__ == "__main__":
console_main()