Comments (8)
I hope to make a new release with these changes within this coming week.
from units.
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-20gm | ?
| 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.
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.
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.
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.
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.
Thanks! Do you plan to make a release soon?
from units.
new release made
from units.
Related Issues (20)
- Conan package HOT 12
- Convert to inverse unit incorrect HOT 1
- Issues with parsing single-letter prefixes such as for `atto` HOT 7
- CleanUnitString breaks on 0.2 and 0.3 HOT 1
- Strange choice of units in to_string HOT 6
- Your units conversion service seems to be down... HOT 11
- "kg m" is parsed as "kg" HOT 1
- Surprising parse results with `.` and `-` HOT 4
- Question about to_string() function HOT 8
- Format arbitrary unit nicely HOT 4
- Degrees celsius get converted to Kelvin in operations HOT 6
- Function to remove a single user defined unit HOT 2
- Try to start a PR for adding support for KPa, MPa, GPa but permission denied HOT 3
- Using to_string for scalars causes crashes HOT 2
- Use of uninitialised memory in unit maps HOT 7
- Favoring SI base units in string formatting? HOT 3
- to_string strange output HOT 4
- expression did not evaluate to a constant HOT 4
- Unary negation of measurements HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from units.