timeline
get_timeline_df ¶
get_timeline_df(
json_path: Optional[Path],
timeline_data: dict,
repo: str,
) -> pd.DataFrame
Create timeline DataFrame from timeline data in JSON file
If global variable read_cached_df
is True, and .feather file with cached
data exists, read DataFrame from that file. If global variable save_cached_df
is True, and .feather file with cached data does not exist, save DataFrame
to that file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
json_path
|
Optional[Path]
|
used to find cached data, if present, and possibly for error and debug messages (when logging) |
required |
timeline_data
|
dict
|
per-repo data to convert to pd.DataFrame and process; usually there is only a single repo (single key) in |
required |
repo
|
str
|
data from which repo to extract from |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
augmented dataframe, for example with 'n_commits' column added |
Source code in src/diffinsights_web/datastore/timeline.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
|