Skip to content

Conversation

@harryswift01
Copy link
Member

Summary

This PR adds a rich splash screen to CodeEntropy that displays program metadata dynamically fetched from the CITATION.cff file. Additionally, it refactors water entropy handling for more robust and dynamic residue grouping, improving logging and test coverage.

Changes

Splash Screen and Metadata

  • Display splash screen on program start using rich tables.
  • Include metadata from the CITATION.cff file fetched directly from GitHub.
  • Show program name, version, authors, and citation info in a visually appealing format.
  • Simplify and unify console and logging setup using Rich.
  • Capture and log console output to file with detailed formatting.

Water Entropy Refactor (Secondary)

  • Replace manual filtering of water residues with MDAnalysis selection (select_atoms("resname WAT")) for robust residue handling.
  • Dynamically determine residue_group from Sorient_dict keys, including only residues present in the water selection.
  • Update group label logging to use the new selection method.
  • Add unit test test_calculate_water_entropy_adds_resname to ensure residue_names.add(resname) is exercised.

Other Improvements

  • Remove redundant config YAML warnings.
  • Fix and update unit tests to reflect refactors.
  • Add frame count to entropy outputs for consistency.
  • Refine progress bars across entropy calculations for clarity and consistency.

Impact

  • Users see a professional, informative splash screen at program start.
  • More robust and dynamic handling of water residues in entropy calculations.
  • Improved test coverage and maintainability.
  • Accurate logging of frame counts, residue groups, and entropy components.
  • Foundation laid for future enhancements to console outputs and metadata display.

- incorporate the use of the `Python` library `rich` to enhance the outputs on the terminal
- addition of splash screen with metadata using the `CITATION.cff` file
- progress bars used to show the progress of each calculation
- using `rich` tables to ensure consistency in the output
- Simplified and unified logging configuration using Rich console
- Enabled console output recording for capturing all printed output
- Added file handlers for main, error, command, and mdanalysis logs
- Implemented method to save buffered console output to file after run
- Updated the ability to update logging levels dynamically
- Additional progress bars have been added to the `build_covariance_matrices`
- Additional test cases have been implemented to increase the coverage of functions missed by test cases
- Unified and simplified progress bar logic across entropy workflows for consistency and clarity
- Replaced multiple bars with a single comprehensive progress bar showing current molecule and level
- Improved progress titles to reflect specific calculation stages (e.g. building covariance matrices, calculating conformational states)
- Renamed molecule label column to "Residue ID" for scientific accuracy and clearer representation
- Use `requests` to get the `CITATION.cff` file from GitHub rather than locally in the project directory
- If there are network issues display a minimal splash screen with just ASCII art
- Update unit tests to ensure all new functionality is covered
…clude `requests` in `pyproject.toml` dependencies
… components

- Added a new `frame_count` column to the `add_residue_data` function.
- Retrieved `frame_count` from `levels.py` and integrated it into `entropy.py`
- Included `frame_count` for united atom level entries
- Ensured consistent inclusion of frame count in water entropy calculations
- Corrected aggregation logic in `_finalize_molecule_results` to ensure accurate summation of entropy values per molecule
- Integrated water entropy into the same group framework as other molecules:
 - Each water group now gets a proper `group_id`, label, residue count, and atom count
 - Entropy components (orientational, vibrational-translational, vibrational-rotational) are logged consistently
- Updated `_handle_water_entropy` to:
 - Compute entropy per water group
 - Exclude water from selection string when `--water-entropy` is enabled
 - Use MDAnalysis residue names to build accurate group labels
- Modified `execute` to:
 - Separate `water_groups` from `nonwater_groups`
 - If `water_entropy=True`: handle waters separately and exclude them from later analysis
 - If `water_entropy=False`: merge water back into non-water groups so they are included in full entropy calculation
- Improved `DataLogger` outputs:
 - Added/cleaned group label mapping table for better tracking
 - Ensured consistent handling of residue names and frame counts
- Replace manual filtering of water residues with MDAnalysis selection language (`select_atoms("resname WAT")`) for more robust residue handling
- Dynamically determine `residue_group` from Sorient_dict keys, including only residues present in the water selection
- Update group label logging to use the new selection method
- Add unit test `test_calculate_water_entropy_adds_resname` to ensure the `residue_names.add(resname)` path is exercised
@harryswift01 harryswift01 added this to the 1.0.0 release milestone Aug 22, 2025
@harryswift01 harryswift01 self-assigned this Aug 22, 2025
@harryswift01 harryswift01 added the feature request New feature or request label Aug 22, 2025
@harryswift01 harryswift01 linked an issue Aug 22, 2025 that may be closed by this pull request
3 tasks
…mes))` to ensure the correct range is captured
- Updated `_calculate_water_entropy` and related methods to properly aggregate orientational, translational, and rotational entropy
- Incorporated actual water counts from covariances for accurate logging
- Revised unit tests to reflect updated method signatures and behaviors, ensuring `add_residue_data` and `add_group_label` calls are correctly tested
- Stop adding aggregated water entropy results to the Total Group  table, as this is incorrect
@harryswift01 harryswift01 merged commit a47869f into main Aug 22, 2025
7 checks passed
@harryswift01 harryswift01 deleted the 38-add-splash-screen-metadata branch August 22, 2025 16:02
jimboid pushed a commit that referenced this pull request Sep 3, 2025
Introduce Splash Screen with Metadata and Refactor Water Entropy Handling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Splash Screen & Metadata

4 participants