Add ability to add taste names to plots - #38
Open
abuzarmahmood wants to merge 1 commit into
Open
Conversation
Add optional taste_names parameter to all three main plotting functions: - generate_raster_plot() - generate_detailed_plot() - plot_env_pred_overlay() This allows users to specify custom taste names (e.g., 'Sucrose', 'NaCl') instead of generic labels like 'Taste 0', 'Taste 1'. Maintains backward compatibility by defaulting to 'Taste N' format when taste_names is not provided. Resolves #37 Co-authored-by: Ona <no-reply@ona.com>
Member
Author
Implementation DetailsThis solution adds a Key Features:
Code Pattern:The implementation follows a consistent pattern across all functions: if taste_names is not None and taste < len(taste_names):
taste_label = taste_names[taste]
else:
taste_label = f'Taste {taste}'This ensures that:
Modified Functions:
All docstrings have been updated to document the new parameter. |
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.
Summary
This PR addresses issue #37 by adding the ability to specify custom taste names in all plotting functions.
Changes
Added an optional
taste_namesparameter to three main plotting functions:generate_raster_plot()generate_detailed_plot()plot_env_pred_overlay()Usage
Users can now pass a list of taste names to customize plot labels:
Backward Compatibility
When
taste_namesis not provided (or isNone), the functions default to the original behavior of displaying 'Taste 0', 'Taste 1', etc.Testing
All functions maintain their original behavior when the parameter is not provided, ensuring backward compatibility with existing code.
Closes #37