Source code for pyleecan.Methods.Output.Output.print_memory

from sys import getsizeof
from ....Functions.Load.import_class import import_class





[docs]def detail_prop(self, prop_name, tab_level=1): """Detail the content of the property""" tab = "" for _ in range(tab_level): tab += " " mem_str = "" prop = getattr(self, prop_name) for attr in dir(prop): if ( # Not method not callable(getattr(prop, attr)) # Not private properties and not attr.startswith("_") # Not following properties and attr not in ["VERSION", "logger_name", "parent"] ): mem_str += ( tab + prop_name + "." + attr + ": " + str(getsizeof(getattr(prop, attr))) + " o\n" ) return mem_str