Skip to content

Conversation

@zsarnoczay
Copy link
Collaborator

Code Quality Improvements and Enhanced Hazus Usability

Overview

This pull request introduces v2.1.0 of the Damage and Loss Model Library, focusing on code quality enhancements and improved usability for Hazus assessments while maintaining full backward compatibility.

Key Changes

Code Quality Improvements

  • Applied comprehensive code formatting and linting using Ruff across 15 Python files
  • Fixed docstring formatting and missing docstring issues
  • Cleaned up import statements and removed unused code
  • Standardized quote usage and line spacing throughout the codebase
  • Updated configuration files for better code quality enforcement

Enhanced Hazus Assessment Usability

  • Relaxed Input Validation: Improved flexibility for seismic and flood assessments:
    • Allow HeightClass attribute for seismic structural systems (W1, W2, S3, PC1, MH) that don't require it in Hazus methodology
    • Remove PlanArea field from auto-populated seismic configuration as it's no longer needed
    • Allow RES1 occupancy buildings to have more than 3 stories in flood assessments, aligning with FEMA technical manual interpretation

Documentation Updates

  • Added comprehensive v2.1.0 release notes with detailed change descriptions
  • Updated README.md to highlight v2.1.0 improvements
  • Enhanced CHANGELOG.md with structured release information
  • Maintained consistency with established documentation formatting conventions

Relax validation constraints for seismic and flood assessments to improve
usability while maintaining analysis accuracy:

- Allow HeightClass attribute for seismic structural systems (W1, W2, S3,
  PC1, MH) that don't require it in Hazus methodology
- Remove PlanArea field from auto-populated seismic configuration as it's
  no longer needed
- Allow RES1 occupancy buildings to have more than 3 stories in flood
  assessments, aligning with FEMA technical manual interpretation

These changes provide users more flexibility in input specification while
ensuring unused attributes don't affect analysis results.
This commit addresses code quality issues identified by ruff format, ruff check,
and codespell tools across the entire codebase. The changes maintain existing
functionality while improving code consistency, readability, and adherence to
Python best practices.

## Changes Made:

### Code Formatting and Linting (ruff format & ruff check)
- Applied consistent code formatting across 15 Python files
- Fixed docstring formatting and missing docstring issues (D100, D211, D212)
- Cleaned up import statements and unused code
- Standardized quote usage and line spacing

### Configuration Updates
- Updated `pyproject.toml` to include additional ruff ignore rules (PLR2004, D100)
- Updated `.gitignore` for better file exclusion patterns

## Testing:
All changes have been validated to ensure:
- Code passes ruff format checks
- Code passes ruff linting rules
- Spelling issues resolved via codespell
- No breaking changes to existing functionality
This commit updates all documentation files in preparation for the v2.1.0 release:

- Add comprehensive v2.1.0 release notes (doc/source/release_notes/v2.1.0.rst) detailing code quality improvements and enhanced Hazus assessment usability
- Update README.md to reference v2.1.0 and highlight improvements over v2.0.0
- Add v2.1.0 section to CHANGELOG.md with detailed breakdown of changes and fixes

All documentation follows established formatting conventions and maintains consistency with previous release documentation structure.
This commit updates all documentation files in preparation for the v2.1.0 release:

- Add comprehensive v2.1.0 release notes (doc/source/release_notes/v2.1.0.rst) detailing code quality improvements and enhanced Hazus assessment usability
- Update README.md to reference v2.1.0 and highlight improvements over v2.0.0
- Add v2.1.0 section to CHANGELOG.md with detailed breakdown of changes and fixes

All documentation follows established formatting conventions and maintains consistency with previous release documentation structure.
@zsarnoczay zsarnoczay merged commit 0cc4463 into NHERI-SimCenter:main Sep 12, 2025
3 checks passed
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.

1 participant