-
Notifications
You must be signed in to change notification settings - Fork 0
Use new language features #103
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR modernizes the codebase by adopting new .NET 10 and C# 14 language features, primarily the new extension syntax for defining operators outside of type definitions. This allows operators to be organized by physical domain rather than scattered across individual quantity types, improving code organization and maintainability.
Key changes:
- Refactored operators from individual quantity types to centralized
Operators.csand domain-specific Physics namespace files using the newextensionsyntax - Removed explicit operator implementations and
System.Numericsoperator interface implementations from all quantity types - Added
statickeyword to lambda expressions inFrequency.csfor performance optimization
Reviewed changes
Copilot reviewed 43 out of 43 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| source/Atmoos.Quantities/Quantities/*.cs | Removed explicit operator implementations, internal From methods, and System.Numerics interface implementations from all quantity types (Volume, Velocity, Time, Temperature, Pressure, Power, Mass, Length, Frequency, Force, Energy, ElectricalResistance, ElectricPotential, ElectricCurrent, DataRate, Data, Area, Acceleration) |
| source/Atmoos.Quantities/Physics/MechanicalEngineering.cs | New file organizing mechanical physics operators (Geometry and Kinematics) using extension syntax |
| source/Atmoos.Quantities/Physics/Generic.cs | New file for generic operators between Double, Time, and Frequency using extension syntax |
| source/Atmoos.Quantities/Physics/ElectricalEngineering.cs | New file organizing electrical physics operators (Ohm's Law and Power Laws) using extension syntax |
| source/Atmoos.Quantities/Physics/ComputerScience.cs | New file organizing computer science operators (Data, DataRate, Time) using extension syntax |
| source/Atmoos.Quantities/Operators.cs | New file providing generic comparison, arithmetic, and scalar operators for all quantities using extension syntax |
| source/Atmoos.Quantities/IQuantity.cs | Commented out operator interface implementations pending C# roles support; removed static operator declarations |
| source/Atmoos.Quantities/Extensions.cs | Converted Serialize and Deconstruct extension methods to use new extension syntax; added internal Create helper |
| source/Atmoos.Quantities/Atmoos.Quantities.csproj | Bumped version from 2.1.1 to 2.2.0 |
| source/Atmoos.Quantities.Units/Atmoos.Quantities.Units.csproj | Switched from PackageReference to ProjectReference for development |
| source/Atmoos.Quantities.Units.Test/*.cs | Updated tests to use explicit 1d literals for division operators and deconstruction patterns instead of implicit conversion |
| source/Atmoos.Quantities.TestTools/Convenience.cs | Added overloads to handle division via function parameter and deconstruction for value extraction |
| source/Atmoos.Quantities.Test/OperatorsTest.cs | New comprehensive test file for all operator implementations |
| source/Atmoos.Quantities.Test/ExtensionsTest.cs | Added Physics namespace using directive |
| source/Atmoos.Quantities.Serialization/*.csproj | Switched from PackageReference to ProjectReference for development |
| source/Atmoos.Quantities.Serialization/*/Usings.cs | Added Physics namespace to global usings |
| source/Atmoos.Quantities.Benchmark/*.cs | Updated benchmark return types from Double to actual quantity types; updated benchmark results |
| source/.editorconfig | Added max_line_length setting of 180 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 43 out of 43 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
|
|
||
| [Fact] | ||
| public void GreaterOrEqualComparesTrueWithSomeSmallerValue() |
Copilot
AI
Dec 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a spelling/naming error in the test method name. "GreaterOrEqualComparesTrueWisomeScalarthSmallerValue" contains a typo - it appears "WisomeScalarth" should be "WithSmallerValue" or similar. This makes the test name unclear and inconsistent with the other test names in this file.
Use new .Net 10 / C# 14 language features.