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]: Cannot realize the report #110

Open
1 task done
lperamo opened this issue Nov 27, 2024 · 3 comments
Open
1 task done

[Bug]: Cannot realize the report #110

lperamo opened this issue Nov 27, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@lperamo
Copy link

lperamo commented Nov 27, 2024

What happened?

It's strange because the other day, I do the exact same thing with no issues.
I type this

ecoindex-cli report "/tmp/ecoindex-cli/output/ecocomposer.dev/2024-11-27_142704" "ecocomposer.dev" 

And I get this

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /usr/local/lib/python3.12/site-packages/ecoindex/cli/app.py:325 in report                        │
│                                                                                                  │
│   322 │   │   domain=domain,                                                                     │
│   323 │   │   date=datetime.now(),                                                               │
│   324 │   │   language=html_report_language,                                                     │
│ ❱ 325 │   ).create_report()                                                                      │
│   326 │                                                                                          │
│   327 │   secho(                                                                                 │
│   328 │   │   f"🦄 Amazing! A report has been generated to {output_folder}/index.html",          │
│                                                                                                  │
│ ╭────────────────────────────────────── locals ───────────────────────────────────────╮          │
│ │               domain = 'ecocomposer.dev'                                            │          │
│ │ html_report_language = <Language.en: 'en'>                                          │          │
│ │        output_folder = '/tmp/ecoindex-cli/output/ecocomposer.dev'                   │          │
│ │         results_file = '/tmp/ecoindex-cli/output/ecocomposer.dev/2024-11-27_142704' │          │
│ ╰─────────────────────────────────────────────────────────────────────────────────────╯          │
│                                                                                                  │
│ /usr/local/lib/python3.12/site-packages/ecoindex/cli/report.py:44 in create_report               │
│                                                                                                  │
│    41 │   │   self.translations = get_translations(language=language)                            │
│    42 │                                                                                          │
│    43 │   def create_report(self) -> None:                                                       │
│ ❱  44 │   │   self.create_histogram(                                                             │
│    45 │   │   │   property="requests",                                                           │
│    46 │   │   │   target=target_req,                                                             │
│    47 │   │   │   global_median=median_req,                                                      │
│                                                                                                  │
│ ╭─────────────────────────── locals ───────────────────────────╮                                 │
│ │ self = <ecoindex.cli.report.Report object at 0x7f3cf03c8980> │                                 │
│ ╰──────────────────────────────────────────────────────────────╯                                 │
│                                                                                                  │
│ /usr/local/lib/python3.12/site-packages/ecoindex/cli/report.py:74 in create_histogram            │
│                                                                                                  │
│    71 │   │   target: int,                                                                       │
│    72 │   │   global_median: int,                                                                │
│    73 │   ) -> None:                                                                             │
│ ❱  74 │   │   median = round(self.dataframe[property].median())                                  │
│    75 │   │   self.prepare_graph(property=property)                                              │
│    76 │   │   ax = self.dataframe[property].plot.hist(label="_nolegend_")                        │
│    77 │   │   ax.axvline(                                                                        │
│                                                                                                  │
│ ╭─────────────────────────────── locals ────────────────────────────────╮                        │
│ │ global_median = 78                                                    │                        │
│ │      property = 'requests'                                            │                        │
│ │          self = <ecoindex.cli.report.Report object at 0x7f3cf03c8980> │                        │
│ │        target = 40                                                    │                        │
│ ╰───────────────────────────────────────────────────────────────────────╯                       

Project

Ecoindex CLI

What OS do you use?

Linux

urls

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@lperamo lperamo added the bug Something isn't working label Nov 27, 2024
@lperamo
Copy link
Author

lperamo commented Nov 27, 2024

I am just seeing now that I put a wrong value for the results.
Maybe it should handle this case properly though.

@vvatelot
Copy link
Member

vvatelot commented Dec 9, 2024

Hello @lperamo thanks for the insight !
Could you give more context about the wrong value you set ?

@lperamo
Copy link
Author

lperamo commented Dec 9, 2024

From memory, I think I forgot the extension of the report file.
It must have been something like /tmp/ecoindex-cli/output/ecocomposer.dev/2024-11-27_14270.json I guess.
So here, it was like I was passing a folder and not a file, so it couldn't work :)

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

2 participants