Skip to content

Commit

Permalink
include precompilation
Browse files Browse the repository at this point in the history
  • Loading branch information
mcosovic committed Sep 3, 2024
1 parent 8385cf7 commit f6be635
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
SuiteSparse = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"

[compat]
HDF5 = "0.17"
Expand All @@ -21,7 +22,8 @@ LinearAlgebra = "<0.0.1, 1.8"
SparseArrays = "<0.0.1, 1.8"
SuiteSparse = "<0.0.1, 1.8"
Random = "<0.0.1, 1.8"
julia = "1.8"
PrecompileTools = "1"
julia = "1.9"

[extras]
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ We've rigorously tested and validated our simulation tool across various scenari
---

### Installation
JuliaGrid is compatible with Julia version 1.8 and newer. To get the JuliaGrid package installed, execute the following Julia command:
JuliaGrid is compatible with Julia version 1.9 and newer. To get the JuliaGrid package installed, execute the following Julia command:
```
import Pkg
Pkg.add("JuliaGrid")
Expand Down
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Below, we have provided a list of exhaustive examples in order to ease users in
---

#### Installation
JuliaGrid is compatible with Julia version 1.8 and newer. To get the JuliaGrid package installed, execute the following Julia command:
JuliaGrid is compatible with Julia version 1.9 and newer. To get the JuliaGrid package installed, execute the following Julia command:
```julia
import Pkg
Pkg.add("JuliaGrid")
Expand Down
3 changes: 3 additions & 0 deletions src/JuliaGrid.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,8 @@ export power!, current!
export injectionPower, supplyPower, shuntPower, fromPower, toPower, chargingPower, seriesPower, generatorPower
export injectionCurrent, fromCurrent, toCurrent, seriesCurrent

########## Precompile ##########
include("utility/precompile.jl")

end

18 changes: 18 additions & 0 deletions src/utility/precompile.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import PrecompileTools

PrecompileTools.@setup_workload begin
system = powerSystem()

addBus!(system; label = 1, type = 3, active = 0.1)
addBus!(system; label = 2, type = 1, reactive = 0.05)
addBranch!(system; from = 1, to = 2, reactance = 0.05)
addGenerator!(system; bus = 1, active = 0.5, reactive = 0.1)

PrecompileTools.@compile_workload begin
analysis = dcPowerFlow(system)
solve!(system, analysis)

analysis = newtonRaphson(system, QR)
solve!(system, analysis)
end
end

0 comments on commit f6be635

Please sign in to comment.