Skip to content

Conversation

@atmoos
Copy link
Owner

@atmoos atmoos commented Dec 17, 2025

Use new .Net 10 / C# 14 language features.

Copy link

Copilot AI left a 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.cs and domain-specific Physics namespace files using the new extension syntax
  • Removed explicit operator implementations and System.Numerics operator interface implementations from all quantity types
  • Added static keyword to lambda expressions in Frequency.cs for 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.

Copy link

Copilot AI left a 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()
Copy link

Copilot AI Dec 17, 2025

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.

Copilot uses AI. Check for mistakes.
@atmoos atmoos merged commit 22ee56c into main Dec 17, 2025
2 checks passed
@atmoos atmoos deleted the useNewLanguageFeatures branch December 17, 2025 20:22
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