Add Ruff configuration from course-materials Lab 6#30
Open
Copilot wants to merge 2 commits into
Open
Conversation
Agent-Logs-Url: https://github.com/advanced-computing/bouncing-penguin/sessions/070078ad-7706-4041-91bf-bf4cb8058c06 Co-authored-by: afeld <86842+afeld@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add Ruff configuration from course materials
Add Ruff configuration from course-materials Lab 6
May 14, 2026
Member
|
Missed this step in Lab 6. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the standard Ruff linting configuration from
advanced-computing/course-materialsLab 6 guidance to this repo.Changes
pyproject.toml— created with the Lab 6 Ruff config:line-length = 100,E501suppressedB,C90,E,F,I,N,PD,PLR,SIM,UP,WOriginal prompt
Add the Ruff configuration from the course materials to the repository
advanced-computing/bouncing-penguin.Context:
advanced-computing/course-materialssay to add the Ruff configuration from that repository'spyproject.toml.advanced-computing/course-materials/blob/main/pyproject.toml.Required Ruff configuration to add:
Notes:
pyproject.toml, create one and add the Ruff configuration there.main.The following is the prior conversation context from the user's chat exploration (may be truncated):
User: Give feedback on the code quality in this repository
Assistant: The repository is pretty solid for a student project, with clear structure, useful tests, and good separation between app UI, data loading, and validation. The biggest code-quality issues are an oversized main app file, some duplicated schema/column-mapping logic, and a few maintainability risks around query construction and testing depth.
What’s good
streamlit_app.pyutils.pyvalidation.pyload_data_to_bq.pytests/streamlit_app.pyis long, but much of it is broken into focused rendering functions likerender_kpis,render_recovery_chart, andrender_covid_context, which is a good sign of decomposition.validation.pyis a strong quality signal; it shows the team is thinking about data contracts, not just visualization.Main code-quality concerns
1.
streamlit_app.pyis too largeAt ~900 lines,
streamlit_app.pyis doing too much: page setup, sidebar config, filtering logic, KPI computation orchestration, chart construction, explanatory copy, and top-level control flow. That makes it harder to review, test, and evolve.Examples:
main()Recommendation: split this into modules like:
ui/layout.pyui/overview.pyui/comparison.pyui/events.pyservices/data_access.pyservices/metrics.pyThat would improve readability and make unit testing easier.
2. Some logic is duplicated across files
The legacy/current MTA column rename mapping appears in both
utils.pyandvalidation.py, and a related rename map also exists inload_data_to_bq.py. That creates drift risk if the upstream schema changes again.Examples:
MTA_LEGACY_COLUMN_MAPinutils.pyMTA_RENAME_MAPinvalidation.pyMTA_RENAME_MAPinload_data_to_bq.pyRecommendation: centralize schema/column-name normalization in one module and import it everywhere.
3. Tests are good but still somewhat narrow
The tests cover important helpers, but they mostly target:
What’s missing:
streamlit_app.pylogic_load_tableRecommendation: add unit tests around:
_build_select_expressions_resolve_mta_columnsget_recovery_with_deltaget_weekday_weekend_comparisonbuild_covid_context_frame4. Query construction is serviceable but not very elegant
_load_table()inutils.pybuilds SQL via string interpolation. Because dates and columns are internally controlled, this is not immediately dangerous, but it’s less robust than using...This pull request was created from Copilot chat.