Skip to content

Commit 0be66a1

Browse files
Zack Ligiordano
andcommitted
removed every mention of angstrom, fixes issue #14 (#15)
* removed every mention of angstrom as it is now redundant, fixes issue #14 * reverted changes to NEWS.md and tests, bumped compat version of Unitful to 0.18.0 * fixed test by including base Unitful * Unitful angstrom is implemented as a rational number type multiplied by the nanometer, so we should write tests with the rational number type * promotion to Float64 in angstrom test * Use uppor bounds in compat section * Use isapprox for angstrom test * Restore other test Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com>
1 parent 5598f83 commit 0be66a1

File tree

7 files changed

+7
-10
lines changed

7 files changed

+7
-10
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
88
UnitfulAngles = "6fb2a4bd-7999-5318-a3b2-8ad61056cd98"
99

1010
[compat]
11-
Unitful = "≥ 0.17.0"
12-
julia = "1.0.0"
11+
Unitful = "0.18.0"
12+
julia = "1.0.0"
1313

1414
[extras]
1515
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ The list of additional units is given below:
2525
* [Light year](https://en.wikipedia.org/wiki/Light-year)
2626
* [Parsec](https://en.wikipedia.org/wiki/Parsec)
2727
* [Jansky](https://en.wikipedia.org/wiki/Jansky)
28-
* [Angstrom](https://en.wikipedia.org/wiki/%C3%85ngstr%C3%B6m)
2928
* [Solar radius](https://en.wikipedia.org/wiki/Solar_radius)
3029
* [Solar irradiance](https://en.wikipedia.org/wiki/Solar_irradiance)
3130
* [Solar luminosity](https://en.wikipedia.org/wiki/Solar_luminosity)

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
environment:
22
matrix:
3-
- julia_version: 1
3+
- julia_version: 1.0
44
- julia_version: 1.1
55
- julia_version: 1.2
66
- julia_version: nightly

docs/generate-table-entries.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ table = (("Erg", :erg, :J),
1111
("Light year", :ly, :cm),
1212
("Parsec", :pc, :cm),
1313
("Jansky", :Jy, u"erg/s/cm^2/Hz"),
14-
("Angstrom", :angstrom, :nm),
1514
("Solar radius", :Rsun, :cm),
1615
("Solar irradiance", :Ssun, u"erg/s/cm^2"),
1716
("Solar luminosity", :Lsun, u"erg/s"),

docs/src/index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ The list of additional units is given below:
1818
| Light year | `UnitfulAstro.ly` | `9.4607304725808e17 cm` |
1919
| Parsec | `UnitfulAstro.pc` | `3.0856775814913674e18 cm` |
2020
| Jansky | `UnitfulAstro.Jy` | `1.0e-23 erg Hz^-1 cm^-2 s^-1` |
21-
| Angstrom | `UnitfulAstro.angstrom` | `0.1 nm` |
2221
| Solar radius | `UnitfulAstro.Rsun` | `6.957e10 cm` |
2322
| Solar irradiance | `UnitfulAstro.Ssun` | `1.361e6 erg cm^-2 s^-1` |
2423
| Solar luminosity | `UnitfulAstro.Lsun` | `3.828e33 erg s^-1` |

src/UnitfulAstro.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ import UnitfulAngles: arcminute, arcsecond
5252
# Note that IAU 2015 defines the small angle approximation as exact in the definition of the parsec.
5353
@unit Jy "Jy" Jansky 1e-23erg*s^-1*cm^-2*Hz^-1 true
5454
# Note that Jy uses a Float64 conversion factor because 10^23 overflows Int64.
55-
@unit angstrom "Å" Angstrom 1e-10*m false
5655

5756
# SOLAR CONVERSION CONSTANTS (IAU 2015)
5857
@unit Rsun "R⊙" SolarRadius 6.957e8*m false

test/runtests.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using Unitful
12
using UnitfulAstro
23
using Test
34

@@ -13,7 +14,7 @@ const u = UnitfulAstro
1314
@test 365.25*u.d == 1*u.yr
1415
@test 1*u.ly == 1*u.c*u.yr
1516
@test 1*u.pc == 1*u.AU/u.arcsecond
16-
@test 1*u.angstrom == 1e-10*u.m
17+
@test 1.0*Unitful.angstrom 1e-10*u.m
1718
@test 1*u.SFU 10000*u.Jy
1819
@test 1*u.TECU == 1e12*u.cm^-2
1920
end
@@ -69,8 +70,8 @@ const u = UnitfulAstro
6970
@test isapprox(flux * mag, 3.981071705534972u.erg/u.s)
7071
flux = 10u.erg/u.s/u.cm^2
7172
@test isapprox(flux * mag, 3.981071705534972u.erg/u.s/u.cm^2)
72-
flux = 10u.erg/u.s/u.cm^2/u.angstrom
73-
@test isapprox(flux * mag, 3.981071705534972u.erg/u.s/u.cm^2/u.angstrom)
73+
flux = 10u.erg/u.s/u.cm^2/Unitful.angstrom
74+
@test isapprox(flux * mag, 3.981071705534972u.erg/u.s/u.cm^2/Unitful.angstrom)
7475
end
7576
end
7677

0 commit comments

Comments
 (0)