question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Include Rankine in imperial units and equivalencies

See original GitHub issue

This is a feature request for the addition of Rankine to temperature units. It is more useful than Fahrenheit in some cases because it is an absolute scale. The conversion between deg_F and degrees Rankine is adding 459.67. See: Rankine Scale

Proposed change in equivalencies (assuming deg_R is Rankine):

def temperature():
    """Convert between Kelvin, Celsius, and Fahrenheit here because
    Unit and CompositeUnit cannot do addition or subtraction properly.
    """
    from .imperial import deg_F
    return Equivalency([
        (si.K, si.deg_C, lambda x: x - 273.15, lambda x: x + 273.15),
        (si.deg_C, deg_F, lambda x: x * 1.8 + 32.0, lambda x: (x - 32.0) / 1.8),
        (si.K, deg_F, lambda x: (x - 273.15) * 1.8 + 32.0,
         lambda x: ((x - 32.0) / 1.8) + 273.15),
        (deg_R, deg_F, lambda x: x + 459.67, lambda x: x + 459.67),
        (deg_R, si.deg_C, lambda x: (x * 1.8) + 491.67, lambda x: ((x-491.67)/1.8),
        (deg_R, si.K, lambda x: x, lambda x: x)], "temperature")

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mhvkcommented, Feb 1, 2020

@DShivansh - sure!

1reaction
simpsonchristocommented, Sep 30, 2019

Yeah, I’d love to give it a try! It’s on my to-do list for next week. @mhvk

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fahrenheit to Rankine Conversion (°F to °R) - Inch Calculator
Convert Fahrenheit to Rankine (°F to °R) with the temperature conversion ... The degree Fahrenheit is a US customary and imperial unit of...
Read more >
Convert Rankine (°R) to other temperature units
671.67 degrees Rankine ( °R ) = 100 degrees Celsius ( °C ) = 212 degrees Fahrenheit ( °F ). How to convert...
Read more >
The international system of units (SI) - conversion factors for ...
An extensive set of conversion factors between the two systems of units is listed in Section 5. In this document, the term inch-pound...
Read more >
Rankine scale - Wikipedia
The Rankine scale is an absolute scale of thermodynamic temperature named after the University of Glasgow engineer and physicist Macquorn Rankine, ...
Read more >
Why do we still need to know about the Rankine temperature ...
Rankine is to Fahrenheit what Kelvin is for Celsius. ... Kelvin scales have no additive offset between them, the conversion route Fahrenheit ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found