Skip to content

Commit

Permalink
fixed Measurements algebra bug
Browse files Browse the repository at this point in the history
  • Loading branch information
chakravala committed May 5, 2022
1 parent 19a24aa commit f038007
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MeasureSystems"
uuid = "ea45d09e-59d0-491b-a101-09823c6a9fd4"
authors = ["Michael Reed"]
version = "0.1.3"
version = "0.1.4"

[deps]
Similitude = "d70e672a-ff44-4dfc-8031-4cc812d84922"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ additional constants `molarmass`, `luminousefficacy`, `gravity`, `angle`, `turn`

Physics constant documentation is at https://geophysics.crucialflow.com/dev/constants

Standardized unit/derived quantities are `hyperfine`, `loschmidt`, `wienwavelength`, `wienfrequency`, `mechanicalheat`, `solarmass`, `jupitermass`, `earthmass`, `lunarmass`, `earthradius`, `greatcircle`, `radarmile`, `hubble`, `cosmological`, `radian`, `steradian`, `degree`, `gradian`, `arcminute`, `arcsecond`, `second`, `minute`, `hour`, `day`, `year`, `gaussianyear`, `siderealyear`, `angstrom`, `inch`, `foot`, `surveyfoot`, `yard`, `meter`, `earthmeter`, `mile`, `statutemile`, `meridianmile`, `admiraltymile`, `nauticalmile`, `lunardistance`, `astronomicalunit`, `lightyear`, `parsec`, `barn`, `hectare`, `acre`, `surveyacre`, `liter`, `gallon`, `quart`, `pint`, `cup`, `fluidounce`, `teaspoon`, `tablespoon`, `grain`, `gram`, `earthgram`, `kilogram`, `tonne`, `ton`, `pound`, `ounce`, `slug`, `slinch`, `hyl`, `dyne`, `newton`, `poundal`, `poundforce`, `kilopond`, `psi`, `pascal`, `bar`, `barye`, `technicalatmosphere`, `atmosphere`, `inchmercury`, `torr`, `electronvolt`, `erg`, `joule`, `footpound`, `calorie`, `kilocalorie`, `meancalorie`, `earthcalorie`, `thermalunit`, `gasgallon`, `tontnt`, `watt`, `horsepower`, `horsepowerwatt`, `horsepowermetric`, `electricalhorsepower`, `tonsrefrigeration`, `boilerhorsepower`, `coulomb`, `earthcoulomb`, `ampere`, `volt`, `henry`, `ohm`, `siemens`, `farad`, `weber`, `tesla`, `abcoulomb`, `abampere`, `abvolt`, `abhenry`, `abohm`, `abmho`, `abfarad`, `maxwell`, `gauss`, `oersted`, `gilbert`, `statcoulomb`, `statampere`, `statvolt`, `stathenry`, `statohm`, `statmho`, `statfarad`, `statweber`, `stattesla`, `kelvin`, `rankine`, `celsius`, `fahrenheit`, `sealevel`, `boiling`, `mole`, `earthmole`, `poundmole`, `slugmole`, `slinchmole`, `katal`, `amagat`, `lumen`, `candela`, `lux`, `phot`, `footcandle`, `nit`, `apostilb`, `stilb`, `lambert`, `footlambert`, `bril`, `neper`, `bel`, `decibel`, `hertz`, `rpm`, `kayser`, `diopter`, `bubnoff`, `gforce`, `galileo`, `eotvos`, `darcy`, `poise`, `reyn`, `stokes`, `rayl`, `mpge`, `langley`, `jansky`, `solarflux`, `curie`, `sievert`, `roentgen`, `rem`.
Standardized unit/derived quantities are `hyperfine`, `loschmidt`, `wienwavelength`, `wienfrequency`, `mechanicalheat`, `solarmass`, `jupitermass`, `earthmass`, `lunarmass`, `earthradius`, `greatcircle`, `radarmile`, `hubble`, `cosmological`, `radian`, `steradian`, `degree`, `gradian`, `arcminute`, `arcsecond`, `second`, `minute`, `hour`, `day`, `gaussianmonth`, `siderealmonth`, `synodicmonth`, `year`, `gaussianyear`, `siderealyear`, `jovianyear`, `angstrom`, `inch`, `foot`, `surveyfoot`, `yard`, `meter`, `earthmeter`, `mile`, `statutemile`, `meridianmile`, `admiraltymile`, `nauticalmile`, `lunardistance`, `astronomicalunit`, `jupiterdistance`, `lightyear`, `parsec`, `bubnoff`, `ips`, `fps`, `fpm`, `ms`, `kmh`, `mph`, `knot`, `mps`, `barn`, `hectare`, `acre`, `surveyacre`, `liter`, `gallon`, `quart`, `pint`, `cup`, `fluidounce`, `teaspoon`, `tablespoon`, `grain`, `gram`, `earthgram`, `kilogram`, `tonne`, `ton`, `pound`, `ounce`, `slug`, `slinch`, `hyl`, `dyne`, `newton`, `poundal`, `poundforce`, `kilopond`, `psi`, `pascal`, `bar`, `barye`, `technicalatmosphere`, `atmosphere`, `inchmercury`, `torr`, `electronvolt`, `erg`, `joule`, `footpound`, `calorie`, `kilocalorie`, `meancalorie`, `earthcalorie`, `thermalunit`, `gasgallon`, `tontnt`, `watt`, `horsepower`, `horsepowerwatt`, `horsepowermetric`, `electricalhorsepower`, `tonsrefrigeration`, `boilerhorsepower`, `coulomb`, `earthcoulomb`, `ampere`, `volt`, `henry`, `ohm`, `siemens`, `farad`, `weber`, `tesla`, `abcoulomb`, `abampere`, `abvolt`, `abhenry`, `abohm`, `abmho`, `abfarad`, `maxwell`, `gauss`, `oersted`, `gilbert`, `statcoulomb`, `statampere`, `statvolt`, `stathenry`, `statohm`, `statmho`, `statfarad`, `statweber`, `stattesla`, `kelvin`, `rankine`, `celsius`, `fahrenheit`, `sealevel`, `boiling`, `mole`, `earthmole`, `poundmole`, `slugmole`, `slinchmole`, `katal`, `amagat`, `lumen`, `candela`, `lux`, `phot`, `footcandle`, `nit`, `apostilb`, `stilb`, `lambert`, `footlambert`, `bril`, `neper`, `bel`, `decibel`, `hertz`, `apm`, `rpm`, `kayser`, `diopter`, `gforce`, `galileo`, `eotvos`, `darcy`, `poise`, `reyn`, `stokes`, `rayl`, `mpge`, `langley`, `jansky`, `solarflux`, `curie`, `sievert`, `roentgen`, `rem`.

