Skip to content

Commit

Permalink
Julia 1.9 fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ma-laforge committed Jul 2, 2023
1 parent 47b27b9 commit e6b6d15
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "CMDimCircuits"
uuid = "393e8715-ea6a-4fca-bb1f-4c907b63b032"
version = "0.3.1"
version = "0.3.2"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
17 changes: 12 additions & 5 deletions src/CircuitAnalysis/base.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#CircuitAnalysis: Base tools
import MDDatasets: DataMD


#==Main data structures
Expand Down Expand Up @@ -41,10 +42,16 @@ const TCapacitance = DataTag{:C}
#==Helper functions
===============================================================================#
#multMD: disambiguate multiplication to use
multMD(a, b) = a*b #DataMD values don't require .*
multMD(a::AbstractArray, b::AbstractArray) = a .* b
divMD(a, b) = a/b #DataMD values don't require .*
divMD(a::AbstractArray, b::AbstractArray) = a ./ b
multMD(a, b) = a .* b
divMD(a, b) = a ./ b

#DataMD values don't work with .* (should this be changed?):
multMD(a::DataMD, b::DataMD) = a*b
multMD(a::DataMD, b) = a*b
multMD(a, b::DataMD) = a*b
divMD(a::DataMD, b::DataMD) = a/b
divMD(a::DataMD, b) = a/b
divMD(a, b::DataMD) = a/b


#==Operations
Expand Down Expand Up @@ -101,7 +108,7 @@ impedance(c::TCapacitance, args...; kwargs...) = impedance(admittance(c, args...
#TODO: create admittance(:L, value, f=x)??

#Inductor values:
_Z(l::TInductance, f) = admittance(multMD((2*pi*c.v)im, f))
_Z(l::TInductance, f) = impedance(multMD((2*pi*l.v)im, f))
_Z(l::TInductance, ::Nothing) = throw(ArgumentError("Missing kwarg :f"))
impedance(l::TInductance; f = nothing) = _Z(l, f)
admittance(l::TInductance, args...; kwargs...) = admittance(impedance(l, args...; kwargs...))
Expand Down
2 changes: 1 addition & 1 deletion src/NetwAnalysis/npconvert.jl
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ end

#==Reference impedance transformation/passthrough
===============================================================================#
z0xfrm(np::Network, z0::Float64) where TP =
z0xfrm(np::Network, z0::Float64) =
error("Unable to perform z0 transformation for $(typeof(np)).")
#S-parameter impedance transformation:
z0xfrm(np::SParameters, z0::Float64) =
Expand Down

2 comments on commit e6b6d15

@ma-laforge
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

Release notes:

Julia v1.9 fixes

@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/86705

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.3.2 -m "<description of version>" e6b6d151df0717cd46f0e82280409db43623abca
git push origin v0.3.2

Please sign in to comment.