Skip to content

Commit

Permalink
Merge pull request #32 from TogetherCrew/fix/29-graph-data-deletion
Browse files Browse the repository at this point in the history
fix: empty memberactivities networkx object!
  • Loading branch information
amindadgar authored Sep 14, 2024
2 parents 3c690f4 + b71935e commit 67fe177
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name="tc-analyzer-lib",
version="1.4.8",
version="1.4.9",
author="Mohammad Amin Dadgar, TogetherCrew",
maintainer="Mohammad Amin Dadgar",
maintainer_email="dadgaramin96@gmail.com",
Expand Down
12 changes: 9 additions & 3 deletions tc_analyzer_lib/tc_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,15 @@ def check_platform(self):
f"Platform with platform_id: {self.platform_id} doesn't exist!"
)

def get_latest_networkx_graph(self, member_acitivities_networkx_data: dict):
def get_latest_networkx_graph(
self, member_acitivities_networkx_data: dict
) -> dict | None:
"""
just getting the latest networkx object (latest graph)
"""
latest_date = max(member_acitivities_networkx_data.keys())
return {latest_date: member_acitivities_networkx_data[latest_date]}
# if there was any data availabe
if member_acitivities_networkx_data.keys():
latest_date = max(member_acitivities_networkx_data.keys())
return {latest_date: member_acitivities_networkx_data[latest_date]}
else:
return None

0 comments on commit 67fe177

Please sign in to comment.