Standard physics units are at https://geophysics.crucialflow.com/dev/units

Expand Down
6 changes: 3 additions & 3 deletions src/MeasureSystems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ Base.:*(a::Constant{D},b::Measurements.Measurement) where D = constant(D)*b
Base.:/(a::Measurements.Measurement,b::Constant{D}) where D = a*inv(b)
Base.:/(a::Constant{D},b::Measurements.Measurement) where D = a*inv(b)
Base.:+(a::Measurements.Measurement,b::Constant{D}) where D = a+constant(D)
Base.:+(a::Constant{D},b::Measurements.Measurement) where D = constant(D)-b
Base.:+(a::Constant{D},b::Measurements.Measurement) where D = constant(D)+b
Base.:-(a::Measurements.Measurement,b::Constant{D}) where D = a-constant(D)
Base.:-(a::Constant{D},b::Measurements.Measurement) where D = constant(D)-b
#=Base.:*(a::Measurements.Measurement,b::Similitude.Constant{D}) where D = a*Constant{D}()
Expand All @@ -166,7 +166,7 @@ Base.:*(a::UnitSystems.Constant{D},b::Measurements.Measurement) where D = D*b
Base.:/(a::Measurements.Measurement,b::UnitSystems.Constant{D}) where D = a*inv(b)
Base.:/(a::UnitSystems.Constant{D},b::Measurements.Measurement) where D = a*inv(b)
Base.:+(a::Measurements.Measurement,b::UnitSystems.Constant{D}) where D = a+D
Base.:+(a::UnitSystems.Constant{D},b::Measurements.Measurement) where D = D-b
Base.:+(a::UnitSystems.Constant{D},b::Measurements.Measurement) where D = D+b
Base.:-(a::Measurements.Measurement,b::UnitSystems.Constant{D}) where D = a-D
Base.:-(a::UnitSystems.Constant{D},b::Measurements.Measurement) where D = D-b
const mP = measurement("0.00000002176434(24)")
Expand All @@ -191,7 +191,7 @@ import UnitSystems: RK1990,KJ1990,𝟏,𝟐,𝟑,𝟓,𝟕,𝟏𝟎,𝟏𝟏,
const RK90,KJ90 = RK1990,KJ1990
end

const LD = Constant(UnitSystems.LD)
const LD,JD = Constant(384399)*𝟏𝟎^3,Constant(778479)*𝟏𝟎^6
const μE☾ = Constant(measurement("81.300568(3)"))

import UnitSystems: GaussSystem, ElectricSystem, EntropySystem, AstronomicalSystem, unitname, normal
Expand Down

2 comments on commit f038007

@chakravala
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/59703

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.4 -m "<description of version>" f03800711df91ebefddc03652db12c75f87122ce
git push origin v0.1.4

Please sign in to comment.