Skip to content

Refactor Wikicharts code to follow Python conventions, streamline imports,...

Hghani requested to merge wikicharts_refactor into main

Refactor Wikicharts code to follow Python conventions, streamline imports, update dependencies, and standardize output formats and filenames.

Refactor code to follow Python conventions, streamline imports, update dependencies, and standardize output formats and filenames.

  • Converted comments to docstring for readability.
  • Eliminated unnecessary imports to clean up the code.
  • Removed commented-out code to reduce clutter.
  • Ensured that dependencies in the resources directory are updated automatically (added sql queries to calculate pipline and changed necessary csv files to tsv).
  • Consistently use png format for images rather than jpg to maintain.
  • Updated output file names for regional unique device and regional active editor graphs for easier identification without viewing the images one by one.
  • Split chart code into separate modules where it made sense to enhance modularity and maintainability.
  • Added parameter to ensure pageviews_user_vs_automated chart (and future charts) have the same aspect ratio as other charts despite annotation length.
  • Altered pageviews by referral chart to be consistent with other time series charts without Year-over-Year overlay.

Note: map_charts.py requires additional refactoring for now.

Bug: T359695 Bug: T365210

Merge request reports