pillargg / pillar_algos

Finds best timestamps to cut at
https://docs.pillar.gg/pillar_algos/
GNU General Public License v3.0
1 stars 0 forks source link

.5 minute value causes errors #22

Closed RusseII closed 3 years ago

RusseII commented 3 years ago

2 minute clips are way too long for our use case. Wondering if there will be any issues if we set the cliplength to be very low, around 10 seconds, or maybe 30 seconds.

pomkos commented 3 years ago

No you can already do that with the min_ variable in all algos

RusseII commented 3 years ago

Yes I know we can do that I was double checking that a very low value would not mess up the algorithm

pomkos commented 3 years ago

Only one way to find out! Only thing I can think of is if there's not a lot of chat activity in 10 seconds, but that just means fewer results.

RusseII commented 3 years ago

Setting a minute value of .5 causes 100% of the lambda functions to error with the following error:

{ "errorMessage": "'chats_per_0.5min'", "errorType": "KeyError", "stackTrace": [ " File \"/var/task/handler.py\", line 33, in handler\n algo2_result = algo2.run(allmessages, min=.5, limit=10)\n", " File \"/var/task/pillaralgos/algo2.py\", line 144, in run\n json_results = d.results_jsonified(results, first_stamp, f\"chatsper{min_}min\")\n", " File \"/var/task/pillaralgos/helpers/data_handler.py\", line 304, in results_jsonified\n results = results.sort_values(\n", " File \"/var/task/pandas/core/frame.py\", line 5455, in sort_values\n k = self._get_label_or_level_values(by, axis=axis)\n", " File \"/var/task/pandas/core/generic.py\", line 1684, in _get_label_or_level_values\n raise KeyError(key)\n" ]

additionally - there are multiple places in the codebase where the hardcoded value is being used instead of the variable - https://github.com/pillargg/twitch_chat_analysis/blob/9daca89b47f19fc94a916b240b67bbfbef9b13ee/pypi/prod/pillaralgos/algo2.py#L31

pomkos commented 3 years ago

ugh

pomkos commented 3 years ago

UGH

RusseII commented 3 years ago

https://github.com/pillargg/twitch_chat_analysis/blob/9daca89b47f19fc94a916b240b67bbfbef9b13ee/pypi/prod/pillaralgos/algo2.py#L69 this line is causing the error since other places in the code it is hardcoded to use the 2 minute datafram

pomkos commented 3 years ago

Only an issue for algo2? I just went through all my algos and only algo2 has the hardcoding.

pomkos commented 3 years ago

https://github.com/pillargg/twitch_chat_analysis/blob/9daca89b47f19fc94a916b240b67bbfbef9b13ee/pypi/prod/pillaralgos/algo2.py#L69 this line is causing the error since other places in the code it is hardcoded to use the 2 minute datafram

Yes that makes sense cuz thats creating a dataframe with col Xmin, but everything else is creating with col 2min

pomkos commented 3 years ago

Fixed. Was a hardcoding issue in algo2. Made a note to unit test all possible params for each algo.

pomkos commented 3 years ago

Duplicate of #21

pomkos commented 3 years ago

Marked as duplicate since both were in algo2, both contributing to bad results, and both were fixed with the same commit (see #21)