Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgraded version of the plotTensor function with improved functionality, better error handling, and enhanced readabilitpgraded version of the plotTensor function with improved functionali… #8

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MiChaelinzo
Copy link

…ty, better error handling, and enhanced readability

Key Improvements:

  1. Default Arguments Handling: Improved default argument handling for better readability and maintainability.
  2. Error Handling: Added more descriptive error messages.
  3. Tensor Verification: Ensured tensor verification before proceeding.
  4. Coordinate System Check: Added a check to ensure the coordinate system is Cartesian.
  5. Title and Labels: Improved the logic for generating titles and labels.
  6. Placeholder Functions: Included placeholders for verifyTensor, getSliceData, and plotComponent to make the code more modular and easier to test.

Notes:

  • The verifyTensor, getSliceData, and plotComponent functions are placeholders. You should implement the actual logic in these functions based on your specific requirements.
  • The labelCartesianAxis function is a helper function to map sliced planes to Cartesian labels.

…ty, better error handling, and enhanced readability

### Key Improvements:
1. **Default Arguments Handling**: Improved default argument handling for better readability and maintainability.
2. **Error Handling**: Added more descriptive error messages.
3. **Tensor Verification**: Ensured tensor verification before proceeding.
4. **Coordinate System Check**: Added a check to ensure the coordinate system is Cartesian.
5. **Title and Labels**: Improved the logic for generating titles and labels.
6. **Placeholder Functions**: Included placeholders for `verifyTensor`, `getSliceData`, and `plotComponent` to make the code more modular and easier to test.

### Notes:
- The `verifyTensor`, `getSliceData`, and `plotComponent` functions are placeholders. You should implement the actual logic in these functions based on your specific requirements.
- The `labelCartesianAxis` function is a helper function to map sliced planes to Cartesian labels.
c1 = [1, 1, 1, 1, 2, 3, 4, 2, 2, 3];
c2 = [1, 2, 3, 4, 2, 3, 4, 3, 4, 4];
end

Copy link
Contributor

Choose a reason for hiding this comment

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

Keep this if statement. Non-mixed terms will have duplicated elements.

end

% Helper function to label Cartesian axes
function [xLabelText, yLabelText] = labelCartesianAxis(slicedPlanes)
Copy link
Contributor

@pbbp0904 pbbp0904 Dec 25, 2024

Choose a reason for hiding this comment

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

These are placeholders. (Line 110 and below). Make sure to review the AI-generated code actually provides value.

%
% slicedPlanes - Coordinates that are sliced [coords1, coords2], index values from 1 to 4, double type.
% If you want the resulting slice to be in the X-Y plane for example, input [1, 4]
Copy link
Contributor

Choose a reason for hiding this comment

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

Keep

Copy link
Contributor

@pbbp0904 pbbp0904 left a comment

Choose a reason for hiding this comment

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

Make sure to review the AI-generated code and make sure that it actually provides value instead of placeholders. Keep the helpful comments, needs the display if statement of mixed vs non-mixed.

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