Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 4, 2026

Addresses PEP8 whitespace violations in fispact-related files and improves test coverage to 80%+ across all three modules.

Changes

PEP8 Compliance

  • W293: Removed whitespace from 28 blank lines
  • E226: Fixed spacing around arithmetic operators
  • W504: Fixed line breaks in boolean expressions

Files: fispact_output_reader.py, fispact_fluxes_writer.py, fispact_analysis.py

Test Coverage

Added 36 tests covering error handling and edge cases:

  • fispact_output_reader.py (89% → 92%)

    • File operation errors (FileNotFoundError, IOError)
    • Validation functions (add_time_columns, parse functions)
    • Legacy version detection
  • fispact_fluxes_writer.py (73% → 82%)

    • Invalid input types and empty data
    • Energy group boundary checks
  • fispact_analysis.py (75% → 81%)

    • DataFrame validation in filter functions
    • Plotting functions with missing columns

Example error handling added:

def add_time_columns(df, base_time_col="time_years"):
    if not isinstance(df, pd.DataFrame):
        raise ValueError("df must be a pandas DataFrame")
    if base_time_col not in df.columns:
        raise ValueError(f"Column '{base_time_col}' not found in DataFrame")
    # ...

Metrics

  • Tests: 27 → 63 (all passing)
  • Overall coverage: 82% → 87%
Original prompt

for the fispact related files pep8 compliane improvements particularly whitespace issues, also improve test coverage for fispact_output_reader, fispact_fluxes_writer and fispact_analysis


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 4 commits January 4, 2026 20:21
Co-authored-by: py1sl <1928511+py1sl@users.noreply.github.com>
Co-authored-by: py1sl <1928511+py1sl@users.noreply.github.com>
Co-authored-by: py1sl <1928511+py1sl@users.noreply.github.com>
Co-authored-by: py1sl <1928511+py1sl@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve PEP8 compliance and test coverage for fispact files Fix PEP8 whitespace violations and improve test coverage for fispact modules Jan 4, 2026
Copilot AI requested a review from py1sl January 4, 2026 20:31
Copy link
Owner

@py1sl py1sl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

improved pep8 and lots of tests consistent with testing malformed inputs raise errors

@py1sl py1sl marked this pull request as ready for review January 4, 2026 20:50
@py1sl py1sl merged commit b0cee36 into master Jan 4, 2026
1 check passed
@py1sl py1sl deleted the copilot/fix-pep8-whitespace-issues branch January 4, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants