Skip to content

Commit

Permalink
Merge pull request #53 from shivam091/5.4.1
Browse files Browse the repository at this point in the history
5.4.1
  • Loading branch information
shivam091 authored Oct 28, 2023
2 parents 7efc587 + 17f039b commit 8ef95b2
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 39 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## [5.4.1](https://github.com/shivam091/unit_measurements/compare/v5.4.0...v5.4.1) - 2023-10-28

### What's updated

- Updated unit systems and aliases of unit groups.
- Added alternative names for unit groups in unit reference file.

----------

## [5.4.0](https://github.com/shivam091/unit_measurements/compare/v5.3.0...v5.4.0) - 2023-10-27

### What's new
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
unit_measurements (5.4.0)
unit_measurements (5.4.1)
activesupport (~> 7.0)

GEM
Expand Down
6 changes: 3 additions & 3 deletions lib/unit_measurements/unit_groups/acceleration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
primitive "m/s²"

system :metric do
si_unit "m/s²", aliases: ["m/s^2", "m·s⁻²", "meter per second squared", "meters per second squared", "metre per second squared", "metres per second squared"]
unit "m/s²", aliases: ["m/s^2", "m·s⁻²", "meter per second squared", "meters per second squared", "metre per second squared", "metres per second squared"]
end

system :imperial do
unit "in/s²", value: "0.0254 m/s²", aliases: ["in/s^2", "in·s⁻²", "inch per second squared", "inches per second squared"]
unit "in/s²", value: "0.0254 m/s²", aliases: ["in/s^2", "in·s⁻²", "ips²", "inch per second squared", "inches per second squared"]
end

system :foot_pound_second do
unit "ft/s²", value: "0.3048 m/s²", aliases: ["ft/s^2", "ft·s⁻²", "foot per second squared", "feet per second squared"]
unit "ft/s²", value: "0.3048 m/s²", aliases: ["ft/s^2", "ft·s⁻²", "fps²", "foot per second squared", "feet per second squared"]
end

system :meteorology_aviation_maritime do
Expand Down
7 changes: 3 additions & 4 deletions lib/unit_measurements/unit_groups/plane_angle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@
system :metric do
si_unit "rad", aliases: ["radian", "radians"]

unit "deg", value: [(Math::PI / 180), "rad"], aliases: ["°", "degree", "degrees"] # (π / 180) rad
unit "gon", value: [(Math::PI / 200), "rad"], aliases: ["ᵍ", "grad", "gradian", "gradians"] # (π / 200) rad
unit "arcmin", value: [Rational(1, 60), "deg"], aliases: ["′", "amin", "arcminute", "arcminutes"] # ((π / 180) / 60) rad
unit "arcsec", value: [Rational(1, 60), "arcmin"], aliases: ["″", "asec", "arcsecond", "arcseconds"] # ((π / 180) / 3600) rad
end

unit "deg", value: [(Math::PI / 180), "rad"], aliases: ["°", "degree", "degrees"] # (π / 180) rad
unit "cir", value: [360, "deg"], aliases: ["circle", "circles"] # (2 * π) rad
unit "mil", value: [Rational(1, 6400), "cir"], aliases: ["mils"] # ((2 * π) / 6400) rad
unit "rev", value: [1, "cir"], aliases: ["revolution", "revolutions"] # (2 * π) rad

unit "brad", value: [(Math::PI / 128), "rad"], aliases: ["b°", "bdeg", "binary degree", "binary radian", "binary degrees", "binary radians"] # (π / 128) rad

unit "arcmin", value: [Rational(1, 60), "deg"], aliases: ["′", "amin", "arcminute", "arcminutes"] # ((π / 180) / 60) rad
unit "arcsec", value: [Rational(1, 60), "arcmin"], aliases: ["″", "asec", "arcsecond", "arcseconds"] # ((π / 180) / 3600) rad
end
7 changes: 5 additions & 2 deletions lib/unit_measurements/unit_groups/pressure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@
end

system :metre_tonne_second do
unit "pz", value: "1 kPa", aliases: ["pièze"]
unit "pz", value: "1 kPa", aliases: ["pieze", "pièze"]
end

system :gravitational_metric do
unit "at", value: "98066.5 Pa", aliases: ["technical atmosphere", "technical atmospheres"]
end

unit "at", value: "98066.5 Pa", aliases: ["technical atmosphere", "technical atmospheres"]
unit "atm", value: "101325 Pa", aliases: ["atmosphere", "atmospheres"]
unit "Torr", value: [Rational(1, 760), "atm"], aliases: ["torr"]
end
4 changes: 2 additions & 2 deletions lib/unit_measurements/unit_groups/sound_level.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

