Skip to content

Commit

Permalink
models base interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
andreapasquale94 committed Sep 16, 2023
1 parent f7f104a commit 31e5811
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/JSMDInterfaces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ include("Errors.jl")
include("Math.jl")
include("Ephemeris.jl")

include("Models.jl")

end
31 changes: 31 additions & 0 deletions src/Models.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module Models

using JSMDInterfaces.Errors

abstract type AbstractJSMDModelData end
abstract type AbstractJSMDModel end


function parse_data(::Type{T}, ::Type{D},
filename::AbstractString; kargs...) where {T, D<:AbstractJSMDModelData}
throw(
NotImplementedError(
"\`parse_data\` shall be implemented for $D model data with $T content!"
)
)
end

function parse_model(::Type{T}, ::Type{M}, ::Type{D},
args...) where {T, D<:AbstractJSMDModelData, M<:AbstractJSMDModel}
throw(
NotImplementedError(
"\`parse_data\` shall be implemented for $M model with $D data in $T content-type!"
)
)
end

function dump_model(::AbstractJSMDModel, node, args...) end

function load_model(::Type{T}, ::Type{<:AbstractJSMDModel}, node, args...) where T end

end

0 comments on commit 31e5811

Please sign in to comment.