Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Flag <SHOW_LOC_CHART: "True"> Failed #512

Open
liumy-lay opened this issue Jul 19, 2024 · 1 comment
Open

BUG: Flag <SHOW_LOC_CHART: "True"> Failed #512

liumy-lay opened this issue Jul 19, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@liumy-lay
Copy link

liumy-lay commented Jul 19, 2024

Describe the bug
The version I Used: anmol098/waka-readme-stats@master

If the Flag SHOW_LOC_CHART is not filled in in YML, the default is "True" .

At the beginning of Github Action Faild, I couldn't find something wrong,

but when I added show_loc_chart: "Flase", GitHub Action was successful.

Here is the detailed bug description:

Traceback (most recent call last):
  File "/waka-readme-stats/main.py", line 230, in <module>
    run(main())
  File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 6[5](https://github.com/liumy-lay/liumy-lay/actions/runs/10001455264/job/27645080631#step:3:5)3, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/waka-readme-stats/main.py", line 217, in main
    stats = await get_stats()
            ^^^^^^^^^^^^^^^^^
  File "/waka-readme-stats/main.py", line 19[6](https://github.com/liumy-lay/liumy-lay/actions/runs/10001455264/job/27645080631#step:3:6), in get_stats
    await create_loc_graph(yearly_data, GRAPH_PATH)
  File "/waka-readme-stats/graphics_chart_drawer.py", line 69, in create_loc_graph
    max_offset = 0.05 * amax(cumulative.flatten())
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/numpy/core/fromnumeric.py", line 282[7](https://github.com/liumy-lay/liumy-lay/actions/runs/10001455264/job/27645080631#step:3:7), in amax
    return _wrapreduction(a, np.maximum, 'max', axis, None, out,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/numpy/core/fromnumeric.py", line [8](https://github.com/liumy-lay/liumy-lay/actions/runs/10001455264/job/27645080631#step:3:8)8, in _wrapreduction
    return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: zero-size array to reduction operation maximum which has no identity
sys:1: RuntimeWarning: coroutine 'AsyncClient.get' was never awaited

Expected behavior

For new users of Wakatime,to avoid ACTION FAILED the flag SHOW_LOC_CHART should set to False by default in the original code.

image

@liumy-lay liumy-lay added the bug Something isn't working label Jul 19, 2024
@liumy-lay liumy-lay changed the title BUG| Flag SHOW_LOC_CHART: "True" Failed BUG: Flag <SHOW_LOC_CHART: "True"> Failed Jul 19, 2024
@dappsar
Copy link

dappsar commented Aug 13, 2024

Same error with SHOW_LOC_CHART = False.
This is the configuration I am using:


on:
  workflow_dispatch:
  schedule:
    # Runs at 00:00AM UTC
    - cron: '30 18 * * *'

jobs:
  update-readme: # https://wakatime.com/projects
    name: Update Readme with Metrics
    runs-on: ubuntu-latest
    steps:
      - uses: anmol098/waka-readme-stats@master #PLEASE USE MASTER BRANCH
        with:
          WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }} # https://wakatime.com/api-key
          GH_TOKEN: ${{ secrets.GH_TOKEN }}
          SHOW_PROJECTS: "False"
          SHOW_LINES_OF_CODE: "True" 
          SHOW_LOC_CHART: "False"
          LOCALE: "en"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants