From de7bf161108537190bece37a70e8b22491b2f8b4 Mon Sep 17 00:00:00 2001 From: Manuel Date: Fri, 3 Nov 2023 08:14:57 +0100 Subject: [PATCH 1/2] Handle GetAttributeNotAllowed when getting relative gap Re #580 --- src/run_spineopt_standard.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/run_spineopt_standard.jl b/src/run_spineopt_standard.jl index bd8321ff65..cfe4022be9 100644 --- a/src/run_spineopt_standard.jl +++ b/src/run_spineopt_standard.jl @@ -403,7 +403,7 @@ function _save_other_values!(m::Model) (model=m.ext[:spineopt].instance, t=current_window(m),) => JuMP.MOI.get(m, JuMP.MOI.RelativeGap()) ) catch err - err isa JuMP.MOI.UnsupportedAttribute || rethrow(err) + err isa (JuMP.MOI.UnsupportedAttribute, JuMP.MOI.GetAttributeNotAllowed) || rethrow(err) end end From 9908381d8035c378616943bad6f8f979a6a227a1 Mon Sep 17 00:00:00 2001 From: Manuel Date: Fri, 3 Nov 2023 14:58:48 +0100 Subject: [PATCH 2/2] Move docs_utils to the docs folder and regenerate variables.md on build --- docs/Project.toml | 2 + {src/util => docs}/docs_utils.jl | 58 ++- docs/make.jl | 25 +- .../src/mathematical_formulation/variables.md | 330 ------------------ .../write_documentation_sets_and_variables.jl | 31 -- src/SpineOpt.jl | 1 - test/runtests.jl | 1 - test/util/docs_utils.jl | 47 --- test/util/docs_utils.md | 1 - 9 files changed, 60 insertions(+), 436 deletions(-) rename {src/util => docs}/docs_utils.jl (90%) delete mode 100644 docs/src/mathematical_formulation/variables.md delete mode 100644 docs/src/mathematical_formulation/write_documentation_sets_and_variables.jl delete mode 100644 test/util/docs_utils.jl delete mode 100644 test/util/docs_utils.md diff --git a/docs/Project.toml b/docs/Project.toml index c71c9f4c0b..5f63ce440e 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,3 +1,5 @@ [deps] +CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" +DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" SpineOpt = "0d8fc150-4032-4b6e-9540-20efcb304861" diff --git a/src/util/docs_utils.jl b/docs/docs_utils.jl similarity index 90% rename from src/util/docs_utils.jl rename to docs/docs_utils.jl index 31d6bd9203..4f2bd1b7b8 100644 --- a/src/util/docs_utils.jl +++ b/docs/docs_utils.jl @@ -16,6 +16,35 @@ # You should have received a copy of the GNU Lesser General Public License # along with this program. If not, see . ############################################################################# +using CSV +using DataFrames + +function write_documentation_sets_variables(mathpath) + variables = DataFrame(CSV.File(joinpath(mathpath, "variables.csv"))) + variables.variable_name_latex = replace.(variables.variable_name, r"_" => "\\_") + variables.variable_name_latex .= "``v_{" .* variables.variable_name_latex .* "} ``" + variables.indices .= replace.(variables.indices, r"_" => "\\_") + variable_string = "# Variables \n" + for i in 1:size(variables, 1) + variable_string = string(variable_string, "## `$(variables.variable_name[i])` \n\n") + variable_string = string(variable_string, " > **Math symbol:** $(variables.variable_name_latex[i]) \n\n") + variable_string = string(variable_string, " > **Indices:** $(variables.index[i]) \n\n") + variable_string = string(variable_string, " > **Indices function:** $(variables.indices[i]) \n\n") + variable_string = string(variable_string, "$(variables.description[i]) \n\n") + end + sets = dropmissing(DataFrame(CSV.File(joinpath(mathpath, "sets.csv")))) + set_string = "# Sets \n" + for i in 1:size(sets, 1) + set_string = string(set_string, "## `$(sets.indices[i])` \n\n") + set_string = string(set_string, "$(sets.Description[i]) \n\n") + end + open(joinpath(mathpath, "variables.md"), "w") do io + write(io, variable_string) + end + open(joinpath(mathpath, "sets.md"), "w") do io + write(io, set_string) + end +end """ initialize_concept_dictionary(template::Dict; translation::Dict=Dict()) @@ -352,23 +381,19 @@ end """ alldocstrings(m) -Return all docstrings from the provided module m as a dictionary. +A Dict mapping function name to its docstring for given Module. """ function alldocstrings(m) - #allbindings(m) = [ [y[2].data[:binding] for y in x[2].docs] for x in Base.eval(m,Base.Docs.META) ] - bindings = [] - for x in Base.eval(m,Base.Docs.META) - for y in x[2].docs - push!(bindings,[y[2].data[:binding]]) - end - end alldocs = Dict() - for binding in bindings - dockey = split(string(binding[1]),".")[2] - docvalue = Base.Docs.doc(binding[1]) - alldocs[dockey] = docvalue + for multidoc in values(Base.eval(m, Base.Docs.META)) + for doc_str in values(multidoc.docs) + binding = doc_str.data[:binding] + key = split(string(binding), ".")[2] + value = Base.Docs.doc(binding) + alldocs[key] = value + end end - return alldocs + alldocs end """ @@ -376,7 +401,9 @@ end Finds specific regions within a docstring and return them as a single string. """ -function findregions(docstring; regions=["formulation","description"], title="", fieldtitle=false, sep="\n\n", debugmode=false) +function findregions( + docstring; regions=["formulation","description"], title="", fieldtitle=false, sep="\n\n", debugmode=false +) md = "" if !isempty(title) md *= title * sep @@ -396,7 +423,8 @@ function findregions(docstring; regions=["formulation","description"], title="", catch if debugmode @warn "Cannot find #(end)region $region" - #the error could also be because there is no docstring for constraint but that is a very rare case as there is often at least a dynamic docstring + # the error could also be because there is no docstring for constraint but that is a very rare case + # as there is often at least a dynamic docstring end end end diff --git a/docs/make.jl b/docs/make.jl index 56de6e6b38..4b6953b408 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,32 +1,37 @@ using Documenter using SpineOpt +include("docs_utils.jl") + # Automatically write the `Concept Reference` files using the `spineopt_template.json` as a basis. # Actual descriptions are fetched separately from `src/concept_reference/concepts/` path = @__DIR__ default_translation = Dict( - #["tool_features"] => "Tool Features", + # ["tool_features"] => "Tool Features", ["relationship_classes"] => "Relationship Classes", ["parameter_value_lists"] => "Parameter Value Lists", - #["features"] => "Features", - #["tools"] => "Tools", + # ["features"] => "Features", + # ["tools"] => "Tools", ["object_parameters", "relationship_parameters"] => "Parameters", ["object_classes"] => "Object Classes", ) -concept_dictionary = SpineOpt.add_cross_references!( - SpineOpt.initialize_concept_dictionary(SpineOpt.template(); translation=default_translation), +concept_dictionary = add_cross_references!( + initialize_concept_dictionary(SpineOpt.template(); translation=default_translation), ) -SpineOpt.write_concept_reference_files(concept_dictionary, path) +write_concept_reference_files(concept_dictionary, path) -# Automatically write the 'constraints_automatically_generated_file' file using the 'constraints' file and content from docstrings +# Automatically write the 'constraints_automatically_generated_file' file using the 'constraints' file +# and content from docstrings mathpath = joinpath(path, "src", "mathematical_formulation") -alldocs = SpineOpt.alldocstrings(SpineOpt) +alldocs = alldocstrings(SpineOpt) instructionlist = readlines(joinpath(mathpath, "constraints.md")) -markdownstring = SpineOpt.docs_from_instructionlist(alldocs, instructionlist) +markdownstring = docs_from_instructionlist(alldocs, instructionlist) open(joinpath(mathpath, "constraints_automatically_generated_file.md"), "w") do file write(file, markdownstring) end +write_documentation_sets_variables(mathpath) + # Generate the documentation pages # Replace the Any[...] with just Any[] if you want to collect content automatically via `expand_empty_chapters!` pages = [ @@ -77,7 +82,7 @@ pages = [ "Implementation details" => [], "Library" => "library.md", ] -SpineOpt.populate_empty_chapters!(pages, joinpath(path, "src")) +populate_empty_chapters!(pages, joinpath(path, "src")) # Create and deploy the documentation makedocs( diff --git a/docs/src/mathematical_formulation/variables.md b/docs/src/mathematical_formulation/variables.md deleted file mode 100644 index a7ca659c81..0000000000 --- a/docs/src/mathematical_formulation/variables.md +++ /dev/null @@ -1,330 +0,0 @@ -# Variables -## `binary_gas_connection_flow` - - > **Math symbol:** ``v_{binary\_gas\_connection\_flow} `` - - > **Indices:** (connection=conn, node=n, direction=d, stochastic_scenario=s, t=t) - - > **Indices function:** binary\_gas\_connection\_flow\_indices - -Binary variable with the indices node ``n`` over the connection ``conn`` in the direction ``to\_node`` for the stochastic scenario ``s`` at timestep ``t`` describing if the direction of gas flow for a pressure drive gas transfer is in the indicated direction. - -## `connection_flow ` - - > **Math symbol:** ``v_{connection\_flow } `` - - > **Indices:** (connection=conn, node=n, direction=d, stochastic_scenario=s, t=t) - - > **Indices function:** connection\_flow\_indices - -Commodity flow associated with node ``n`` over the connection ``conn`` in the direction ``d`` for the stochastic scenario ``s`` at timestep ``t`` - -## `connection_intact_flow` - - > **Math symbol:** ``v_{connection\_intact\_flow} `` - - > **Indices:** (connection=conn, node=n, direction=d, stochastic_scenario=s, t=t) - - > **Indices function:** connection\_intact\_flow\_indices - -Represents the ptdf-based flow on connections where all investment candidate connections are present in the network. - -## `connections_decommissioned` - - > **Math symbol:** ``v_{connections\_decommissioned} `` - - > **Indices:** (connection=conn, stochastic_scenario=s, t=t) - - > **Indices function:** connections\_invested\_available\_indices - -Number of decomissioned connections ``conn`` for the stochastic scenario ``s`` at timestep ``t`` - -## `connections_invested` - - > **Math symbol:** ``v_{connections\_invested} `` - - > **Indices:** (connection=conn, stochastic_scenario=s, t=t) - - > **Indices function:** connections\_invested\_available\_indices - -Number of connections ``conn`` invested at timestep ``t`` in for the stochastic scenario ``s`` - -## `connections_invested_available` - - > **Math symbol:** ``v_{connections\_invested\_available} `` - - > **Indices:** (connection=conn, stochastic_scenario=s, t=t) - - > **Indices function:** connections\_invested\_available\_indices - -Number of invested connections ``conn`` that are available still the stochastic scenario ``s`` at timestep ``t`` - -## `mp_objective_lowerbound_indices` - - > **Math symbol:** ``v_{mp\_objective\_lowerbound\_indices} `` - - > **Indices:** (t=t) - - > **Indices function:** mp\_objective\_lowerbound\_indices - -Updating lowerbound for master problem of Benders decomposition - -## `node_injection` - - > **Math symbol:** ``v_{node\_injection} `` - - > **Indices:** (node=n, stochastic_scenario=s, t=t) - - > **Indices function:** node\_injection\_indices - -Commodity injections at node ``n`` for the stochastic scenario ``s`` at timestep ``t`` - -## `node_pressure` - - > **Math symbol:** ``v_{node\_pressure} `` - - > **Indices:** (node=n, stochastic_scenario=s, t=t) - - > **Indices function:** node\_pressure\_indices - -Pressue at a node ``n`` for a specific stochastic scenario ``s`` and timestep ``t``. See also: [has\_pressure](@ref) - -## `node_slack_neg` - - > **Math symbol:** ``v_{node\_slack\_neg} `` - - > **Indices:** (node=n, stochastic_scenario=s, t=t) - - > **Indices function:** node\_slack\_indices - -Negative slack variable at node ``n`` for the stochastic scenario ``s`` at timestep ``t`` - -## `node_slack_pos` - - > **Math symbol:** ``v_{node\_slack\_pos} `` - - > **Indices:** (node=n, stochastic_scenario=s, t=t) - - > **Indices function:** node\_slack\_indices - -Positive slack variable at node ``n`` for the stochastic scenario ``s`` at timestep ``t`` - -## `node_state` - - > **Math symbol:** ``v_{node\_state} `` - - > **Indices:** (node=n, stochastic_scenario=s, t=t) - - > **Indices function:** node\_state\_indices - -Storage state at node ``n`` for the stochastic scenario ``s`` at timestep ``t`` - -## `node_voltage_angle` - - > **Math symbol:** ``v_{node\_voltage\_angle} `` - - > **Indices:** (node=n, stochastic_scenario=s, t=t) - - > **Indices function:** node\_voltage\_angle\_indices - -Voltage angle at a node ``n`` for a specific stochastic scenario ``s`` and timestep ``t``. See also: [has\_voltage\_angle](@ref) - -## `nonspin_ramp_down_unit_flow` - - > **Math symbol:** ``v_{nonspin\_ramp\_down\_unit\_flow} `` - - > **Indices:** (unit=u, node=n, direction=d, stochastic_scenario=s, t=t) - - > **Indices function:** nonspin\_ramp\_down\_unit\_flow\_indices - -Non-spinning downward reserve commodity flows of unit ``u`` at node ``n`` in the direction ``d`` for the stochastic scenario ``s`` at timestep ``t`` - -## `nonspin_ramp_up_unit_flow` - - > **Math symbol:** ``v_{nonspin\_ramp\_up\_unit\_flow} `` - - > **Indices:** (unit=u, node=n, direction=d, stochastic_scenario=s, t=t) - - > **Indices function:** nonspin\_ramp\_up\_unit\_flow\_indices - -Non-spinning upward reserve commodity flows of unit ``u`` at node ``n`` in the direction ``d`` for the stochastic scenario ``s`` at timestep ``t`` - -## `nonspin_units_shut_down` - - > **Math symbol:** ``v_{nonspin\_units\_shut\_down} `` - - > **Indices:** (unit=u, node=n, stochastic_scenario=s, t=t) - - > **Indices function:** nonspin\_units\_shut\_down\_indices - -Number of units ``u`` held available for non-spinning downward reserve provision via shutdown to node ``n`` for the stochastic scenario ``s`` at timestep ``t`` - -## `nonspin_units_started_up` - - > **Math symbol:** ``v_{nonspin\_units\_started\_up} `` - - > **Indices:** (unit=u, node=n, stochastic_scenario=s, t=t) - - > **Indices function:** nonspin\_units\_started\_up\_indices - -Number of units ``u`` held available for non-spinning upward reserve provision via startup to node ``n`` for the stochastic scenario ``s`` at timestep ``t`` - -## `ramp_down_unit_flow` - - > **Math symbol:** ``v_{ramp\_down\_unit\_flow} `` - - > **Indices:** (unit=u, node=n, direction=d, stochastic_scenario=s, t=t) - - > **Indices function:** ramp\_down\_unit\_flow\_indices - -Spinning downward ramp commodity flow associated with node ``n`` of unit ``u`` with node ``n`` over the connection ``conn`` in the direction ``d`` for the stochastic scenario ``s`` at timestep ``t`` - -## `ramp_up_unit_flow` - - > **Math symbol:** ``v_{ramp\_up\_unit\_flow} `` - - > **Indices:** (unit=u, node=n, direction=d, stochastic_scenario=s, t=t) - - > **Indices function:** ramp\_up\_unit\_flow\_indices - -Spinning upward ramp commodity flow associated with node ``n`` of unit ``u`` with node ``n`` over the connection ``conn`` in the direction ``d`` for the stochastic scenario ``s`` at timestep ``t`` - -## `shut_down_unit_flow` - - > **Math symbol:** ``v_{shut\_down\_unit\_flow} `` - - > **Indices:** (unit=u, node=n, direction=d, stochastic_scenario=s, t=t) - - > **Indices function:** shut\_down\_unit\_flow\_indices - -Downward ramp commodity flow during shutdown associated with node ``n`` of unit ``u`` with node ``n`` over the connection ``conn`` in the direction ``d`` for the stochastic scenario ``s`` at timestep ``t`` - -## `start_up_unit_flow` - - > **Math symbol:** ``v_{start\_up\_unit\_flow} `` - - > **Indices:** (unit=u, node=n, direction=d, stochastic_scenario=s, t=t) - - > **Indices function:** start\_up\_unit\_flow\_indices - -Upward ramp commodity flow during start-up associated with node ``n`` of unit ``u`` with node ``n`` over the connection ``conn`` in the direction ``d`` for the stochastic scenario ``s`` at timestep ``t`` - -## `storages_decommissioned` - - > **Math symbol:** ``v_{storages\_decommissioned} `` - - > **Indices:** (node=n, stochastic_scenario=s, t=t) - - > **Indices function:** storages\_invested\_available\_indices - -Number of decomissioned storage nodes ``n`` for the stochastic scenario ``s`` at timestep ``t`` - -## `storages_invested` - - > **Math symbol:** ``v_{storages\_invested} `` - - > **Indices:** (node=n, stochastic_scenario=s, t=t) - - > **Indices function:** storages\_invested\_available\_indices - -Number of storage nodes `` n`` invested in at timestep ``t`` for the stochastic scenario ``s`` - -## `storages_invested_available` - - > **Math symbol:** ``v_{storages\_invested\_available} `` - - > **Indices:** (node=n, stochastic_scenario=s, t=t) - - > **Indices function:** storages\_invested\_available\_indices - -Number of invested storage nodes ``n`` that are available still the stochastic scenario ``s`` at timestep ``t`` - -## `unit_flow` - - > **Math symbol:** ``v_{unit\_flow} `` - - > **Indices:** (unit=u, node=n, direction=d, stochastic_scenario=s, t=t) - - > **Indices function:** unit\_flow\_indices - -Commodity flow associated with node ``n`` over the unit ``u`` in the direction ``d`` for the stochastic scenario ``s`` at timestep ``t`` - -## `unit_flow_op` - - > **Math symbol:** ``v_{unit\_flow\_op} `` - - > **Indices:** (unit=u, node=n, direction=d, i=i, stochastic_scenario=s, t=t) - - > **Indices function:** unit\_flow\_op\_indices - -Contribution of the unit flow assocaited with operating point i - -## `units_available` - - > **Math symbol:** ``v_{units\_available} `` - - > **Indices:** (unit=u, stochastic_scenario=s, t=t) - - > **Indices function:** units\_on\_indices - -Number of available units ``u`` for the stochastic scenario ``s`` at timestep ``t`` - -## `units_invested` - - > **Math symbol:** ``v_{units\_invested} `` - - > **Indices:** (unit=u, stochastic_scenario=s, t=t) - - > **Indices function:** units\_invested\_available\_indices - -Number of units ``u`` for the stochastic scenario ``s`` invested in at timestep ``t`` - -## `units_invested_available` - - > **Math symbol:** ``v_{units\_invested\_available} `` - - > **Indices:** (unit=u, stochastic_scenario=s, t=t) - - > **Indices function:** units\_invested\_available\_indices - -Number of invested units ``u`` that are available still the stochastic scenario ``s`` at timestep ``t`` - -## `units_mothballed` - - > **Math symbol:** ``v_{units\_mothballed} `` - - > **Indices:** (unit=u, stochastic_scenario=s, t=t) - - > **Indices function:** units\_invested\_available\_indices - -Number of units ``u`` for the stochastic scenariocenario ``s`` mothballed at timestep ``t`` - -## `units_on` - - > **Math symbol:** ``v_{units\_on} `` - - > **Indices:** (unit=u, stochastic_scenario=s, t=t) - - > **Indices function:** units\_on\_indices - -Number of online units ``u`` for the stochastic scenario ``s`` at timestep ``t`` - -## `units_shut_down` - - > **Math symbol:** ``v_{units\_shut\_down} `` - - > **Indices:** (unit=u, stochastic_scenario=s, t=t) - - > **Indices function:** units\_on\_indices - -Number of units ``u`` for the stochastic scenario ``s`` that switched to offline status at timestep ``t`` - -## `units_started_up` - - > **Math symbol:** ``v_{units\_started\_up} `` - - > **Indices:** (unit=u, stochastic_scenario=s, t=t) - - > **Indices function:** units\_on\_indices - -Number of units ``u`` for the stochastic scenario ``s`` that switched to online status at timestep ``t`` diff --git a/docs/src/mathematical_formulation/write_documentation_sets_and_variables.jl b/docs/src/mathematical_formulation/write_documentation_sets_and_variables.jl deleted file mode 100644 index 45da67935a..0000000000 --- a/docs/src/mathematical_formulation/write_documentation_sets_and_variables.jl +++ /dev/null @@ -1,31 +0,0 @@ -using CSV -using DataFrames - -function write_documentation_sets_variables() - variables = DataFrame(CSV.File("$(@__DIR__)/variables.csv")) - variables[:variable_name_latex] = replace.(variables.variable_name, r"_" => "\\_") - variables.variable_name_latex .= "``v_{" .* variables.variable_name_latex .* "} ``" - variables.indices .= replace.(variables.indices, r"_" => "\\_") - variable_string = "# Variables \n" - for i in 1:size(variables, 1) - variable_string = string(variable_string, "## `$(variables.variable_name[i])` \n\n") - variable_string = string(variable_string, " > **Math symbol:** $(variables.variable_name_latex[i]) \n\n") - variable_string = string(variable_string, " > **Indices:** $(variables.index[i]) \n\n") - variable_string = string(variable_string, " > **Indices function:** $(variables.indices[i]) \n\n") - variable_string = string(variable_string, "$(variables.description[i]) \n\n") - end - sets = dropmissing(DataFrame(CSV.File("$(@__DIR__)/sets.csv"))) - set_string = "# Sets \n" - for i in 1:size(sets, 1) - set_string = string(set_string, "## `$(sets.indices[i])` \n\n") - set_string = string(set_string, "$(sets.Description[i]) \n\n") - end - - io = open("$(@__DIR__)/variables.md", "w") - write(io, variable_string) - close(io) - - io = open("$(@__DIR__)/sets.md", "w") - write(io, set_string) - close(io) -end diff --git a/src/SpineOpt.jl b/src/SpineOpt.jl index 0c363dc595..f323b3ddb4 100644 --- a/src/SpineOpt.jl +++ b/src/SpineOpt.jl @@ -56,7 +56,6 @@ export @fetch include("util/misc.jl") include("util/write_information_files.jl") -include("util/docs_utils.jl") include("util/promise.jl") include("run_spineopt.jl") include("generate_forced_availability_factor.jl") diff --git a/test/runtests.jl b/test/runtests.jl index 4b1f29d38f..3b639c66a8 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -108,7 +108,6 @@ end include("constraints/constraint_investment_group.jl") include("objective/objective.jl") include("util/misc.jl") - include("util/docs_utils.jl") include("run_spineopt.jl") include("run_spineopt_benders.jl") end diff --git a/test/util/docs_utils.jl b/test/util/docs_utils.jl deleted file mode 100644 index 04a4962ccd..0000000000 --- a/test/util/docs_utils.jl +++ /dev/null @@ -1,47 +0,0 @@ -############################################################################# -# Copyright (C) 2017 - 2018 Spine Project -# -# This file is part of SpineOpt. -# -# SpineOpt is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# SpineOpt is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program. If not, see . -############################################################################# - -@testset "docs_utils" begin - default_translation = Dict( - ["relationship_classes"] => "Relationship Classes", - ["parameter_value_lists"] => "Parameter Value Lists", - ["object_parameters", "relationship_parameters"] => "Parameters", - ["object_classes"] => "Object Classes", - ) - concept_dictionary = SpineOpt.initialize_concept_dictionary(SpineOpt.template(); translation=default_translation) - @test Set(keys(concept_dictionary)) == Set(values(default_translation)) - concept_dictionary = SpineOpt.add_cross_references!(concept_dictionary) - @test Set(keys(concept_dictionary)) == Set(values(default_translation)) - path = mktempdir() - cpt_ref_path = joinpath(path, "src", "concept_reference") - mkpath(cpt_ref_path) - for (filename, concepts) in concept_dictionary - # Loop over the unique names and write their information into the filename under a dedicated section. - for concept in unique!(collect(keys(concepts))) - description_path = joinpath(cpt_ref_path, "$(concept).md") - write(description_path, "\n\n") - end - end - @test SpineOpt.write_concept_reference_files(concept_dictionary, path) == 0 - - pages = ["Util" => []] - testpages = ["Util" => Any["Docs utils" => joinpath("util", "docs_utils.md")]] - SpineOpt.populate_empty_chapters!(pages, dirname(@__DIR__)) - @test pages == testpages -end \ No newline at end of file diff --git a/test/util/docs_utils.md b/test/util/docs_utils.md deleted file mode 100644 index 222c233e9f..0000000000 --- a/test/util/docs_utils.md +++ /dev/null @@ -1 +0,0 @@ -This is a testfile corresponding to the unit test for the drag_and_drop function in docs_utils.jl \ No newline at end of file