Coder Social home page Coder Social logo

achevrot / impunity Goto Github PK

View Code? Open in Web Editor NEW
9.0 2.0 0.0 3.65 MB

A Python library to check physical units

Home Page: https://achevrot.github.io/impunity/

License: MIT License

Python 97.56% C++ 1.22% F# 0.89% OCaml 0.33%
converter quantity static units

impunity's People

Contributors

achevrot avatar dependabot[bot] avatar xoolive avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

impunity's Issues

problems with list warnings

In some cases, lists shouldn't raise warnings:

a1: Annotated(list[float], "m")   # should raise a warning
a2: Annotated(list[float], "m") = []  # should raise a warning
a3 = []  # should not raise a warning

x: "m"
a4 = [x]  # should raise a warning

y: "ft"
y, *_ = a4  # does not convert units

Annotated Assignment when the value of the node is iterable

alt_m1: "m" = 1000
alt_m2: "m" = 1000
alt_m3: "m" = 1000
l: "m" = [alt_m1, alt_m2, alt_m3]
self.assertEqual(l[0], 1000)
l2: "ft" = [alt_m1, alt_m2, alt_m3]
self.assertAlmostEqual(l2[0], 3280.84, delta=1e-2)

First test is fine but second one fails : can't multiply sequence by non-int of type 'float'

Would need to change the Annotated Assign node visitor implementation to do so.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.