-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use pkgextensions in Julia v1.9 (#143)
* start work on 1.9 extensions * move Juno into an extension * move messages to the top of the file, fix SpecialFunctions * Update src/Measurements.jl Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com> * Update ext/MeasurementsJunoExt.jl Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com> * Update src/show.jl Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com> * Update ext/MeasurementsJunoExt.jl Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com> * Update ext/MeasurementsSpecialFunctionsExt.jl Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com> * `@static` if !isdefined is required in the requires block * use `result` in MeasurementsSpecialFunctionsExt, remove an extra space * use value and uncertainty in MeasurementsUntifulExt.jl * move around the @static declaration in init, remove from unneeded places * Update src/Measurements.jl Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com> * reactivate Aqua tests * use 1 static ifdefined statement * use 1 static ifdefined statement * add RecipesBase as an extension * typo * try again to move all cond code into 1 @static ifdefined * remove unused files, move require block at the end * trailing end space * move RecipesBase out of the condition * typo in Project.toml * add RecipesBase to ignored stale deps * typo in Aqua kwarg * change order to the one Aqua.jl likes * change order of extensions (Aqua.jl) * typo in Aqua.test_stale_deps * add Requires to stale_deps * Make PlotRecipes work * use 1 if isdefined statement (take 3) * revert using 1 statement. julia 1.0 does not like that * Update test/runtests.jl Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com> * Update MeasurementsRecipesBaseExt.jl --------- Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com>
- Loading branch information
1 parent
f1d6e89
commit 0b54af0
Showing
8 changed files
with
118 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
### special-functions.jl | ||
# | ||
# Copyright (C) 2019 Mosè Giordano. | ||
# | ||
# Maintainer: Mosè Giordano <mose AT gnu DOT org> | ||
# Keywords: uncertainty, error propagation, physics | ||
# | ||
# This file is a part of Measurements.jl. | ||
# | ||
# License is MIT "Expat". | ||
# | ||
### Commentary: | ||
# | ||
# This file contains methods to print Measurement objects within a Juno enviroment | ||
# | ||
### Code: | ||
|
||
### Special functions | ||
module MeasurementsJunoExt | ||
|
||
if isdefined(Base, :get_extension) | ||
using Measurements | ||
using Juno | ||
else | ||
using ..Measurements | ||
using ..Juno | ||
end | ||
|
||
Juno.render(i::Juno.Inline, measure::Measurement) = | ||
Juno.render(i, Juno.Row(measure.val, Text(" ± "), measure.err)) | ||
|
||
Juno.Row(measure.val, Text(" ± "), measure.err) | ||
|
||
function Juno.render(ji::Juno.Inline, cm::Complex{<:Measurement}) | ||
r, i = reim(cm) | ||
if signbit(i) && !isnan(i) | ||
i = -i | ||
sss = " - " | ||
else | ||
sss = " + " | ||
end | ||
Juno.render(ji, Juno.Row("(", Juno.render(ji, r), ")", sss, | ||
"(", Juno.render(ji, i), ")im")) | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters