Skip to content

Commit

Permalink
Merge pull request #17 from MostHappyCougar/ready_to_test
Browse files Browse the repository at this point in the history
Coomments extended
  • Loading branch information
MostHappyCougar authored Feb 6, 2023
2 parents a052b0d + 6008027 commit fd153d0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion code/cov_tool/config_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class IReadConfig(ABC):
'''
Interface that should be relized for configuration parsing. May be relized in different classes that requires to use config
Interface that should be realized for configuration parsing. May be realized in different classes that require to use config
'''

@abstractmethod
Expand Down
Binary file modified code/cov_tool/output/EXAMPLE/EX_TEST_stats.xlsx
Binary file not shown.
Binary file modified code/cov_tool/output/EXAMPLE/EX_TEST_stats_vis.pdf
Binary file not shown.
6 changes: 6 additions & 0 deletions code/cov_tool/state_transitions_diagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,24 @@ def analyse(self) -> None:
self.sorted_dataframe = self.dataframe.sort_values([*self.get_parameter()["Group"], *self.get_parameter()["Seq"]])
self.aggregated_table = pd.DataFrame(columns=["seq", "object", "transitions", "states"])

#Make aggregated dataframe from raw sorted input.
#To consider multiparametrized states we should add list of values foreach parameters list per dataframe index
self.aggregated_table["seq"] = self.sorted_dataframe[self.get_parameter()["Seq"]].astype(str).apply(", ".join, axis=1)
self.aggregated_table["object"] = self.sorted_dataframe[self.get_parameter()["Group"]].astype(str).apply(", ".join, axis=1)
self.aggregated_table["transitions"] = self.sorted_dataframe[self.get_parameter()["Transitions"]].astype(str).apply(", ".join, axis=1)
self.aggregated_table["states"] = self.sorted_dataframe[self.get_parameter()["States"]].astype(str).apply(", ".join, axis=1)

#This fields will be used for build path statistics
self.transitions_list = []
self.transitions_dataframe = pd.DataFrame(columns=["transitions"])
self.stransitions_stats = pd.DataFrame(columns=["TransitionID", "Transition", "Count"])

#Lists for unique entities to iterate states and transitions
self.objects = self.aggregated_table["object"].unique()
self.states = self.aggregated_table["states"].unique()
self.transitions = self.aggregated_table["transitions"].unique()

#State-Transitions Graph building
self.graph = gv.Digraph(name=self.get_parameter()["FilesName"], graph_attr={"concentrate":"true", "imagescale": "true"}, strict=True)
self.graph.node("START", "START", fontcolor="white", fillcolor="red", style="filled")
self.graph.node("END", "END", fontcolor="white", fillcolor="red", style="filled")
Expand All @@ -98,6 +103,7 @@ def analyse(self) -> None:
self.state_transition = pd.DataFrame([[transition]], columns=["transitions"])
self.transitions_dataframe = pd.concat([self.transitions_dataframe, self.state_transition]).astype(str)

#Make path statistics
self.trans_stat = pd.DataFrame(np.c_[np.unique(self.transitions_dataframe, return_counts=1)], columns=["Transition", "Count"])
self.trans_stat.index.name = "TransitionID"
self.save_results()
Expand Down

0 comments on commit fd153d0

Please sign in to comment.