-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Task Summary
Remove shackles on Base Unit constructos
Context / Background
Description:
Currently, several unit classes in KISU enforce value constraints (e.g., Temperature does not allow negative Kelvin values) directly in their constructors. While this enforces correctness early, it limits the ability to perform operations like deltas or intermediate calculations where such values may be temporarily valid.
This approach increases flexibility and aligns better with mathematical operations, testing, and Kotlin idioms.
Proposed Steps or Checklist
- Remove validation logic from constructors (e.g., no more require(value >= 0)).
- Move these constraints into dedicated validation functions or extension methods.
- Consider providing factory methods for safe construction, such as Kelvin.requireValid(value)
Additional Notes
No response
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request