diff --git a/cocluto/cluster_stats.py b/cocluto/cluster_stats.py index 41bd41d..72c4dfd 100644 --- a/cocluto/cluster_stats.py +++ b/cocluto/cluster_stats.py @@ -315,7 +315,7 @@ def draw_machine_age_pyramid_graph(inventory): :param Inventory inventory: the inventory database """ - oldest_age = 20 + oldest_age = 25 age_histogram = np.zeros(shape=(oldest_age)) rows = inventory.query("SELECT * FROM machines") @@ -328,7 +328,9 @@ def draw_machine_age_pyramid_graph(inventory): if purchase_date is not None: purchase_time = matplotlib.dates.date2num(purchase_date.date()) # noqa: F841 age = datetime.datetime.now() - purchase_date - age_histogram[age.days // 365] += 1 + age_in_years = age.days // 365 + if age_in_years < oldest_age: + age_histogram[age_in_years] += 1 # print(name, age) fig, ax = plt.subplots() @@ -349,7 +351,7 @@ def draw_core_age_pyramid_graph(inventory): :param Inventory inventory: the inventory database """ - oldest_age = 20 + oldest_age = 25 age_histogram = np.zeros(shape=(oldest_age)) rows = inventory.query("SELECT * FROM machines") @@ -362,7 +364,9 @@ def draw_core_age_pyramid_graph(inventory): if purchase_date is not None: purchase_time = matplotlib.dates.date2num(purchase_date.date()) # noqa: F841 age = datetime.datetime.now() - purchase_date - age_histogram[age.days // 365] += inventory.get_num_cores(name) + age_in_years = age.days // 365 + if age_in_years < oldest_age: + age_histogram[age_in_years] += inventory.get_num_cores(name) # print(name, age) fig, ax = plt.subplots() diff --git a/setup.py b/setup.py index 30a0429..6cfec4d 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup setup( name='cocluto', - version=1.07, + version=1.08, description='compute cluster utility tools', url='https://git.ipr.univ-rennes1.fr/graffy/cocluto', author='Guillaume Raffy',