system :metric do
si_unit "B", aliases: ["bel", "bels"]
end

unit "Np", value: [(20 / Math.log(10)), "dB"], aliases: ["neper", "nepers"] # (20 / ln(10)) dB
unit "Np", value: [(20 / Math.log(10)), "dB"], aliases: ["neper", "nepers"] # (20 / ln(10)) dB
end
end
4 changes: 2 additions & 2 deletions lib/unit_measurements/unit_groups/time.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
system :metric do
si_unit "s", aliases: ["sec", "second", "seconds"]

unit "h", value: "60 min", aliases: ["hr", "hour", "hours"]
unit "d", value: "24 h", aliases: ["day", "days"]
unit "min", value: "60 s", aliases: ["minute", "minutes"]
end

unit "h", value: "60 min", aliases: ["hr", "hour", "hours"]
unit "d", value: "24 h", aliases: ["day", "days"]
unit "wk", value: "7 d", aliases: ["week", "weeks"]
unit "mo", value: "30.4167 d", aliases: ["month", "months"]
unit "yr", value: "365 d", aliases: ["y", "year", "years"]
Expand Down
12 changes: 6 additions & 6 deletions lib/unit_measurements/unit_groups/velocity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
end

system :imperial do
unit "in/s", value: "0.0254 m/s", aliases: ["in·s⁻¹", "inch per second", "inches per second"]
unit "in/min", value: "1/60 in/s", aliases: ["in·min⁻¹", "inch per minute", "inches per minute"]
unit "in/h", value: "1/60 in/min", aliases: ["in·h⁻¹", "inch per hour", "inches per hour"]
unit "in/s", value: "0.0254 m/s", aliases: ["in·s⁻¹", "ips", "inch per second", "inches per second"]
unit "in/min", value: "1/60 in/s", aliases: ["in·min⁻¹", "ipm", "inch per minute", "inches per minute"]
unit "in/h", value: "1/60 in/min", aliases: ["in·h⁻¹", "iph", "inch per hour", "inches per hour"]
end

system :foot_pound_second do
unit "ft/s", value: "12 in/s", aliases: ["ft·s⁻¹", "foot per second", "feet per second"]
unit "ft/min", value: "1/60 ft/s", aliases: ["ft·min⁻¹", "foot per minute", "feet per minute"]
unit "ft/h", value: "1/60 ft/min", aliases: ["ft·h⁻¹", "foot per hour", "feet per hour"]
unit "ft/s", value: "12 in/s", aliases: ["ft·s⁻¹", "fps", "foot per second", "feet per second"]
unit "ft/min", value: "1/60 ft/s", aliases: ["ft·min⁻¹", "fpm", "foot per minute", "feet per minute"]
unit "ft/h", value: "1/60 ft/min", aliases: ["ft·h⁻¹", "fph", "foot per hour", "feet per hour"]
end

system :meteorology_aviation_maritime do
Expand Down
2 changes: 1 addition & 1 deletion lib/unit_measurements/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

module UnitMeasurements
# Current stable version.
VERSION = "5.4.0"
VERSION = "5.4.1"
end
36 changes: 18 additions & 18 deletions units.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ These units are defined in `UnitMeasurements::Weight`.
| 16 | drt | troy dram, troy drams |
| 17 | slug | slugs |

## 3. Time
## 3. Time or duration

These units are defined in `UnitMeasurements::Time`.

Expand Down Expand Up @@ -211,7 +211,7 @@ These units are defined in `UnitMeasurements::PlaneAngle`.
| 8 | arcmin | ′, amin, arcminute, arcminutes |
| 9 | arcsec | ″, asec, arcsecond, arcseconds |

## 14. Solid angle
## 14. Solid angle or 3D angle

These units are defined in `UnitMeasurements::SolidAngle`.

Expand All @@ -237,7 +237,7 @@ These units are defined in `UnitMeasurements::Force`.
| 6 | lbf | pound-force |
| 7 | pdl | poundal, poundals |

## 16. Velocity
## 16. Velocity or speed

These units are defined in `UnitMeasurements::Velocity`.

