From 1f22a45b55dfc956fc2bf06f5c0b3c1f898758b6 Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Wed, 24 Jul 2024 13:48:25 +0530 Subject: [PATCH] docs: update documentation for `symbolic_container` --- docs/src/api.md | 5 ++++- src/index_provider_interface.jl | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/src/api.md b/docs/src/api.md index bb4558de..4811a57d 100644 --- a/docs/src/api.md +++ b/docs/src/api.md @@ -5,7 +5,6 @@ ### Mandatory methods ```@docs -symbolic_container is_variable variable_index variable_symbols @@ -26,6 +25,10 @@ allvariables ### Optional Methods +```@docs +symbolic_container +``` + #### Observed equation handling ```@docs diff --git a/src/index_provider_interface.jl b/src/index_provider_interface.jl index 72caed49..08b0c5b8 100644 --- a/src/index_provider_interface.jl +++ b/src/index_provider_interface.jl @@ -5,6 +5,11 @@ Using `indp`, return an object that implements the index provider interface. In itself implements the interface, `indp` can be returned as-is. All index provider interface methods fall back to calling the same method on `symbolic_container(indp)`, so this may be used for trivial implementations of the interface that forward all calls to another object. + +Note that this method is optional. Thus the correct method to check for a fallback is: +```julia +hasmethod(symbolic_container, Tuple{typeof(indp)}) && symbolic_container(indp) != indp +``` """ function symbolic_container end