Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use SimpleUnPack.jl instead of UnPack.jl #2288

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
SimpleNonlinearSolve = "727e6d20-b764-4bd8-a329-72de5adea6c7"
SimpleUnPack = "ce78b400-467f-4804-87d8-8f486da07d0a"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
SymbolicIndexingInterface = "2efcf032-c050-4f8e-a9bb-153293bab1f5"
SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b"
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
URIs = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4"
UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"

[weakdeps]
Expand Down Expand Up @@ -88,13 +88,13 @@ RuntimeGeneratedFunctions = "0.5.9"
SciMLBase = "2.0.1"
Setfield = "0.7, 0.8, 1"
SimpleNonlinearSolve = "0.1.0"
SimpleUnPack = "1.1"
SpecialFunctions = "0.7, 0.8, 0.9, 0.10, 1.0, 2"
StaticArrays = "0.10, 0.11, 0.12, 1.0"
SymbolicIndexingInterface = "0.1, 0.2"
SymbolicUtils = "1.0"
Symbolics = "5.0"
URIs = "1"
UnPack = "0.1, 1.0"
Unitful = "1.1"
julia = "1.6"

Expand Down
2 changes: 1 addition & 1 deletion src/ModelingToolkit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ using PrecompileTools, Reexport

import Graphs: SimpleDiGraph, add_edge!, incidence_matrix

@reexport using UnPack
@reexport using SimpleUnPack
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm a bit surprised about this re-export, is this actually needed? Or could it be limited to

Suggested change
@reexport using SimpleUnPack
@reexport using SimpleUnPack: @unpack

?

end
RuntimeGeneratedFunctions.init(@__MODULE__)

Expand Down
2 changes: 1 addition & 1 deletion src/bipartite_graph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export 𝑠vertices, 𝑑vertices, has_𝑠vertex, has_𝑑vertex, 𝑠neighbors
delete_srcs!, delete_dsts!

using DocStringExtensions
using UnPack
using SimpleUnPack
using SparseArrays
using Graphs
using Setfield
Expand Down
2 changes: 1 addition & 1 deletion src/structural_transformation/StructuralTransformations.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module StructuralTransformations

using Setfield: @set!, @set
using UnPack: @unpack
using SimpleUnPack: @unpack

using Symbolics: unwrap, linear_expansion
using SymbolicUtils
Expand Down
4 changes: 0 additions & 4 deletions src/systems/abstractsystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1800,10 +1800,6 @@ function compose(syss...; name = nameof(first(syss)))
end
Base.:(∘)(sys1::AbstractSystem, sys2::AbstractSystem) = compose(sys1, sys2)

function UnPack.unpack(sys::ModelingToolkit.AbstractSystem, ::Val{p}) where {p}
getproperty(sys, p; namespace = false)
Copy link
Member

Choose a reason for hiding this comment

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

unpack changes the default. It doesn't just forwards.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, I missed the namespace keyword argument - I guess that's the problem here?

end

"""
missing_variable_defaults(sys::AbstractSystem, default = 0.0)

Expand Down
2 changes: 1 addition & 1 deletion src/systems/systemstructure.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import ..ModelingToolkit: isdiffeq, var_from_nested_derivative, vars!, flatten,
using ..BipartiteGraphs
import ..BipartiteGraphs: invview, complete
using Graphs
using UnPack
using SimpleUnPack
using Setfield
using SparseArrays

Expand Down
Loading