Skip to content

Commit

Permalink
proper namespaces for @registermodel (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
longemen3000 committed Mar 31, 2023
1 parent f6f4858 commit 594d6e5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/utils/macros.jl
Original file line number Diff line number Diff line change
Expand Up @@ -388,29 +388,29 @@ macro registermodel(model)
_has_sites = hasfield(_model,:sites)
_has_groups = hasfield(_model,:groups)

_sites = _has_sites ? :(has_sites(::Type{<:$model}) = true) :
_groups = _has_groups ? :(has_groups(::Type{<:$model}) = true) :
_sites = _has_sites ? :(Clapeyron.has_sites(::Type{<:$model}) = true) :
_groups = _has_groups ? :(Clapeyron.has_groups(::Type{<:$model}) = true) :

_eos_show =
if _has_components
if _has_groups
quote
function Base.show(io::IO, mime::MIME"text/plain", model::$model)
return gc_eosshow(io, mime, model)
return Clapeyron.gc_eosshow(io, mime, model)
end

function Base.show(io::IO, model::$model)
return gc_eosshow(io, model)
return Clapeyron.gc_eosshow(io, model)
end
end
else
quote
function Base.show(io::IO, mime::MIME"text/plain", model::$model)
return eosshow(io, mime, model)
return Clapeyron.eosshow(io, mime, model)
end

function Base.show(io::IO, model::$model)
return eosshow(io, model)
return Clapeyron.eosshow(io, model)
end
end
end
Expand All @@ -431,9 +431,9 @@ macro registermodel(model)
_molecular_weight =
if _has_components
if _has_groups
:(molecular_weight(model::$model,z=SA[1.0]) =group_molecular_weight(model.groups,mw(model),z))
:(Clapeyron.molecular_weight(model::$model,z=SA[1.0]) =Clapeyron.group_molecular_weight(model.groups,Clapeyron.mw(model),z))
else
:(molecular_weight(model::$model,z=SA[1.0]) =comp_molecular_weight(mw(model),z))
:(Clapeyron.molecular_weight(model::$model,z=SA[1.0]) =Clapeyron.comp_molecular_weight(Clapeyron.mw(model),z))
end
else
Expand Down

0 comments on commit 594d6e5

Please sign in to comment.