-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
30 lines (24 loc) · 890 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"""
Main execution file to run diffusion code. This structure is necessary to cythonize the diffusion module
"""
from diffusion_core import Diffusion
import logging
def main():
# Creating main logger
logger = logging.getLogger('main')
logger.setLevel(logging.DEBUG)
# Create file handler which logs messages
fh = logging.FileHandler('fusion-core-logger.log')
fh.setLevel(logging.DEBUG)
# Create formater and add it to handlers
formatter = logging.Formatter('%(name)s - %(levelname)s - %(message)s')
fh.setFormatter(formatter)
# add the handlers to the logger
logger.addHandler(fh)
logger.info('Creating instance of Diffusion class')
diffusion = Diffusion()
logger.info('Calling solve_diffusion() function to solve Diffusion problem')
diffusion.solve_diffusion()
logging.shutdown()
if __name__ == '__main__':
main()