Skip to content

Conversation

@pm-gusmano
Copy link
Contributor

Summary

Improves the waveClass constructor by replacing string-based type validation with a MATLAB enumeration. This implementation suggests the different wave types to users as they construct waveClass objects, and reduces boilerplate code.

Changes

  • Modified: source/objects/waveClass.m - Updated constructor to use arguments block with internal.waveType validation
  • Added: source/objects/+internal/waveType.m - New enumeration defining all valid wave types

Benefits

  • Type Safety: Compile-time validation prevents invalid wave type strings
  • Better IntelliSense: IDE can provide autocomplete for valid wave types
  • Future-proof: Easy to add new wave types by extending the enumeration
  • Backward Compatible: Existing functionality unchanged

@pm-gusmano pm-gusmano changed the title Ergonomics waveClass Constructor Improvements Jul 25, 2025
@kmruehl kmruehl added the Wave Class Wave Classs (waveClass.m) label Jul 26, 2025
@kmruehl
Copy link
Collaborator

kmruehl commented Jul 26, 2025

Thanks @pm-gusmano!

@akeeste akeeste self-requested a review July 28, 2025 14:50
@akeeste akeeste self-assigned this Jul 28, 2025
@MShabara
Copy link
Contributor

@pm-gusmano Thank you for applying these changes, the review is complete and its ready for merging.

@MShabara MShabara merged commit 440b635 into WEC-Sim:dev Jul 28, 2025
10 checks passed
@pm-gusmano pm-gusmano deleted the ergonomics branch July 28, 2025 18:43
@kmruehl
Copy link
Collaborator

kmruehl commented Jul 28, 2025

Thanks @pm-gusmano and @MShabara

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Wave Class Wave Classs (waveClass.m)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants