From 4019875b78a2b21f9897488c2c4a8ad1df93cf01 Mon Sep 17 00:00:00 2001 From: Andrea Pasquale Date: Wed, 25 Oct 2023 18:11:33 +0200 Subject: [PATCH 01/12] upgrade model interface --- Project.toml | 3 + src/Ephemeris.jl | 25 ++---- src/FilesIO.jl | 24 +++++- src/Interface.jl | 58 +++++++++++++ src/JSMDInterfaces.jl | 5 +- src/Math.jl | 5 +- src/Models.jl | 31 ------- src/Models/Models.jl | 12 +++ src/Models/abstract.jl | 66 +++++++++++++++ src/Models/acceleration.jl | 23 +++++ src/Models/frame.jl | 169 +++++++++++++++++++++++++++++++++++++ 11 files changed, 362 insertions(+), 59 deletions(-) create mode 100644 src/Interface.jl delete mode 100644 src/Models.jl create mode 100644 src/Models/Models.jl create mode 100644 src/Models/abstract.jl create mode 100644 src/Models/acceleration.jl create mode 100644 src/Models/frame.jl diff --git a/Project.toml b/Project.toml index 40dfb5a..1dfa6e9 100644 --- a/Project.toml +++ b/Project.toml @@ -3,6 +3,9 @@ uuid = "6b30ee2f-618e-4a15-bf4e-7df7b496e609" authors = ["JSMD Team"] version = "1.3.1" +[deps] +SMDGraphs = "b792745b-7241-45be-ba96-70eb67e8468f" + [compat] julia = "1" diff --git a/src/Ephemeris.jl b/src/Ephemeris.jl index d7a8f7f..e0cfb8f 100644 --- a/src/Ephemeris.jl +++ b/src/Ephemeris.jl @@ -3,6 +3,7 @@ module Ephemeris export AbstractEphemerisProvider, load, ephem_compute!, ephem_orient!, EphemerisError using JSMDInterfaces.Errors: @custom_error, AbstractGenericException +using JSMDInterfaces.Interface: @interface import JSMDInterfaces.FilesIO: load @custom_error struct EphemerisError <: AbstractGenericException @@ -61,7 +62,7 @@ end Load ephemeris files. """ -function load(provider::Type{<:AbstractEphemerisProvider}, files) +@interface function load(provider::Type{<:AbstractEphemerisProvider}, files) return provider(files) end @@ -74,13 +75,7 @@ for fun in ( :ephem_timescale, ) @eval begin - function ($fun)(eph::AbstractEphemerisProvider) - throw( - NotImplementedError( - "$($fun) shall be implemented for type $(typeof(eph))", - ), - ) - end + @interface function ($fun)(eph::AbstractEphemerisProvider) end export $fun end end @@ -101,14 +96,9 @@ respect to `center` at the Julian Date `jd0 + time`. - `order` -- The order of derivatives from 0 (position) to 3 (position, velocity, acceleration and jerk). """ -function ephem_compute!( +@interface function ephem_compute!( res, eph::AbstractEphemerisProvider, ::Number, ::Number, ::Int, ::Int, ::Int ) - throw( - NotImplementedError( - "`ephem_compute!` shall be implemented for type $(typeof(eph)).", - ), - ) end """ @@ -127,14 +117,9 @@ the `target` axes at epoch `jd0 + time`. - `order` -- The order of derivatives from 0 (angles) to 3 (angles, angles rate, etc...). """ -function ephem_orient!( +@interface function ephem_orient!( res, ::AbstractEphemerisProvider, ::Number, ::Number, ::Int, ::Int, ::Int ) - throw( - NotImplementedError( - "`ephem_orient!` shall be implemented for type $(typeof(eph)).", - ), - ) end end diff --git a/src/FilesIO.jl b/src/FilesIO.jl index 979466d..d88bf60 100644 --- a/src/FilesIO.jl +++ b/src/FilesIO.jl @@ -1,30 +1,35 @@ module FilesIO +using JSMDInterfaces.Interface: @interface +using SMDGraphs: AbstractGraphNode + export load, filepath, filepaths abstract type AbstractFile end +# Generic files + """ filepaths(files::AbstractFile) Return the path of all the files loaded within `file`. """ -function filepaths(::AbstractFile) end +@interface function filepaths(::AbstractFile) end """ filepath(files::AbstractFile, idx::Int=1) Return the path of the `idx`-th file within `files`. """ -function filepath(::AbstractFile, idx::Int=1) end +@interface function filepath(::AbstractFile, idx::Int=1) end """ load(files::T) where T <: AbstractFile Generic loader of different file/s formats. """ -function load(::AbstractFile) end -function load(::Type{T}, files::String...) where {T<:AbstractFile} end +@interface function load(::AbstractFile) end +@interface function load(::Type{T}, files::String...) where {T<:AbstractFile} end """ filetype(ftype, suptype) @@ -59,4 +64,15 @@ macro filetype(ftype, suptype) ) end +# JSMD interface + +abstract type AbstractArchiveNode <: AbstractGraphNode end + +""" + function load(::AbstractArchiveNode) + +Generic loader for JSMD archive nodes. +""" +@interface function load(::AbstractArchiveNode) end + end \ No newline at end of file diff --git a/src/Interface.jl b/src/Interface.jl new file mode 100644 index 0000000..4b545d8 --- /dev/null +++ b/src/Interface.jl @@ -0,0 +1,58 @@ +module Interface + +export @interface + +macro interface(expr) + + full_signature = expr.args[1] + fun_where = :() + if full_signature.head == :where + fun_signature = full_signature.args[1] + is_parametric = true + if fun_signature.head == :call + fun_name = fun_signature.args[1] + if length(fun_signature.args) < 2 + throw(ErrorException("Interface definition error! Function definition shall have at least one argument.")) + end + fun_args = fun_signature.args[2:end] + fun_where = full_signature.args[2:end] + else + throw(ErrorException("Interface definition error!")) + end + elseif full_signature.head == :call + fun_signature = full_signature + fun_name = fun_signature.args[1] + if length(fun_signature.args) < 2 + throw(ErrorException("Interface definition error! Function definition shall have at least one argument.")) + end + fun_args = fun_signature.args[2:end] + is_parametric = false + else + throw(ErrorException("Interface definition error! Shall be a valid function.")) + end + + if is_parametric + return esc(quote + function ($fun_name)($(fun_args...)) where {$(fun_where...)} + throw( + ErrorException( + "No method compatible with the current call implemented for the interface '$($fun_name)'!" + ) + ) + end + end) + else + return esc(quote + function ($fun_name)($(fun_args...)) + throw( + ErrorException( + "No compatible with the current call implemented for the interface '$($fun_name)'!" + ) + ) + end + end) + end + +end + +end \ No newline at end of file diff --git a/src/JSMDInterfaces.jl b/src/JSMDInterfaces.jl index eff88cb..13aa74e 100644 --- a/src/JSMDInterfaces.jl +++ b/src/JSMDInterfaces.jl @@ -1,11 +1,12 @@ module JSMDInterfaces -include("FilesIO.jl") +include("Interface.jl") include("Errors.jl") +include("FilesIO.jl") include("Math.jl") include("Ephemeris.jl") -include("Models.jl") +include("Models/Models.jl") end \ No newline at end of file diff --git a/src/Math.jl b/src/Math.jl index 8d366f9..51af967 100644 --- a/src/Math.jl +++ b/src/Math.jl @@ -1,5 +1,7 @@ module Math +using JSMDInterfaces.Interface: @interface + export interpolate """ @@ -14,7 +16,6 @@ abstract type AbstractInterpolationMethod end Abstract interpolator call method. """ -function interpolate(::AbstractInterpolationMethod, x) end - +@interface function interpolate(::AbstractInterpolationMethod, x) end end \ No newline at end of file diff --git a/src/Models.jl b/src/Models.jl deleted file mode 100644 index 1965132..0000000 --- a/src/Models.jl +++ /dev/null @@ -1,31 +0,0 @@ -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 \ No newline at end of file diff --git a/src/Models/Models.jl b/src/Models/Models.jl new file mode 100644 index 0000000..d12116a --- /dev/null +++ b/src/Models/Models.jl @@ -0,0 +1,12 @@ +module Models + +using JSMDInterfaces.Errors +using SMDGraphs: AbstractGraphNode +using JSMDInterfaces.Interface: @interface +using JSMDInterfaces.FilesIO: AbstractArchiveNode + +include("abstract.jl") +include("acceleration.jl") +include("frame.jl") + +end \ No newline at end of file diff --git a/src/Models/abstract.jl b/src/Models/abstract.jl new file mode 100644 index 0000000..72ded9c --- /dev/null +++ b/src/Models/abstract.jl @@ -0,0 +1,66 @@ +export AbstractJSMDModel, + AbstractJSMDModelData, + parse_data, parse_data, + dump_model, load_model + + +""" + AbstractJSMDModelData + +Basic abstract type for every JSMD compatible model data. + +JSMD _ModelData_ types are the interface of the JSMD environment +with the external world, and is meant to provide a model agnostic interface +any customly formatted file. + +The main objective of this data is actually to create a JSMD simulation +compatible _Model_, by means of the [`parse_model`](@ref) interface. +""" +abstract type AbstractJSMDModelData end + +""" + AbstractJSMDModel + +Basic abstract type for every JSMD compatible model. +""" +abstract type AbstractJSMDModel end + +""" + parse_data(::Type{T}, ::Type{D}, ::AbstractString; + kargs...) where {T, D<:AbstractJSMDModelData} end + +This function serves as an interface to create a JSMD compatible +model data object from a file. +""" +@interface function parse_data(::Type{T}, ::Type{D}, ::AbstractString; + kargs...) where {T, D<:AbstractJSMDModelData} end + +""" + parse_model(::Type{T}, ::Type{M}, ::Type{D}, args...; + kargs...) where {T, D<:AbstractJSMDModelData, M<:AbstractJSMDModel} + +This function serves as an interface to create a JSMD compatible +model types from a _ModelData_ type. +""" +@interface function parse_model(::Type{T}, ::Type{M}, ::Type{D}, args...; + kargs...) where {T, D<:AbstractJSMDModelData, M<:AbstractJSMDModel} end + +""" + dump_model(::AbstractJSMDModel, ::N, args...; + kargs...) where {N<:AbstractArchiveNode} + +This function serves as an interface to dump to an archive node +a JSMD compatible model. +""" +@interface function dump_model(::AbstractJSMDModel, ::N, args...; + kargs...) where {N<:AbstractArchiveNode} end + +""" + load_model(::Type{T}, ::Type{<:AbstractJSMDModel}, ::N, + args...; kargs...) where {T, N<:AbstractArchiveNode} + +This function serves as an interface to load from an archive node +a JSMD compatible model. +""" +@interface function load_model(::Type{T}, ::Type{<:AbstractJSMDModel}, ::N, + args...; kargs...) where {T, N<:AbstractArchiveNode} end \ No newline at end of file diff --git a/src/Models/acceleration.jl b/src/Models/acceleration.jl new file mode 100644 index 0000000..72d0623 --- /dev/null +++ b/src/Models/acceleration.jl @@ -0,0 +1,23 @@ +export AbstractAccelerationModel, AbstractAccelerationModelData, compute_acceleration + +""" + AbstractAccelerationModel + +Basic abstract type for acceleration models compatible with JSMD ecosystem. +""" +abstract type AbstractAccelerationModel <: AbstractJSMDModel end + +""" + AbstractAccelerationModel + +Basic abstract type for acceleration models data compatible with JSMD ecosystem. +""" +abstract type AbstractAccelerationModelData <: AbstractJSMDModelData end + +""" + compute_acceleration(::M, args...; kwargs...) where {M<:AbstractAccelerationModel} end + +This function serves as an interface to compute accelerations from JSMD compatible +acceleration models. +""" +@interface function compute_acceleration(::M, args...; kwargs...) where {M<:AbstractAccelerationModel} end \ No newline at end of file diff --git a/src/Models/frame.jl b/src/Models/frame.jl new file mode 100644 index 0000000..9427f16 --- /dev/null +++ b/src/Models/frame.jl @@ -0,0 +1,169 @@ +export AbstractFrameGraphModel, + AbstractFrameGraphAxisNode, AbstractFrameGraphPointNode, + vector3, vector6, vector9, vector12, + rotation3, rotation6, rotation9, rotation12 + +""" + AbstractFrameGraphModel + +Abstract type for frames graphs. +Subtype it to create a new frames graph compatible with the ecosystem. +""" +abstract type AbstractFrameGraphModel <: AbstractJSMDModel end + +""" + AbstractFrameGraphPointNode + +Abstract type for frame graphs points nodes. +Subtype it to create a point node type for a frame graph. +""" +abstract type AbstractFrameGraphPointNode <: AbstractGraphNode end + +""" + AbstractFrameGraphAxisNode + +Abstract type for frame graphs axes nodes. +Subtype it to create an axis node type for a frame graph. +""" +abstract type AbstractFrameGraphAxisNode <: AbstractGraphNode end + +# ---- +# Translation/rotation interface + +""" + vector3(model::F, from::Int, to::Int, axis::Int, time::T) where {T, F <: AbstractFrameGraphModel} + +This function serves as an interface for constructing a position vector using a frame graph model. + +### Arguments +- `model::F`: An instance of a subtype of `AbstractFrameGraphModel`, representing the frame graph model. +- `from::Int`: The source node or point for the vector. +- `to::Int`: The destination node or point for the vector. +- `axis::Int`: The specific axis of the vector. +- `time::T`: The independent variable (time), in seconds since J2000. + +!!! warning + Concrete implementations of `AbstractFrameGraphModel` must provide this function! +""" +@interface function vector3(::F, ::Int, ::Int, ::Int, ::T) where {T, F <: AbstractFrameGraphModel} end + +""" + vector6(model::F, from::Int, to::Int, axis::Int, time::T) where {T, F <: AbstractFrameGraphModel} + +This function serves as an interface for constructing a position and velocity vector using a frame graph model. + +### Arguments +- `model::F`: An instance of a subtype of `AbstractFrameGraphModel`, representing the frame graph model. +- `from::Int`: The source node or point for the vector. +- `to::Int`: The destination node or point for the vector. +- `axis::Int`: The specific axis of the vector. +- `time::T`: The independent variable (time), in seconds since J2000. + +!!! warning + Concrete implementations of `AbstractFrameGraphModel` must provide this function! +""" +@interface function vector6(::F, ::Int, ::Int, ::Int, ::T) where {T, F <: AbstractFrameGraphModel} end + +""" + vector9(model::F, from::Int, to::Int, axis::Int, time::T) where {T, F <: AbstractFrameGraphModel} + +This function serves as an interface for constructing a position, velocity, and acceleration vector +using a frame graph model. + +### Arguments +- `model::F`: An instance of a subtype of `AbstractFrameGraphModel`, representing the frame graph model. +- `from::Int`: The source node or point for the vector. +- `to::Int`: The destination node or point for the vector. +- `axis::Int`: The specific axis of the vector. +- `time::T`: The independent variable (time), in seconds since J2000. + +!!! warning + Concrete implementations of `AbstractFrameGraphModel` must provide this function! +""" +@interface function vector9(::F, ::Int, ::Int, ::Int, ::T) where {T, F <: AbstractFrameGraphModel} end + +""" + vector12(model::F, from::Int, to::Int, axis::Int, time::T) where {T, F <: AbstractFrameGraphModel} + +This function serves as an interface for constructing a position, velocity, acceleration, and jerk vector +using a frame graph model. + +### Arguments +- `model::F`: An instance of a subtype of `AbstractFrameGraphModel`, representing the frame graph model. +- `from::Int`: The source node or point for the vector. +- `to::Int`: The destination node or point for the vector. +- `axis::Int`: The specific axis of the vector. +- `time::T`: The independent variable (time), in seconds since J2000. + +!!! warning + Concrete implementations of `AbstractFrameGraphModel` must provide this function! +""" +@interface function vector12(::F, ::Int, ::Int, ::Int, ::T) where {T, F <: AbstractFrameGraphModel} end + +""" + rotation3(model::F, from::Int, to::Int, time::T) where {T, F <: AbstractFrameGraphModel} + +This function serves as an interface for constructing a rotation matrix between two axes within +a frame graph model. + +### Arguments +- `model::F`: An instance of a subtype of `AbstractFrameGraphModel`, representing the frame graph model. +- `from::Int`: The source node or axis for the rotation matrix. +- `to::Int`: The destination node or axis for the rotation matrix. +- `time::T`: The independent variable (time), in seconds since J2000. + +!!! warning + Concrete implementations of `AbstractFrameGraphModel` must provide this function! +""" +@interface function rotation3(::F, ::Int, ::Int, ::T) where {T, F <: AbstractFrameGraphModel} end + +""" + rotation6(model::F, from::Int, to::Int, time::T) where {T, F <: AbstractFrameGraphModel} + +This function serves as an interface for constructing a rotation matrix and its first derivative +between two axes within a frame graph model. + +### Arguments +- `model::F`: An instance of a subtype of `AbstractFrameGraphModel`, representing the frame graph model. +- `from::Int`: The source node or axis for the rotation matrix. +- `to::Int`: The destination node or axis for the rotation matrix. +- `time::T`: The independent variable (time), in seconds since J2000. + +!!! warning + Concrete implementations of `AbstractFrameGraphModel` must provide this function! +""" +@interface function rotation6(::F, ::Int, ::Int, ::T) where {T, F <: AbstractFrameGraphModel} end + +""" + rotation9(model::F, from::Int, to::Int, time::T) where {T, F <: AbstractFrameGraphModel} + +This function serves as an interface for constructing a rotation matrix, its first, second +derivative between two axes within a frame graph model. + +### Arguments +- `model::F`: An instance of a subtype of `AbstractFrameGraphModel`, representing the frame graph model. +- `from::Int`: The source node or axis for the rotation matrix. +- `to::Int`: The destination node or axis for the rotation matrix. +- `time::T`: The independent variable (time), in seconds since J2000. + +!!! warning + Concrete implementations of `AbstractFrameGraphModel` must provide this function! +""" +@interface function rotation9(::F, ::Int, ::Int, ::T) where {T, F <: AbstractFrameGraphModel} end + +""" + rotation12(model::F, from::Int, to::Int, time::T) where {T, F <: AbstractFrameGraphModel} + +This function serves as an interface for constructing a rotation matrix, its first, second and third +derivative between two axes within a frame graph model. + +### Arguments +- `model::F`: An instance of a subtype of `AbstractFrameGraphModel`, representing the frame graph model. +- `from::Int`: The source node or axis for the rotation matrix. +- `to::Int`: The destination node or axis for the rotation matrix. +- `time::T`: The independent variable (time), in seconds since J2000. + +!!! warning + Concrete implementations of `AbstractFrameGraphModel` must provide this function! +""" +@interface function rotation12(::F, ::Int, ::Int, ::T) where {T, F <: AbstractFrameGraphModel} end \ No newline at end of file From 0334eaeea54c069e4fff24eeafb71d26990463c8 Mon Sep 17 00:00:00 2001 From: Andrea Pasquale Date: Wed, 25 Oct 2023 18:43:15 +0200 Subject: [PATCH 02/12] updated interfaces and docs --- Project.toml | 1 + docs/make.jl | 20 ++++++++++++++++---- docs/src/index.md | 4 ++-- docs/src/interfaces.md | 21 --------------------- docs/src/interfaces/Ephemeris.md | 4 ++++ docs/src/interfaces/Errors.md | 4 ++++ docs/src/interfaces/FilesIO.md | 4 ++++ docs/src/interfaces/Interface.md | 4 ++++ docs/src/interfaces/Math.md | 4 ++++ docs/src/interfaces/Models.md | 4 ++++ src/Interface.jl | 15 +++++++++++++-- src/JSMDInterfaces.jl | 2 +- src/Models/frame.jl | 9 +++++---- 13 files changed, 62 insertions(+), 34 deletions(-) delete mode 100644 docs/src/interfaces.md create mode 100644 docs/src/interfaces/Ephemeris.md create mode 100644 docs/src/interfaces/Errors.md create mode 100644 docs/src/interfaces/FilesIO.md create mode 100644 docs/src/interfaces/Interface.md create mode 100644 docs/src/interfaces/Math.md create mode 100644 docs/src/interfaces/Models.md diff --git a/Project.toml b/Project.toml index 1dfa6e9..f093186 100644 --- a/Project.toml +++ b/Project.toml @@ -4,6 +4,7 @@ authors = ["JSMD Team"] version = "1.3.1" [deps] +Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6" SMDGraphs = "b792745b-7241-45be-ba96-70eb67e8468f" [compat] diff --git a/docs/make.jl b/docs/make.jl index 55254b6..2bba0b7 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,15 +1,27 @@ using JSMDInterfaces using Documenter +const CI = get(ENV, "CI", "false") == "true" + makedocs(; modules=[JSMDInterfaces], authors="Andrea Pasquale and Michele Ceresoli ", sitename="JSMDInterfaces.jl", + format=Documenter.HTML(; prettyurls=CI, highlights=["yaml"], ansicolor=true), pages=["Home" => "index.md", - "Interfaces" => "interfaces.md" + "Interfaces" => [ + "interfaces/Errors.md", + "interfaces/Interface.md", + "interfaces/FilesIO.md", + "interfaces/Math.md", + "interfaces/Ephemeris.md", + "interfaces/Models.md" + ] ], ) -deploydocs(; - repo="github.com/JuliaSpaceMissionDesign/JSMDInterfaces.jl", branch="gh-pages" -) \ No newline at end of file +if CI + deploydocs(; + repo="github.com/JuliaSpaceMissionDesign/JSMDInterfaces.jl", branch="gh-pages" + ) +end \ No newline at end of file diff --git a/docs/src/index.md b/docs/src/index.md index 53518cb..c35116b 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -1,7 +1,7 @@ # JSMDInterfaces.jl -_An interface package for the JSMD ecosystem_ +_An interface-only package for the JSMD ecosystem_ -SMDInterfacesUtils.jl handles all the interface definitions for the [JSMD](https://github.com/JuliaSpaceMissionDesign) ecosystem. It is a low-level and low dependency library made to be +JSMDInterfacesUtils.jl handles all the interface definitions for the [JSMD](https://github.com/JuliaSpaceMissionDesign) ecosystem. It is a low-level and low dependency library made to be depended on by the higher-level libraries to supply a common interface. diff --git a/docs/src/interfaces.md b/docs/src/interfaces.md deleted file mode 100644 index a0903c8..0000000 --- a/docs/src/interfaces.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Errors -```@autodocs -Modules = [JSMDInterfaces.Errors] -``` - -# Ephemeris -```@autodocs -Modules = [JSMDInterfaces.Ephemeris] -``` - -# Math -```@autodocs -Modules = [JSMDInterfaces.Math] - -``` - -# FilesIO -```@autodocs -Modules = [JSMDInterfaces.FilesIO] -``` \ No newline at end of file diff --git a/docs/src/interfaces/Ephemeris.md b/docs/src/interfaces/Ephemeris.md new file mode 100644 index 0000000..e30fe73 --- /dev/null +++ b/docs/src/interfaces/Ephemeris.md @@ -0,0 +1,4 @@ +# Ephemeris +```@autodocs +Modules = [JSMDInterfaces.Ephemeris] +``` \ No newline at end of file diff --git a/docs/src/interfaces/Errors.md b/docs/src/interfaces/Errors.md new file mode 100644 index 0000000..2db791c --- /dev/null +++ b/docs/src/interfaces/Errors.md @@ -0,0 +1,4 @@ +# Errors +```@autodocs +Modules = [JSMDInterfaces.Errors] +``` diff --git a/docs/src/interfaces/FilesIO.md b/docs/src/interfaces/FilesIO.md new file mode 100644 index 0000000..077e5d6 --- /dev/null +++ b/docs/src/interfaces/FilesIO.md @@ -0,0 +1,4 @@ +# FilesIO +```@autodocs +Modules = [JSMDInterfaces.FilesIO] +``` \ No newline at end of file diff --git a/docs/src/interfaces/Interface.md b/docs/src/interfaces/Interface.md new file mode 100644 index 0000000..9d7a44b --- /dev/null +++ b/docs/src/interfaces/Interface.md @@ -0,0 +1,4 @@ +# Interface +```@autodocs +Modules = [JSMDInterfaces.Interface] +``` diff --git a/docs/src/interfaces/Math.md b/docs/src/interfaces/Math.md new file mode 100644 index 0000000..1238062 --- /dev/null +++ b/docs/src/interfaces/Math.md @@ -0,0 +1,4 @@ +# Math +```@autodocs +Modules = [JSMDInterfaces.Math] +``` \ No newline at end of file diff --git a/docs/src/interfaces/Models.md b/docs/src/interfaces/Models.md new file mode 100644 index 0000000..78b150f --- /dev/null +++ b/docs/src/interfaces/Models.md @@ -0,0 +1,4 @@ +# Models +```@autodocs +Modules = [JSMDInterfaces.Models] +``` \ No newline at end of file diff --git a/src/Interface.jl b/src/Interface.jl index 4b545d8..6f948b8 100644 --- a/src/Interface.jl +++ b/src/Interface.jl @@ -1,7 +1,18 @@ module Interface +using JSMDInterfaces.Errors: NotImplementedError + export @interface +""" + @interface + +This macro can be used to create a in interface function within the +JSMD ecosystem. + +Interface functions are intended as function with some abstract +types as inputs throwing a not implemented error as default behaviour. +""" macro interface(expr) full_signature = expr.args[1] @@ -35,7 +46,7 @@ macro interface(expr) return esc(quote function ($fun_name)($(fun_args...)) where {$(fun_where...)} throw( - ErrorException( + NotImplementedError( "No method compatible with the current call implemented for the interface '$($fun_name)'!" ) ) @@ -45,7 +56,7 @@ macro interface(expr) return esc(quote function ($fun_name)($(fun_args...)) throw( - ErrorException( + NotImplementedError( "No compatible with the current call implemented for the interface '$($fun_name)'!" ) ) diff --git a/src/JSMDInterfaces.jl b/src/JSMDInterfaces.jl index 13aa74e..c0401ab 100644 --- a/src/JSMDInterfaces.jl +++ b/src/JSMDInterfaces.jl @@ -1,7 +1,7 @@ module JSMDInterfaces -include("Interface.jl") include("Errors.jl") +include("Interface.jl") include("FilesIO.jl") include("Math.jl") diff --git a/src/Models/frame.jl b/src/Models/frame.jl index 9427f16..14c1afe 100644 --- a/src/Models/frame.jl +++ b/src/Models/frame.jl @@ -1,15 +1,16 @@ -export AbstractFrameGraphModel, - AbstractFrameGraphAxisNode, AbstractFrameGraphPointNode, +export AbstractFrameGraphModel, AbstractFrameGraphAxisNode, AbstractFrameGraphPointNode, vector3, vector6, vector9, vector12, rotation3, rotation6, rotation9, rotation12 +using Graphs: AbstractGraph + """ AbstractFrameGraphModel Abstract type for frames graphs. Subtype it to create a new frames graph compatible with the ecosystem. """ -abstract type AbstractFrameGraphModel <: AbstractJSMDModel end +abstract type AbstractFrameGraphModel{T} <: AbstractGraph{T} end """ AbstractFrameGraphPointNode @@ -28,7 +29,7 @@ Subtype it to create an axis node type for a frame graph. abstract type AbstractFrameGraphAxisNode <: AbstractGraphNode end # ---- -# Translation/rotation interface +# JSMD interface """ vector3(model::F, from::Int, to::Int, axis::Int, time::T) where {T, F <: AbstractFrameGraphModel} From b383f50423c1b21b45133f982fc259bb1e48b221 Mon Sep 17 00:00:00 2001 From: MicheleCeresoli Date: Thu, 26 Oct 2023 21:55:08 +0200 Subject: [PATCH 03/12] Minor style and typo fixes --- src/Interface.jl | 61 +++++++++++++++++++++++++++----------- src/Models/abstract.jl | 35 ++++++++++------------ src/Models/acceleration.jl | 5 ++-- 3 files changed, 62 insertions(+), 39 deletions(-) diff --git a/src/Interface.jl b/src/Interface.jl index 6f948b8..a26d19b 100644 --- a/src/Interface.jl +++ b/src/Interface.jl @@ -10,58 +10,83 @@ export @interface This macro can be used to create a in interface function within the JSMD ecosystem. -Interface functions are intended as function with some abstract -types as inputs throwing a not implemented error as default behaviour. +Interface functions are intended as functions with some abstract +types as inputs throwing a [`NotImplementedError`](@ref) as default behaviour. """ macro interface(expr) full_signature = expr.args[1] fun_where = :() + if full_signature.head == :where fun_signature = full_signature.args[1] is_parametric = true + if fun_signature.head == :call fun_name = fun_signature.args[1] + if length(fun_signature.args) < 2 - throw(ErrorException("Interface definition error! Function definition shall have at least one argument.")) + throw( + ErrorException( + "Interface definition error! Function definition shall have"* + " at least one argument." + ) + ) end + fun_args = fun_signature.args[2:end] fun_where = full_signature.args[2:end] + else throw(ErrorException("Interface definition error!")) end + elseif full_signature.head == :call fun_signature = full_signature fun_name = fun_signature.args[1] + if length(fun_signature.args) < 2 - throw(ErrorException("Interface definition error! Function definition shall have at least one argument.")) + throw( + ErrorException( + "Interface definition error! Function definition shall have"* + " at least one argument." + ) + ) end + fun_args = fun_signature.args[2:end] is_parametric = false + else throw(ErrorException("Interface definition error! Shall be a valid function.")) end if is_parametric - return esc(quote - function ($fun_name)($(fun_args...)) where {$(fun_where...)} - throw( - NotImplementedError( - "No method compatible with the current call implemented for the interface '$($fun_name)'!" + return esc( + quote + function ($fun_name)($(fun_args...)) where {$(fun_where...)} + throw( + NotImplementedError( + "No method compatible with the current call has been"* + " implemented for the interface '$($fun_name)'!" + ) ) - ) + end end - end) + ) else - return esc(quote - function ($fun_name)($(fun_args...)) - throw( - NotImplementedError( - "No compatible with the current call implemented for the interface '$($fun_name)'!" + return esc( + quote + function ($fun_name)($(fun_args...)) + throw( + NotImplementedError( + "No method compatible with the current call has been"* + " implemented for the interface '$($fun_name)'!" + ) ) - ) + end end - end) + ) end end diff --git a/src/Models/abstract.jl b/src/Models/abstract.jl index 72ded9c..442e715 100644 --- a/src/Models/abstract.jl +++ b/src/Models/abstract.jl @@ -9,12 +9,11 @@ export AbstractJSMDModel, Basic abstract type for every JSMD compatible model data. -JSMD _ModelData_ types are the interface of the JSMD environment -with the external world, and is meant to provide a model agnostic interface -any customly formatted file. +JSMD _ModelData_ types are the interface of the JSMD environment with the external world, +and are meant to provide a model agnostic interface to any customly formatted file. -The main objective of this data is actually to create a JSMD simulation -compatible _Model_, by means of the [`parse_model`](@ref) interface. +The main objective of this data type is to create a JSMD simulation compatible _Model_ +by means of the [`parse_model`](@ref) interface. """ abstract type AbstractJSMDModelData end @@ -27,40 +26,38 @@ abstract type AbstractJSMDModel end """ parse_data(::Type{T}, ::Type{D}, ::AbstractString; - kargs...) where {T, D<:AbstractJSMDModelData} end + kargs...) where {T, D <: AbstractJSMDModelData} end This function serves as an interface to create a JSMD compatible model data object from a file. """ @interface function parse_data(::Type{T}, ::Type{D}, ::AbstractString; - kargs...) where {T, D<:AbstractJSMDModelData} end + kargs...) where {T, D <: AbstractJSMDModelData} end """ parse_model(::Type{T}, ::Type{M}, ::Type{D}, args...; - kargs...) where {T, D<:AbstractJSMDModelData, M<:AbstractJSMDModel} + kargs...) where {T, D <: AbstractJSMDModelData, M <: AbstractJSMDModel} This function serves as an interface to create a JSMD compatible -model types from a _ModelData_ type. +model type from a _ModelData_ type. """ @interface function parse_model(::Type{T}, ::Type{M}, ::Type{D}, args...; - kargs...) where {T, D<:AbstractJSMDModelData, M<:AbstractJSMDModel} end + kargs...) where {T, D <: AbstractJSMDModelData, M <: AbstractJSMDModel} end """ dump_model(::AbstractJSMDModel, ::N, args...; - kargs...) where {N<:AbstractArchiveNode} + kargs...) where {N <: AbstractArchiveNode} -This function serves as an interface to dump to an archive node -a JSMD compatible model. +This function serves as an interface to dump to an archive node a JSMD compatible model. """ @interface function dump_model(::AbstractJSMDModel, ::N, args...; - kargs...) where {N<:AbstractArchiveNode} end + kargs...) where {N <: AbstractArchiveNode} end """ - load_model(::Type{T}, ::Type{<:AbstractJSMDModel}, ::N, - args...; kargs...) where {T, N<:AbstractArchiveNode} + load_model(::Type{T}, ::Type{ <: AbstractJSMDModel}, ::N, + args...; kargs...) where {T, N <: AbstractArchiveNode} -This function serves as an interface to load from an archive node -a JSMD compatible model. +This function serves as an interface to load from an archive node a JSMD compatible model. """ @interface function load_model(::Type{T}, ::Type{<:AbstractJSMDModel}, ::N, - args...; kargs...) where {T, N<:AbstractArchiveNode} end \ No newline at end of file + args...; kargs...) where {T, N <: AbstractArchiveNode} end \ No newline at end of file diff --git a/src/Models/acceleration.jl b/src/Models/acceleration.jl index 72d0623..4fe0019 100644 --- a/src/Models/acceleration.jl +++ b/src/Models/acceleration.jl @@ -15,9 +15,10 @@ Basic abstract type for acceleration models data compatible with JSMD ecosystem. abstract type AbstractAccelerationModelData <: AbstractJSMDModelData end """ - compute_acceleration(::M, args...; kwargs...) where {M<:AbstractAccelerationModel} end + compute_acceleration(::M, args...; kwargs...) where {M <: AbstractAccelerationModel} end This function serves as an interface to compute accelerations from JSMD compatible acceleration models. """ -@interface function compute_acceleration(::M, args...; kwargs...) where {M<:AbstractAccelerationModel} end \ No newline at end of file +@interface function compute_acceleration(::M, args...; + kwargs...) where {M <: AbstractAccelerationModel} end \ No newline at end of file From 1797e3f7a16c7356be86edba63758edcb2cac3fc Mon Sep 17 00:00:00 2001 From: Andrea Pasquale Date: Sat, 11 Nov 2023 18:12:48 +0100 Subject: [PATCH 04/12] added frames & graphs interfaces --- Project.toml | 3 +-- src/Errors.jl | 2 +- src/FilesIO.jl | 4 +-- src/{Models/frame.jl => Frames.jl} | 31 ++++++++-------------- src/Graph.jl | 41 ++++++++++++++++++++++++++++++ src/JSMDInterfaces.jl | 2 ++ src/Models/Models.jl | 2 -- 7 files changed, 57 insertions(+), 28 deletions(-) rename src/{Models/frame.jl => Frames.jl} (90%) create mode 100644 src/Graph.jl diff --git a/Project.toml b/Project.toml index f093186..389de16 100644 --- a/Project.toml +++ b/Project.toml @@ -1,11 +1,10 @@ name = "JSMDInterfaces" uuid = "6b30ee2f-618e-4a15-bf4e-7df7b496e609" authors = ["JSMD Team"] -version = "1.3.1" +version = "1.4.0" [deps] Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6" -SMDGraphs = "b792745b-7241-45be-ba96-70eb67e8468f" [compat] julia = "1" diff --git a/src/Errors.jl b/src/Errors.jl index a7bab8e..f2e42fe 100644 --- a/src/Errors.jl +++ b/src/Errors.jl @@ -26,7 +26,7 @@ macro custom_error(expr) return esc( quote """ - $($(name)) + $($(ename)) A type representing $($(descr)). """ diff --git a/src/FilesIO.jl b/src/FilesIO.jl index d88bf60..00503c9 100644 --- a/src/FilesIO.jl +++ b/src/FilesIO.jl @@ -1,7 +1,7 @@ module FilesIO using JSMDInterfaces.Interface: @interface -using SMDGraphs: AbstractGraphNode +using JSMDInterfaces.Graph: AbstractJSMDGraphNode export load, filepath, filepaths @@ -66,7 +66,7 @@ end # JSMD interface -abstract type AbstractArchiveNode <: AbstractGraphNode end +abstract type AbstractArchiveNode <: AbstractJSMDGraphNode end """ function load(::AbstractArchiveNode) diff --git a/src/Models/frame.jl b/src/Frames.jl similarity index 90% rename from src/Models/frame.jl rename to src/Frames.jl index 14c1afe..779d92f 100644 --- a/src/Models/frame.jl +++ b/src/Frames.jl @@ -1,8 +1,11 @@ -export AbstractFrameGraphModel, AbstractFrameGraphAxisNode, AbstractFrameGraphPointNode, - vector3, vector6, vector9, vector12, - rotation3, rotation6, rotation9, rotation12 +module Frames using Graphs: AbstractGraph +using JSMDInterfaces.Interface: @interface + +export AbstractFrameGraphModel, + vector3, vector6, vector9, vector12, + rotation3, rotation6, rotation9, rotation12 """ AbstractFrameGraphModel @@ -12,22 +15,6 @@ Subtype it to create a new frames graph compatible with the ecosystem. """ abstract type AbstractFrameGraphModel{T} <: AbstractGraph{T} end -""" - AbstractFrameGraphPointNode - -Abstract type for frame graphs points nodes. -Subtype it to create a point node type for a frame graph. -""" -abstract type AbstractFrameGraphPointNode <: AbstractGraphNode end - -""" - AbstractFrameGraphAxisNode - -Abstract type for frame graphs axes nodes. -Subtype it to create an axis node type for a frame graph. -""" -abstract type AbstractFrameGraphAxisNode <: AbstractGraphNode end - # ---- # JSMD interface @@ -46,7 +33,7 @@ This function serves as an interface for constructing a position vector using a !!! warning Concrete implementations of `AbstractFrameGraphModel` must provide this function! """ -@interface function vector3(::F, ::Int, ::Int, ::Int, ::T) where {T, F <: AbstractFrameGraphModel} end +@interface function vector3(::AbstractFrameGraphModel, ::Int, ::Int, ::Int, ::Number) end """ vector6(model::F, from::Int, to::Int, axis::Int, time::T) where {T, F <: AbstractFrameGraphModel} @@ -167,4 +154,6 @@ derivative between two axes within a frame graph model. !!! warning Concrete implementations of `AbstractFrameGraphModel` must provide this function! """ -@interface function rotation12(::F, ::Int, ::Int, ::T) where {T, F <: AbstractFrameGraphModel} end \ No newline at end of file +@interface function rotation12(::F, ::Int, ::Int, ::T) where {T, F <: AbstractFrameGraphModel} end + +end \ No newline at end of file diff --git a/src/Graph.jl b/src/Graph.jl new file mode 100644 index 0000000..e1ae6b4 --- /dev/null +++ b/src/Graph.jl @@ -0,0 +1,41 @@ +module Graph + +using JSMDInterfaces.Interface: @interface + +using Graphs + +import Graphs: has_vertex, has_edge, edges, edgetype, inneighbors, ne, nv, outneighbors, vertices, is_directed + +abstract type AbstractJSMDGraph{T} <: AbstractGraph{T} end + +abstract type AbstractJSMDGraphNode end + +# Graphs interface + +@interface function Graphs.has_vertex(::AbstractJSMDGraph, ::Int) end + +@interface function Graphs.has_edge(::AbstractJSMDGraph, ::Int, ::Int) end + +@interface function Graphs.edges(::AbstractJSMDGraph) end + +@interface function Graphs.edgetype(::AbstractJSMDGraph) end + +@interface function Graphs.inneighbors(::AbstractJSMDGraph, ::Int) end + +@interface function Graphs.ne(::AbstractJSMDGraph) end + +@interface function Graphs.nv(::AbstractJSMDGraph) end + +@interface function Graphs.outneighbors(::AbstractJSMDGraph, ::Int) end + +@interface function Graphs.vertices(::AbstractJSMDGraph) end + +@interface function Graphs.is_directed(::AbstractJSMDGraph) end + +# JSMD interface + +@interface function add_vertex!(::AbstractJSMDGraph, ::N) where {N<:AbstractJSMDGraph} end + +@interface function add_edge!(::AbstractJSMDGraph, ::Int, ::Int, ::Int) end + +end \ No newline at end of file diff --git a/src/JSMDInterfaces.jl b/src/JSMDInterfaces.jl index c0401ab..7452523 100644 --- a/src/JSMDInterfaces.jl +++ b/src/JSMDInterfaces.jl @@ -2,8 +2,10 @@ module JSMDInterfaces include("Errors.jl") include("Interface.jl") +include("Graph.jl") include("FilesIO.jl") +include("Frames.jl") include("Math.jl") include("Ephemeris.jl") diff --git a/src/Models/Models.jl b/src/Models/Models.jl index d12116a..c26b2e6 100644 --- a/src/Models/Models.jl +++ b/src/Models/Models.jl @@ -1,12 +1,10 @@ module Models using JSMDInterfaces.Errors -using SMDGraphs: AbstractGraphNode using JSMDInterfaces.Interface: @interface using JSMDInterfaces.FilesIO: AbstractArchiveNode include("abstract.jl") include("acceleration.jl") -include("frame.jl") end \ No newline at end of file From f00b5a69526b08579c80ff3b8c77c4efc92a3d25 Mon Sep 17 00:00:00 2001 From: Andrea Pasquale Date: Sat, 11 Nov 2023 18:16:06 +0100 Subject: [PATCH 05/12] removed parametric types from vectorX and rotationX --- src/Frames.jl | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Frames.jl b/src/Frames.jl index 779d92f..cc1a34c 100644 --- a/src/Frames.jl +++ b/src/Frames.jl @@ -19,7 +19,7 @@ abstract type AbstractFrameGraphModel{T} <: AbstractGraph{T} end # JSMD interface """ - vector3(model::F, from::Int, to::Int, axis::Int, time::T) where {T, F <: AbstractFrameGraphModel} + vector3(model::F, from::Int, to::Int, axis::Int, time::Number) This function serves as an interface for constructing a position vector using a frame graph model. @@ -36,7 +36,7 @@ This function serves as an interface for constructing a position vector using a @interface function vector3(::AbstractFrameGraphModel, ::Int, ::Int, ::Int, ::Number) end """ - vector6(model::F, from::Int, to::Int, axis::Int, time::T) where {T, F <: AbstractFrameGraphModel} + vector6(model::F, from::Int, to::Int, axis::Int, time::Number) This function serves as an interface for constructing a position and velocity vector using a frame graph model. @@ -50,10 +50,10 @@ This function serves as an interface for constructing a position and velocity ve !!! warning Concrete implementations of `AbstractFrameGraphModel` must provide this function! """ -@interface function vector6(::F, ::Int, ::Int, ::Int, ::T) where {T, F <: AbstractFrameGraphModel} end +@interface function vector6(::AbstractFrameGraphModel, ::Int, ::Int, ::Int, ::Number) end """ - vector9(model::F, from::Int, to::Int, axis::Int, time::T) where {T, F <: AbstractFrameGraphModel} + vector9(model::F, from::Int, to::Int, axis::Int, time::Number) This function serves as an interface for constructing a position, velocity, and acceleration vector using a frame graph model. @@ -68,10 +68,10 @@ using a frame graph model. !!! warning Concrete implementations of `AbstractFrameGraphModel` must provide this function! """ -@interface function vector9(::F, ::Int, ::Int, ::Int, ::T) where {T, F <: AbstractFrameGraphModel} end +@interface function vector9(::AbstractFrameGraphModel, ::Int, ::Int, ::Int, ::Number) end """ - vector12(model::F, from::Int, to::Int, axis::Int, time::T) where {T, F <: AbstractFrameGraphModel} + vector12(model::F, from::Int, to::Int, axis::Int, time::Number) This function serves as an interface for constructing a position, velocity, acceleration, and jerk vector using a frame graph model. @@ -86,10 +86,10 @@ using a frame graph model. !!! warning Concrete implementations of `AbstractFrameGraphModel` must provide this function! """ -@interface function vector12(::F, ::Int, ::Int, ::Int, ::T) where {T, F <: AbstractFrameGraphModel} end +@interface function vector12(::AbstractFrameGraphModel, ::Int, ::Int, ::Int, ::Number) end """ - rotation3(model::F, from::Int, to::Int, time::T) where {T, F <: AbstractFrameGraphModel} + rotation3(model::F, from::Int, to::Int, time::Number) This function serves as an interface for constructing a rotation matrix between two axes within a frame graph model. @@ -103,10 +103,10 @@ a frame graph model. !!! warning Concrete implementations of `AbstractFrameGraphModel` must provide this function! """ -@interface function rotation3(::F, ::Int, ::Int, ::T) where {T, F <: AbstractFrameGraphModel} end +@interface function rotation3(::AbstractFrameGraphModel, ::Int, ::Int, ::Number) end """ - rotation6(model::F, from::Int, to::Int, time::T) where {T, F <: AbstractFrameGraphModel} + rotation6(model::F, from::Int, to::Int, time::Number) This function serves as an interface for constructing a rotation matrix and its first derivative between two axes within a frame graph model. @@ -120,10 +120,10 @@ between two axes within a frame graph model. !!! warning Concrete implementations of `AbstractFrameGraphModel` must provide this function! """ -@interface function rotation6(::F, ::Int, ::Int, ::T) where {T, F <: AbstractFrameGraphModel} end +@interface function rotation6(::AbstractFrameGraphModel, ::Int, ::Int, ::Number) end """ - rotation9(model::F, from::Int, to::Int, time::T) where {T, F <: AbstractFrameGraphModel} + rotation9(model::F, from::Int, to::Int, time::Number) This function serves as an interface for constructing a rotation matrix, its first, second derivative between two axes within a frame graph model. @@ -137,10 +137,10 @@ derivative between two axes within a frame graph model. !!! warning Concrete implementations of `AbstractFrameGraphModel` must provide this function! """ -@interface function rotation9(::F, ::Int, ::Int, ::T) where {T, F <: AbstractFrameGraphModel} end +@interface function rotation9(::AbstractFrameGraphModel, ::Int, ::Int, ::Number) end """ - rotation12(model::F, from::Int, to::Int, time::T) where {T, F <: AbstractFrameGraphModel} + rotation12(model::F, from::Int, to::Int, time::Number) This function serves as an interface for constructing a rotation matrix, its first, second and third derivative between two axes within a frame graph model. @@ -154,6 +154,6 @@ derivative between two axes within a frame graph model. !!! warning Concrete implementations of `AbstractFrameGraphModel` must provide this function! """ -@interface function rotation12(::F, ::Int, ::Int, ::T) where {T, F <: AbstractFrameGraphModel} end +@interface function rotation12(::AbstractFrameGraphModel, ::Int, ::Int, ::Number) end end \ No newline at end of file From 7b2ad927cc45b77980e3b635d6c83b2bf6f3049b Mon Sep 17 00:00:00 2001 From: Andrea Pasquale Date: Sat, 11 Nov 2023 18:31:47 +0100 Subject: [PATCH 06/12] update docs --- docs/make.jl | 2 + docs/src/interfaces/Frames.md | 4 ++ docs/src/interfaces/Graphs.md | 4 ++ src/Frames.jl | 54 +++++++++++++-------------- src/Graph.jl | 48 +++++++++++++++++++++++- src/JSMDInterfaces.jl | 3 +- src/{Models/abstract.jl => Models.jl} | 11 +++++- src/Models/Models.jl | 10 ----- src/Models/acceleration.jl | 24 ------------ 9 files changed, 94 insertions(+), 66 deletions(-) create mode 100644 docs/src/interfaces/Frames.md create mode 100644 docs/src/interfaces/Graphs.md rename src/{Models/abstract.jl => Models.jl} (91%) delete mode 100644 src/Models/Models.jl delete mode 100644 src/Models/acceleration.jl diff --git a/docs/make.jl b/docs/make.jl index 2bba0b7..6c4bc00 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -13,6 +13,8 @@ makedocs(; "interfaces/Errors.md", "interfaces/Interface.md", "interfaces/FilesIO.md", + "interfaces/Graphs.md" + "interfaces/Frames.md" "interfaces/Math.md", "interfaces/Ephemeris.md", "interfaces/Models.md" diff --git a/docs/src/interfaces/Frames.md b/docs/src/interfaces/Frames.md new file mode 100644 index 0000000..4280c09 --- /dev/null +++ b/docs/src/interfaces/Frames.md @@ -0,0 +1,4 @@ +# Frames +```@autodocs +Modules = [JSMDInterfaces.Frames] +``` \ No newline at end of file diff --git a/docs/src/interfaces/Graphs.md b/docs/src/interfaces/Graphs.md new file mode 100644 index 0000000..41b1332 --- /dev/null +++ b/docs/src/interfaces/Graphs.md @@ -0,0 +1,4 @@ +# Models +```@autodocs +Modules = [JSMDInterfaces.Graphs] +``` \ No newline at end of file diff --git a/src/Frames.jl b/src/Frames.jl index cc1a34c..96ac153 100644 --- a/src/Frames.jl +++ b/src/Frames.jl @@ -3,17 +3,17 @@ module Frames using Graphs: AbstractGraph using JSMDInterfaces.Interface: @interface -export AbstractFrameGraphModel, +export AbstractJSMDFrameGraph, vector3, vector6, vector9, vector12, rotation3, rotation6, rotation9, rotation12 """ - AbstractFrameGraphModel + AbstractJSMDFrameGraph Abstract type for frames graphs. Subtype it to create a new frames graph compatible with the ecosystem. """ -abstract type AbstractFrameGraphModel{T} <: AbstractGraph{T} end +abstract type AbstractJSMDFrameGraph{T} <: AbstractGraph{T} end # ---- # JSMD interface @@ -24,16 +24,16 @@ abstract type AbstractFrameGraphModel{T} <: AbstractGraph{T} end This function serves as an interface for constructing a position vector using a frame graph model. ### Arguments -- `model::F`: An instance of a subtype of `AbstractFrameGraphModel`, representing the frame graph model. +- `model::F`: An instance of a subtype of `AbstractJSMDFrameGraph`, representing the frame graph model. - `from::Int`: The source node or point for the vector. - `to::Int`: The destination node or point for the vector. - `axis::Int`: The specific axis of the vector. - `time::T`: The independent variable (time), in seconds since J2000. !!! warning - Concrete implementations of `AbstractFrameGraphModel` must provide this function! + Concrete implementations of `AbstractJSMDFrameGraph` must provide this function! """ -@interface function vector3(::AbstractFrameGraphModel, ::Int, ::Int, ::Int, ::Number) end +@interface function vector3(::AbstractJSMDFrameGraph, ::Int, ::Int, ::Int, ::Number) end """ vector6(model::F, from::Int, to::Int, axis::Int, time::Number) @@ -41,16 +41,16 @@ This function serves as an interface for constructing a position vector using a This function serves as an interface for constructing a position and velocity vector using a frame graph model. ### Arguments -- `model::F`: An instance of a subtype of `AbstractFrameGraphModel`, representing the frame graph model. +- `model::F`: An instance of a subtype of `AbstractJSMDFrameGraph`, representing the frame graph model. - `from::Int`: The source node or point for the vector. - `to::Int`: The destination node or point for the vector. - `axis::Int`: The specific axis of the vector. - `time::T`: The independent variable (time), in seconds since J2000. !!! warning - Concrete implementations of `AbstractFrameGraphModel` must provide this function! + Concrete implementations of `AbstractJSMDFrameGraph` must provide this function! """ -@interface function vector6(::AbstractFrameGraphModel, ::Int, ::Int, ::Int, ::Number) end +@interface function vector6(::AbstractJSMDFrameGraph, ::Int, ::Int, ::Int, ::Number) end """ vector9(model::F, from::Int, to::Int, axis::Int, time::Number) @@ -59,16 +59,16 @@ This function serves as an interface for constructing a position, velocity, and using a frame graph model. ### Arguments -- `model::F`: An instance of a subtype of `AbstractFrameGraphModel`, representing the frame graph model. +- `model::F`: An instance of a subtype of `AbstractJSMDFrameGraph`, representing the frame graph model. - `from::Int`: The source node or point for the vector. - `to::Int`: The destination node or point for the vector. - `axis::Int`: The specific axis of the vector. - `time::T`: The independent variable (time), in seconds since J2000. !!! warning - Concrete implementations of `AbstractFrameGraphModel` must provide this function! + Concrete implementations of `AbstractJSMDFrameGraph` must provide this function! """ -@interface function vector9(::AbstractFrameGraphModel, ::Int, ::Int, ::Int, ::Number) end +@interface function vector9(::AbstractJSMDFrameGraph, ::Int, ::Int, ::Int, ::Number) end """ vector12(model::F, from::Int, to::Int, axis::Int, time::Number) @@ -77,16 +77,16 @@ This function serves as an interface for constructing a position, velocity, acce using a frame graph model. ### Arguments -- `model::F`: An instance of a subtype of `AbstractFrameGraphModel`, representing the frame graph model. +- `model::F`: An instance of a subtype of `AbstractJSMDFrameGraph`, representing the frame graph model. - `from::Int`: The source node or point for the vector. - `to::Int`: The destination node or point for the vector. - `axis::Int`: The specific axis of the vector. - `time::T`: The independent variable (time), in seconds since J2000. !!! warning - Concrete implementations of `AbstractFrameGraphModel` must provide this function! + Concrete implementations of `AbstractJSMDFrameGraph` must provide this function! """ -@interface function vector12(::AbstractFrameGraphModel, ::Int, ::Int, ::Int, ::Number) end +@interface function vector12(::AbstractJSMDFrameGraph, ::Int, ::Int, ::Int, ::Number) end """ rotation3(model::F, from::Int, to::Int, time::Number) @@ -95,15 +95,15 @@ This function serves as an interface for constructing a rotation matrix between a frame graph model. ### Arguments -- `model::F`: An instance of a subtype of `AbstractFrameGraphModel`, representing the frame graph model. +- `model::F`: An instance of a subtype of `AbstractJSMDFrameGraph`, representing the frame graph model. - `from::Int`: The source node or axis for the rotation matrix. - `to::Int`: The destination node or axis for the rotation matrix. - `time::T`: The independent variable (time), in seconds since J2000. !!! warning - Concrete implementations of `AbstractFrameGraphModel` must provide this function! + Concrete implementations of `AbstractJSMDFrameGraph` must provide this function! """ -@interface function rotation3(::AbstractFrameGraphModel, ::Int, ::Int, ::Number) end +@interface function rotation3(::AbstractJSMDFrameGraph, ::Int, ::Int, ::Number) end """ rotation6(model::F, from::Int, to::Int, time::Number) @@ -112,15 +112,15 @@ This function serves as an interface for constructing a rotation matrix and its between two axes within a frame graph model. ### Arguments -- `model::F`: An instance of a subtype of `AbstractFrameGraphModel`, representing the frame graph model. +- `model::F`: An instance of a subtype of `AbstractJSMDFrameGraph`, representing the frame graph model. - `from::Int`: The source node or axis for the rotation matrix. - `to::Int`: The destination node or axis for the rotation matrix. - `time::T`: The independent variable (time), in seconds since J2000. !!! warning - Concrete implementations of `AbstractFrameGraphModel` must provide this function! + Concrete implementations of `AbstractJSMDFrameGraph` must provide this function! """ -@interface function rotation6(::AbstractFrameGraphModel, ::Int, ::Int, ::Number) end +@interface function rotation6(::AbstractJSMDFrameGraph, ::Int, ::Int, ::Number) end """ rotation9(model::F, from::Int, to::Int, time::Number) @@ -129,15 +129,15 @@ This function serves as an interface for constructing a rotation matrix, its fir derivative between two axes within a frame graph model. ### Arguments -- `model::F`: An instance of a subtype of `AbstractFrameGraphModel`, representing the frame graph model. +- `model::F`: An instance of a subtype of `AbstractJSMDFrameGraph`, representing the frame graph model. - `from::Int`: The source node or axis for the rotation matrix. - `to::Int`: The destination node or axis for the rotation matrix. - `time::T`: The independent variable (time), in seconds since J2000. !!! warning - Concrete implementations of `AbstractFrameGraphModel` must provide this function! + Concrete implementations of `AbstractJSMDFrameGraph` must provide this function! """ -@interface function rotation9(::AbstractFrameGraphModel, ::Int, ::Int, ::Number) end +@interface function rotation9(::AbstractJSMDFrameGraph, ::Int, ::Int, ::Number) end """ rotation12(model::F, from::Int, to::Int, time::Number) @@ -146,14 +146,14 @@ This function serves as an interface for constructing a rotation matrix, its fir derivative between two axes within a frame graph model. ### Arguments -- `model::F`: An instance of a subtype of `AbstractFrameGraphModel`, representing the frame graph model. +- `model::F`: An instance of a subtype of `AbstractJSMDFrameGraph`, representing the frame graph model. - `from::Int`: The source node or axis for the rotation matrix. - `to::Int`: The destination node or axis for the rotation matrix. - `time::T`: The independent variable (time), in seconds since J2000. !!! warning - Concrete implementations of `AbstractFrameGraphModel` must provide this function! + Concrete implementations of `AbstractJSMDFrameGraph` must provide this function! """ -@interface function rotation12(::AbstractFrameGraphModel, ::Int, ::Int, ::Number) end +@interface function rotation12(::AbstractJSMDFrameGraph, ::Int, ::Int, ::Number) end end \ No newline at end of file diff --git a/src/Graph.jl b/src/Graph.jl index e1ae6b4..2f158f0 100644 --- a/src/Graph.jl +++ b/src/Graph.jl @@ -6,8 +6,38 @@ using Graphs import Graphs: has_vertex, has_edge, edges, edgetype, inneighbors, ne, nv, outneighbors, vertices, is_directed +""" + AbstractJSMDGraph{T} + +Abstract type for graphs. +Subtype it to create a graphs compatible with the ecosystem. + +Graphs here could be compatible with both JSMD ecosystem and [`Graphs.jl`](https://github.com/JuliaGraphs/Graphs.jl). + +For `JSMD` compatibility, see also: +[`add_vertex!`](@ref), +[`add_edge!`](@ref). + +For `Graphs.jl` compatibility, see also: +[`has_vertex`](@ref Graphs.has_vertex) +[`has_edge`](@ref Graphs.has_edge) +[`edges`](@ref Graphs.edges) +[`edgetype`](@ref Graphs.edgetype) +[`inneighbors`](@ref Graphs.inneighbors) +[`ne`](@ref Graphs.ne) +[`nv`](@ref Graphs.nv) +[`outneighbors`](@ref Graphs.outneighbors) +[`vertices`](@ref Graphs.vertices) +[`is_directed`](@ref Graphs.is_directed) +""" abstract type AbstractJSMDGraph{T} <: AbstractGraph{T} end +""" + AbstractJSMDGraphNode + +Abstract type for graph nodes. +Subtype it to create a graph nodes compatible with the ecosystem. +""" abstract type AbstractJSMDGraphNode end # Graphs interface @@ -34,8 +64,24 @@ abstract type AbstractJSMDGraphNode end # JSMD interface -@interface function add_vertex!(::AbstractJSMDGraph, ::N) where {N<:AbstractJSMDGraph} end +""" + add_vertex!(::AbstractJSMDGraph, ::N) + +This function serves as an interface for inserting a new vertex in a graph. + +!!! warning + Concrete implementations of `AbstractJSMDGraph` must provide this function! +""" +@interface function add_vertex!(::AbstractJSMDGraph, ::N) where {N<:AbstractJSMDGraphNode} end + +""" + add_edge!(::AbstractJSMDGraph, ::Int, ::Int, ::Int) + +This function serves as an interface for inserting a new (weighted) edge in a graph. +!!! warning + Concrete implementations of `AbstractJSMDGraph` must provide this function! +""" @interface function add_edge!(::AbstractJSMDGraph, ::Int, ::Int, ::Int) end end \ No newline at end of file diff --git a/src/JSMDInterfaces.jl b/src/JSMDInterfaces.jl index 7452523..f16304b 100644 --- a/src/JSMDInterfaces.jl +++ b/src/JSMDInterfaces.jl @@ -8,7 +8,6 @@ include("FilesIO.jl") include("Frames.jl") include("Math.jl") include("Ephemeris.jl") - -include("Models/Models.jl") +include("Models.jl") end \ No newline at end of file diff --git a/src/Models/abstract.jl b/src/Models.jl similarity index 91% rename from src/Models/abstract.jl rename to src/Models.jl index 442e715..b87e7a8 100644 --- a/src/Models/abstract.jl +++ b/src/Models.jl @@ -1,9 +1,14 @@ +module Models + +using JSMDInterfaces.Errors +using JSMDInterfaces.Interface: @interface +using JSMDInterfaces.FilesIO: AbstractArchiveNode + export AbstractJSMDModel, AbstractJSMDModelData, parse_data, parse_data, dump_model, load_model - """ AbstractJSMDModelData @@ -60,4 +65,6 @@ This function serves as an interface to dump to an archive node a JSMD compatibl This function serves as an interface to load from an archive node a JSMD compatible model. """ @interface function load_model(::Type{T}, ::Type{<:AbstractJSMDModel}, ::N, - args...; kargs...) where {T, N <: AbstractArchiveNode} end \ No newline at end of file + args...; kargs...) where {T, N <: AbstractArchiveNode} end + +end \ No newline at end of file diff --git a/src/Models/Models.jl b/src/Models/Models.jl deleted file mode 100644 index c26b2e6..0000000 --- a/src/Models/Models.jl +++ /dev/null @@ -1,10 +0,0 @@ -module Models - -using JSMDInterfaces.Errors -using JSMDInterfaces.Interface: @interface -using JSMDInterfaces.FilesIO: AbstractArchiveNode - -include("abstract.jl") -include("acceleration.jl") - -end \ No newline at end of file diff --git a/src/Models/acceleration.jl b/src/Models/acceleration.jl deleted file mode 100644 index 4fe0019..0000000 --- a/src/Models/acceleration.jl +++ /dev/null @@ -1,24 +0,0 @@ -export AbstractAccelerationModel, AbstractAccelerationModelData, compute_acceleration - -""" - AbstractAccelerationModel - -Basic abstract type for acceleration models compatible with JSMD ecosystem. -""" -abstract type AbstractAccelerationModel <: AbstractJSMDModel end - -""" - AbstractAccelerationModel - -Basic abstract type for acceleration models data compatible with JSMD ecosystem. -""" -abstract type AbstractAccelerationModelData <: AbstractJSMDModelData end - -""" - compute_acceleration(::M, args...; kwargs...) where {M <: AbstractAccelerationModel} end - -This function serves as an interface to compute accelerations from JSMD compatible -acceleration models. -""" -@interface function compute_acceleration(::M, args...; - kwargs...) where {M <: AbstractAccelerationModel} end \ No newline at end of file From bebaeba17b07ebaed5d2ef3d6a31f117334a51f5 Mon Sep 17 00:00:00 2001 From: Andrea Pasquale Date: Sat, 11 Nov 2023 18:34:19 +0100 Subject: [PATCH 07/12] fixed typo and add julia 1.9 tests --- .github/workflows/ci.yml | 1 + docs/make.jl | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 825dd9a..65332b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,7 @@ jobs: matrix: version: - '1.8' + - '1.9' - nightly os: - ubuntu-latest diff --git a/docs/make.jl b/docs/make.jl index 6c4bc00..150371b 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -13,8 +13,8 @@ makedocs(; "interfaces/Errors.md", "interfaces/Interface.md", "interfaces/FilesIO.md", - "interfaces/Graphs.md" - "interfaces/Frames.md" + "interfaces/Graphs.md", + "interfaces/Frames.md", "interfaces/Math.md", "interfaces/Ephemeris.md", "interfaces/Models.md" From f4baffcf441f9003c4cc4ffa5a516172f4276fc6 Mon Sep 17 00:00:00 2001 From: Andrea Pasquale Date: Sat, 11 Nov 2023 18:39:12 +0100 Subject: [PATCH 08/12] fixed typo --- docs/src/interfaces/Graphs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/interfaces/Graphs.md b/docs/src/interfaces/Graphs.md index 41b1332..422a69e 100644 --- a/docs/src/interfaces/Graphs.md +++ b/docs/src/interfaces/Graphs.md @@ -1,4 +1,4 @@ -# Models +# Graph ```@autodocs -Modules = [JSMDInterfaces.Graphs] +Modules = [JSMDInterfaces.Graph] ``` \ No newline at end of file From 1958a14b6c748fe61cc9c770ec8b170fc2b693e0 Mon Sep 17 00:00:00 2001 From: Andrea Pasquale Date: Sat, 11 Nov 2023 18:43:01 +0100 Subject: [PATCH 09/12] julia 1.6, 1.7 added to matrix, minor docs fix --- .github/workflows/ci.yml | 4 +++- src/Graph.jl | 12 +----------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 65332b2..aecd266 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,9 +12,11 @@ jobs: fail-fast: false matrix: version: + - '1.6' + - '1.7' - '1.8' - '1.9' - - nightly + - 'nightly' os: - ubuntu-latest arch: diff --git a/src/Graph.jl b/src/Graph.jl index 2f158f0..34aa853 100644 --- a/src/Graph.jl +++ b/src/Graph.jl @@ -18,17 +18,7 @@ For `JSMD` compatibility, see also: [`add_vertex!`](@ref), [`add_edge!`](@ref). -For `Graphs.jl` compatibility, see also: -[`has_vertex`](@ref Graphs.has_vertex) -[`has_edge`](@ref Graphs.has_edge) -[`edges`](@ref Graphs.edges) -[`edgetype`](@ref Graphs.edgetype) -[`inneighbors`](@ref Graphs.inneighbors) -[`ne`](@ref Graphs.ne) -[`nv`](@ref Graphs.nv) -[`outneighbors`](@ref Graphs.outneighbors) -[`vertices`](@ref Graphs.vertices) -[`is_directed`](@ref Graphs.is_directed) +For `Graphs.jl` compatibility, see also: [Graphs.jl interface](https://juliagraphs.org/Graphs.jl/dev/ecosystem/interface/) """ abstract type AbstractJSMDGraph{T} <: AbstractGraph{T} end From a5874cbe150f4183a0ce938aabfcbef2b6e411ac Mon Sep 17 00:00:00 2001 From: MicheleCeresoli Date: Sat, 11 Nov 2023 21:38:40 +0100 Subject: [PATCH 10/12] Removed nightly builds from tests --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aecd266..13e8322 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,13 +16,13 @@ jobs: - '1.7' - '1.8' - '1.9' - - 'nightly' + - '1' os: - ubuntu-latest arch: - x64 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }} @@ -48,7 +48,7 @@ jobs: name: Documentation runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v1 with: version: '1' From 3e07eeed8aeb3f4f1f1a853231a103aa263cb6a5 Mon Sep 17 00:00:00 2001 From: MicheleCeresoli Date: Sat, 11 Nov 2023 21:55:59 +0100 Subject: [PATCH 11/12] Minor styling --- src/Graph.jl | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/Graph.jl b/src/Graph.jl index 34aa853..d078ec9 100644 --- a/src/Graph.jl +++ b/src/Graph.jl @@ -1,10 +1,19 @@ module Graph -using JSMDInterfaces.Interface: @interface - using Graphs -import Graphs: has_vertex, has_edge, edges, edgetype, inneighbors, ne, nv, outneighbors, vertices, is_directed +using JSMDInterfaces.Interface: @interface + +import Graphs: has_vertex, + has_edge, + edges, + edgetype, + inneighbors, + ne, + nv, + outneighbors, + vertices, + is_directed """ AbstractJSMDGraph{T} @@ -14,9 +23,7 @@ Subtype it to create a graphs compatible with the ecosystem. Graphs here could be compatible with both JSMD ecosystem and [`Graphs.jl`](https://github.com/JuliaGraphs/Graphs.jl). -For `JSMD` compatibility, see also: -[`add_vertex!`](@ref), -[`add_edge!`](@ref). +For `JSMD` compatibility, see also: [`add_vertex!`](@ref) and [`add_edge!`](@ref). For `Graphs.jl` compatibility, see also: [Graphs.jl interface](https://juliagraphs.org/Graphs.jl/dev/ecosystem/interface/) """ From 960377d4bb8cd5eb5e82c037675587df3c7fffae Mon Sep 17 00:00:00 2001 From: Andrea Pasquale Date: Sat, 11 Nov 2023 22:07:44 +0100 Subject: [PATCH 12/12] NotImplementedError import solved --- src/Ephemeris.jl | 2 +- src/FilesIO.jl | 2 +- src/Frames.jl | 2 +- src/Graph.jl | 2 +- src/Interface.jl | 4 ++-- src/Math.jl | 2 +- src/Models.jl | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Ephemeris.jl b/src/Ephemeris.jl index e0cfb8f..d90a458 100644 --- a/src/Ephemeris.jl +++ b/src/Ephemeris.jl @@ -3,7 +3,7 @@ module Ephemeris export AbstractEphemerisProvider, load, ephem_compute!, ephem_orient!, EphemerisError using JSMDInterfaces.Errors: @custom_error, AbstractGenericException -using JSMDInterfaces.Interface: @interface +using JSMDInterfaces.Interface import JSMDInterfaces.FilesIO: load @custom_error struct EphemerisError <: AbstractGenericException diff --git a/src/FilesIO.jl b/src/FilesIO.jl index 00503c9..f165fc8 100644 --- a/src/FilesIO.jl +++ b/src/FilesIO.jl @@ -1,6 +1,6 @@ module FilesIO -using JSMDInterfaces.Interface: @interface +using JSMDInterfaces.Interface using JSMDInterfaces.Graph: AbstractJSMDGraphNode export load, filepath, filepaths diff --git a/src/Frames.jl b/src/Frames.jl index 96ac153..cfe763b 100644 --- a/src/Frames.jl +++ b/src/Frames.jl @@ -1,7 +1,7 @@ module Frames using Graphs: AbstractGraph -using JSMDInterfaces.Interface: @interface +using JSMDInterfaces.Interface export AbstractJSMDFrameGraph, vector3, vector6, vector9, vector12, diff --git a/src/Graph.jl b/src/Graph.jl index 34aa853..d6d364b 100644 --- a/src/Graph.jl +++ b/src/Graph.jl @@ -1,6 +1,6 @@ module Graph -using JSMDInterfaces.Interface: @interface +using JSMDInterfaces.Interface using Graphs diff --git a/src/Interface.jl b/src/Interface.jl index a26d19b..21ba005 100644 --- a/src/Interface.jl +++ b/src/Interface.jl @@ -1,8 +1,8 @@ module Interface -using JSMDInterfaces.Errors: NotImplementedError +import JSMDInterfaces.Errors: NotImplementedError -export @interface +export @interface, NotImplementedError """ @interface diff --git a/src/Math.jl b/src/Math.jl index 51af967..a7fc8b2 100644 --- a/src/Math.jl +++ b/src/Math.jl @@ -1,6 +1,6 @@ module Math -using JSMDInterfaces.Interface: @interface +using JSMDInterfaces.Interface export interpolate diff --git a/src/Models.jl b/src/Models.jl index b87e7a8..186ea8e 100644 --- a/src/Models.jl +++ b/src/Models.jl @@ -1,7 +1,7 @@ module Models using JSMDInterfaces.Errors -using JSMDInterfaces.Interface: @interface +using JSMDInterfaces.Interface using JSMDInterfaces.FilesIO: AbstractArchiveNode export AbstractJSMDModel,