diff --git a/test/Untitled-1.ipynb b/test/Untitled-1.ipynb deleted file mode 100644 index bb912d0..0000000 --- a/test/Untitled-1.ipynb +++ /dev/null @@ -1,79 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [], - "source": [ - "using GamsStructure\n", - "using MacroTools" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Description: \n", - "Domain: (:i, :j)\n", - "\n" - ] - }, - { - "data": { - "text/plain": [] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[1.0 2.0; 3.0 4.0" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "]" - ] - } - ], - "source": [ - "GU = GamsUniverse()\n", - "@load_sets!(GU,\"test_data\",begin\n", - " :i,\"\"\n", - " :j,\"\"\n", - "end)\n", - "\n", - "@load_parameters!(GU,\"test_data\",begin\n", - " :p, (:i,:j), description => \"Hi\"\n", - " :p_,(:i,:j), file_name=>\"p copy.csv\",value_name=>:data\n", - "end)" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Julia 1.8.0", - "language": "julia", - "name": "julia-1.8" - }, - "language_info": { - "file_extension": ".jl", - "mimetype": "application/julia", - "name": "julia", - "version": "1.8.0" - }, - "orig_nbformat": 4 - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/test/activate.jl b/test/activate.jl index d360514..eca57df 100644 --- a/test/activate.jl +++ b/test/activate.jl @@ -1,24 +1,24 @@ @testset "Loading and unloading a model" begin GU = GamsUniverse() - @create_set!(GU,:i,"Test Set",begin - a,"elm" - b,"elm2" + @set(GU, i,"Test Set",begin + a, "elm" + b, "elm2" end) alias(GU,:i,:j) - @create_parameters(GU,begin - :p, (:i,:j), "test parm" + @parameters(GU,begin + p, (:i,:j), (description = "test parm",) end) deactivate(GU,:i,:a) - @create_parameters(GU,begin - :q, (:i,:j), "test parm" + @parameters(GU,begin + q, (:i,:j), (description = "test parm",) end) @test GU[:p][:i,:j] == [0 0] diff --git a/test/load_unload.jl b/test/load_unload.jl index 1357019..5a749a3 100644 --- a/test/load_unload.jl +++ b/test/load_unload.jl @@ -1,21 +1,21 @@ @testset "Loading and unloading a model" begin GU = GamsUniverse() - @create_set!(GU,:i,"Test Set",begin + @set(GU, I,"Test Set",begin a,"elm" b,"elm2" end) - alias(GU,:i,:j) + @alias(GU, I, J) - @create_parameters(GU,begin - :p, (:i,:j), "test parm" + @parameters(GU,begin + p, (:I,:J), (description = "test parm",) end) cnt = 1 - for i∈GU[:i],j∈GU[:j] - GU[:p][[i],[j]] = cnt + for i∈I,j∈J + p[i,j] = cnt cnt+=1 end