Add ureg.constants for accessing physical constants#2299
Add ureg.constants for accessing physical constants#2299andrewgsavage wants to merge 12 commits into
Conversation
hgrecco#1078) Physical constants are now accessible as Quantity objects via ureg.constants.<name> (in default system base units) and ureg.sys.<system>.<name> (in system-specific base units), while ureg.<name> continues to return a Unit for backward compatibility. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ureg.sys.imperial.speed_of_light now returns a Unit (unchanged behaviour). ureg.sys.imperial.constants.speed_of_light returns a Quantity in the system's base units via a new SystemConstantsAccessor class. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Access to constants in system units is available via ureg.constants.<name>.to_base_units(system=<system>). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Merging this PR will not alter performance
|
…mbership Aliases like ureg.constants.c now correctly return a Quantity instead of falling through to the Unit. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
This is ready for merging. ureg.constants.c.to_base_units('imperial')
327857018.8101487 yard / second |
Summary
ureg.constantsaccessor for convenient access to physical constants__dir__toGroupfor autocomplete supportCloses #1078