Coder Social home page Coder Social logo

Comments (8)

phlptp avatar phlptp commented on July 24, 2024 1

I hope to make a new release with these changes within this coming week.

from units.

phlptp avatar phlptp commented on July 24, 2024

Deal with these one by one

Metres

I think I missed a capital letter in the check for this spelling, will be fixed

cars/hour/meter^2

interpreted as centi- ares =m^2
a little odd but I would consider it correct

degrees C

0.0174532925199432955s*A*rad | to be fixed right now reading as degrees (angle) * coulomb

cm+cm

+ is usually non-sensical in terms of units so interpreted as * in non numeric context. Could consider alternate interpretations if the units have the same base then it could be additive

kM

kmol/L correct, but may be surprising (M= molarity = mol/L, so this seems correct) correct,

Others

Still exploring these
| gramm | 6.47989100000000217e-23gm | this would be a typo, or German spelling
| kilogramm | 6.47989100000000188e-20g
m | ?

| fps | ft/s | not sure if this is the most common interpretation? Isn't frames per second more common?

| inchy | 4830819306288062m^3/[c] | would expect an error instead of bad parsing
| fln_oz | 9.7132811577355196e-08g*cd/m^2 | would expect an error instead of bad parsing

from units.

phlptp avatar phlptp commented on July 24, 2024

inchy my first thought was that this should read inch*year. Whether even that would be good is probably questionable.
What seems to be happening is that it interprets it as inch*chain*year which oddly dividing by the speed of light ends up producing the most compact unit string since chain isn't one of the standard output strings.

Probably some tweaking on the partitioning that should be done

from units.

phlptp avatar phlptp commented on July 24, 2024

fln_oz = foot-lambert newton ounce

I think I am going to disable the partitioning when there is an underscore, and be a little less permissive. That will come in the next PR.

from units.

phlptp avatar phlptp commented on July 24, 2024

After the recent updates several of the issues have been resolved

Input old Output new Output Comments
gramm 6.47989100000000217e-23g*m g if the non-english units are disabled would translate to gram * m
kilogramm 6.47989100000000188e-20g*m kg same as above
cars/hour/meter^2 1/h 1/h centi-ares/hr/meter^2 odd but correct
cm+cm cm^2 2cm the addition symbol for units that are convertible to eachother now operates
fps ft/s ft/s leaving as is, there is a future update coming which will better handle commodities but for now this is correct
Metres Unsupported unit. m fixed the missing variant
degrees C 0.0174532925199432955s*A*rad degC this was an overlooked variant
inchy 4830819306288062m^3/[c] not valid the parsing was getting overly aggressive on unit partitioning
fln_oz 9.7132811577355196e-08g*cd/m^2 not valid partitioning now takes the '_' in account better
kM kmol/L kmol/L kiloMolarity -this is correct

from units.

phlptp avatar phlptp commented on July 24, 2024

This was pretty interesting to work through.
There is now a defaultflag property that can be set and gets used if no flags are entered in the api call. A minimum partition size can be specified as part of those flags. This allows better control of the conversion process for programs using the conversion.

from units.

SimonHeybrock avatar SimonHeybrock commented on July 24, 2024

Thanks! Do you plan to make a release soon?

from units.

phlptp avatar phlptp commented on July 24, 2024

new release made

from units.

Related Issues (20)

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.