Expand All @@ -247,12 +247,12 @@ These units are defined in `UnitMeasurements::Velocity`.
| 2 | m/min | m·min⁻¹, meter per minute, meters per minute, metre per minute, metres per minute |
| 3 | m/h | m·h⁻¹, meter per hour, meters per hour, metre per hour, metres per hour |
| 4 | Kn | kt, knot, knots |
| 5 | in/s | in·s⁻¹, inch per second, inches per second |
| 6 | in/min | in·min⁻¹, inch per minute, inches per minute |
| 7 | in/h | in·h⁻¹, inch per hour, inches per hour |
| 8 | ft/s | ft·s⁻¹, foot per second, feet per second |
| 9 | ft/min | ft·min⁻¹, foot per minute, feet per minute |
| 10 | ft/h | ft·h⁻¹, foot per hour, feet per hour |
| 5 | in/s | in·s⁻¹, ips, inch per second, inches per second |
| 6 | in/min | in·min⁻¹, ipm, inch per minute, inches per minute |
| 7 | in/h | in·h⁻¹, iph, inch per hour, inches per hour |
| 8 | ft/s | ft·s⁻¹, fps, foot per second, feet per second |
| 9 | ft/min | ft·min⁻¹, fpm, foot per minute, feet per minute |
| 10 | ft/h | ft·h⁻¹, fps, foot per hour, feet per hour |

## 17. Acceleration

Expand All @@ -261,11 +261,11 @@ These units are defined in `UnitMeasurements::Acceleration`.
| # | Name | Aliases |
|:--|:--|:--|
| _1_ | _m/s²_ | _m/s^2, m·s⁻², meter per second squared, meters per second squared, metre per second squared, metres per second squared_ |
| 2 | in/s² | in/s^2, in·s⁻², inch per second squared, inches per second squared |
| 3 | ft/s² | ft/s^2, ft·s⁻², foot per second squared, feet per second squared |
| 2 | in/s² | in/s^2, in·s⁻², ips², inch per second squared, inches per second squared |
| 3 | ft/s² | ft/s^2, ft·s⁻², fps², foot per second squared, feet per second squared |
| 4 | Kn/s | knot per second, knots per second |

## 18. Angular velocity
## 18. Angular velocity or rotational speed

These units are defined in `UnitMeasurements::AngularVelocity`.

Expand Down Expand Up @@ -294,7 +294,7 @@ These units are defined in `UnitMeasurements::AngularAcceleration`.
| 2 | deg/s² | deg/s^2, °/s², deg·s⁻², degree per second squared, degrees per second squared |
| 3 | gon/s² | gon/s^2, ᵍ/s², gon·s⁻², gradian per second squared, gradians per second squared |

## 20. Electric potential
## 20. Electric potential or electromotive force

These units are defined in `UnitMeasurements::ElectricPotential`.

Expand Down Expand Up @@ -338,7 +338,7 @@ These units are defined in `UnitMeasurements::ElectricalElastance`.
| _1_ | _D*_ | _F⁻¹, daraf, darafs, reciprocal farad, reciprocal farads_ |
| 2 | V/C | V·C⁻¹, volt/coulomb, volts/coulomb, volt per coulomb, volts per coulomb |

## 24. Electrical resistance/Impedance
## 24. Electrical resistance or impedance

These units are defined in `UnitMeasurements::ElectricalResistance`.

Expand Down Expand Up @@ -429,7 +429,7 @@ These units are defined in `UnitMeasurements::ElectricQuadrupoleMoment`.
| 2 | statC·cm² | statC*m^2, statcoulomb square meter, statcoulomb square metre |
| 3 | B | buckingham, buckinghams |

## 33. Pressure
## 33. Pressure or mechanical stress

These units are defined in `UnitMeasurements::Pressure`.

Expand All @@ -438,12 +438,12 @@ These units are defined in `UnitMeasurements::Pressure`.
| _1_ | _Pa*_ | _pascal, pascals_ |
| 2 | bar | bars |
| 3 | Ba | barye, baryes |
| 4 | pz | pièze |
| 4 | pz | pieze, pièze |
| 5 | at | technical atmosphere, technical atmospheres |
| 6 | atm | atmosphere, atmospheres |
| 7 | Torr | torr |

## 34. Torque
## 34. Torque or moment of force

These units are defined in `UnitMeasurements::Torque`.

Expand Down Expand Up @@ -501,7 +501,7 @@ These units are defined in `UnitMeasurements::Frequency`.
| 3 | deg/s | °/s, deg·s⁻¹, degree per second, degrees per second |
| 4 | rev/s | rps, rev·s⁻¹, revolution per second, revolutions per second |

## 39. Power
## 39. Power or heat flow rate

These units are defined in `UnitMeasurements::Power`.

Expand Down

0 comments on commit 8ef95b2

Please sign in to comment.