Repository navigation
Add test job to test the coupling of Base Modelica export and ModellingToolkit.jl #117
Description
Activity
The package is here : https://github.com/SciML/BaseModelica.jl
It's pretty rudimentary at this point, I would only expect it to work on the most basic models at this point. But it would be nice to have a testsuite to use as a target!
Thanks @jClugstor!
@adrpo, the ball is in your field 😃
I'll have a look at it asap.
Thanks @adrpo. I think this could be a good starting point for a nice paper at the next EOOLT workshop 😃
I'll start working on it. First I need to catch up on how to use MTK again.
Reacted by Francesco CasellaI guess I need to pre-compile my script with PackageCompiler.jl or keep a Julia session open for all tests.
TTFP (Time To First Plot) is hitting hard when running a single test in a freshly started Julia environment 😆julia> @time run_test(joinpath("examples", "ExampleFirstOrder.mo"); settings = test_settings) 32.797305 seconds (75.30 M allocations: 3.903 GiB, 6.01% gc time, 99.70% compilation time: 29% of which was recompilation) "ExampleFirstOrder/ExampleFirstOrder_res.csv" julia> @time run_test(joinpath("examples", "ExampleFirstOrder.mo"); settings = test_settings) 0.034173 seconds (93.38 k allocations: 13.376 MiB) "ExampleFirstOrder/ExampleFirstOrder_res.csv"
I can now run the testsuite localy with Base Modelica export and BaseModelica.jl import. I need to polish it a bit, install Julia on our test servers and we can start a first run to see how it goes. It's terribly slow, but for a first run on just the MSL we can endure it.
PackageCompiler.jl crashes on my machine or never finishes. Leaving open a Julia process doesn't integrate well with our Python-based workflow. Maybe precompiling on one of our servers actually work. @adrpo maybe we can try this when the Modelica conference is done.
Looks like all tests are failing.
//! base 0.1.0 package 'FilterWithRiseTime' function 'Modelica.Blocks.Continuous.Internal.Filter.Utilities.toHighestPowerOne' "Transform filter to form with highest power of s equal 1" input Real[:] 'den1'; input Real[:, 2] 'den2'; output Real[size('den1', 1)] 'cr'; output Real[size('den2', 1)] 'c0'; output Real[size('den2', 1)] 'c1'; algorithm for 'i' in 1:size('den1', 1) loop 'cr'['i'] := 1.0 / 'den1'['i']; end for; for 'i' in 1:size('den2', 1) loop 'c1'['i'] := 'den2'['i',2] / 'den2'['i',1]; 'c0'['i'] := 1.0 / 'den2'['i',1]; end for; end 'Modelica.Blocks.Continuous.Internal.Filter.Utilities.toHighestPowerOne'; function 'Modelica.Blocks.Continuous.Internal.Filter.base.CriticalDamping' "Return base filter coefficients of CriticalDamping filter (= low pass filter with w_cut = 1 rad/s)" input Integer 'order'(min = 1); input Boolean 'normalized' = true; output Real['order'] 'cr'; Real 'alpha' = 1.0; Real 'alpha2'; Real['order'] 'den1'; Real[0, 2] 'den2'; Real[0] 'c0'; Real[0] 'c1'; algorithm if 'normalized' then 'alpha' := sqrt(10.0 ^ (0.3 / 'order') - 1.0); elseif true then 'alpha' := 1.0; end if; for 'i' in 1:'order' loop 'den1'['i'] := 'alpha'; end for; ('cr', , ) := 'Modelica.Blocks.Continuous.Internal.Filter.Utilities.toHighestPowerOne'('den1', fill(0.0, 0, 2)); end 'Modelica.Blocks.Continuous.Internal.Filter.base.CriticalDamping'; function 'Modelica.Blocks.Continuous.Internal.Filter.coefficients.lowPass' "Return low pass filter coefficients at given cut-off frequency" input Real[:] 'cr_in'; input Real[:] 'c0_in'; input Real[size('c0_in', 1)] 'c1_in'; input Real 'f_cut'(unit = "Hz", quantity = "Frequency"); output Real[size('cr_in', 1)] 'cr'; output Real[size('c0_in', 1)] 'c0'; output Real[size('c0_in', 1)] 'c1'; Real 'w_cut'(unit = "rad/s", quantity = "AngularVelocity") = 6.283185307179586 * 'f_cut'; Real 'w_cut2' = 'w_cut' * 'w_cut'; algorithm assert('f_cut' > 0.0, "Cut-off frequency f_cut must be positive", AssertionLevel.error); 'cr' := 'w_cut' * 'cr_in'; 'c1' := 'w_cut' * 'c1_in'; 'c0' := 'w_cut2' * 'c0_in'; end 'Modelica.Blocks.Continuous.Internal.Filter.coefficients.lowPass'; function 'Modelica.Blocks.Continuous.Internal.Filter.roots.lowPass' "Return low pass filter roots as needed for block for given cut-off frequency" input Real[:] 'cr_in'; input Real[:] 'c0_in'; input Real[size('c0_in', 1)] 'c1_in'; input Real 'f_cut'(unit = "Hz", quantity = "Frequency"); output Real[size('cr_in', 1)] 'r'; output Real[size('c0_in', 1)] 'a'; output Real[size('c0_in', 1)] 'b'; output Real[size('c0_in', 1)] 'ku'; Real[size('c0_in', 1)] 'c0'; Real[size('c0_in', 1)] 'c1'; Real[size('cr_in', 1)] 'cr'; algorithm ('cr', 'c0', 'c1') := 'Modelica.Blocks.Continuous.Internal.Filter.coefficients.lowPass'('cr_in', 'c0_in', 'c1_in', 'f_cut'); for 'i' in 1:size('cr_in', 1) loop 'r'['i'] := -'cr'['i']; end for; for 'i' in 1:size('c0_in', 1) loop 'a'['i'] := -'c1'['i'] / 2.0; 'b'['i'] := sqrt('c0'['i'] - 'a'['i'] * 'a'['i']); 'ku'['i'] := 'c0'['i'] / 'b'['i']; end for; end 'Modelica.Blocks.Continuous.Internal.Filter.roots.lowPass'; type 'Modelica.Blocks.Types.AnalogFilter' = enumeration('CriticalDamping', 'Bessel', 'Butterworth', 'ChebyshevI'); type 'Modelica.Blocks.Types.FilterType' = enumeration('LowPass', 'HighPass', 'BandPass', 'BandStop'); type 'Modelica.Blocks.Types.Init' = enumeration('NoInit', 'SteadyState', 'InitialState', 'InitialOutput'); model 'FilterWithRiseTime' "Demonstrates to use the rise time instead of the cut-off frequency to define a filter" final parameter Integer 'order' = 2 "Filter order"; parameter Real 'riseTime'(unit = "s", quantity = "Time") = 2.0 "Time to reach the step input"; Real 'filter_fac5.u' "Connector of Real input signal"; Real 'filter_fac5.y' "Connector of Real output signal"; final parameter 'Modelica.Blocks.Types.AnalogFilter' 'filter_fac5.analogFilter' = 'Modelica.Blocks.Types.AnalogFilter'.'CriticalDamping' "Analog filter characteristics (CriticalDamping/Bessel/Butterworth/ChebyshevI)"; final parameter 'Modelica.Blocks.Types.FilterType' 'filter_fac5.filterType' = 'Modelica.Blocks.Types.FilterType'.'LowPass' "Type of filter (LowPass/HighPass/BandPass/BandStop)"; final parameter Integer 'filter_fac5.order'(min = 1) = 2 "Order of filter"; parameter Real 'filter_fac5.f_cut'(unit = "Hz", quantity = "Frequency") = 5.0 / (6.283185307179586 * 'riseTime') "Cut-off frequency"; parameter Real 'filter_fac5.gain' = 1.0 "Gain (= amplitude of frequency response at zero frequency)"; parameter Real 'filter_fac5.A_ripple'(unit = "dB") = 0.5 "Pass band ripple for Chebyshev filter (otherwise not used); > 0 required"; parameter Real 'filter_fac5.f_min'(unit = "Hz", quantity = "Frequency") = 0.0 "Band of band pass/stop filter is f_min (A=-3db*gain) .. f_cut (A=-3db*gain)"; parameter Boolean 'filter_fac5.normalized' = true "= true, if amplitude at f_cut = -3db, otherwise unmodified filter"; final parameter 'Modelica.Blocks.Types.Init' 'filter_fac5.init' = 'Modelica.Blocks.Types.Init'.'SteadyState' "Type of initialization (no init/steady state/initial state/initial output)" annotation(Evaluate = true); final parameter Integer 'filter_fac5.nx' = 2; parameter Real[2] 'filter_fac5.x_start' = {0.0, 0.0} "Initial or guess values of states"; parameter Real 'filter_fac5.y_start' = 0.0 "Initial value of output"; parameter Real 'filter_fac5.u_nominal' = 1.0 "Nominal value of input (used for scaling the states)"; Real[2] 'filter_fac5.x' "Filter states"; final parameter Integer 'filter_fac5.ncr' = 2; final parameter Integer 'filter_fac5.nc0' = 0; final parameter Integer 'filter_fac5.na' = 0; final parameter Integer 'filter_fac5.nr' = 2; parameter Real[2] 'filter_fac5.cr'(each fixed = false); parameter Real[0] 'filter_fac5.c0'(each fixed = false); parameter Real[0] 'filter_fac5.c1'(each fixed = false); parameter Real[2] 'filter_fac5.r'(each fixed = false); parameter Real[0] 'filter_fac5.a'(each fixed = false); parameter Real[0] 'filter_fac5.b'(each fixed = false); parameter Real[0] 'filter_fac5.ku'(each fixed = false); parameter Real[0] 'filter_fac5.k1'(each fixed = false); parameter Real[0] 'filter_fac5.k2'(each fixed = false); Real[3] 'filter_fac5.uu'; parameter Real 'step.height' = 1.0 "Height of step"; Real 'step.y' "Connector of Real output signal"; parameter Real 'step.offset' = 0.0 "Offset of output signal y"; parameter Real 'step.startTime'(unit = "s", quantity = "Time") = 1.0 "Output y = offset for time < startTime"; Real 'filter_fac4.u' "Connector of Real input signal"; Real 'filter_fac4.y' "Connector of Real output signal"; final parameter 'Modelica.Blocks.Types.AnalogFilter' 'filter_fac4.analogFilter' = 'Modelica.Blocks.Types.AnalogFilter'.'CriticalDamping' "Analog filter characteristics (CriticalDamping/Bessel/Butterworth/ChebyshevI)"; final parameter 'Modelica.Blocks.Types.FilterType' 'filter_fac4.filterType' = 'Modelica.Blocks.Types.FilterType'.'LowPass' "Type of filter (LowPass/HighPass/BandPass/BandStop)"; final parameter Integer 'filter_fac4.order'(min = 1) = 2 "Order of filter"; parameter Real 'filter_fac4.f_cut'(unit = "Hz", quantity = "Frequency") = 4.0 / (6.283185307179586 * 'riseTime') "Cut-off frequency"; parameter Real 'filter_fac4.gain' = 1.0 "Gain (= amplitude of frequency response at zero frequency)"; parameter Real 'filter_fac4.A_ripple'(unit = "dB") = 0.5 "Pass band ripple for Chebyshev filter (otherwise not used); > 0 required"; parameter Real 'filter_fac4.f_min'(unit = "Hz", quantity = "Frequency") = 0.0 "Band of band pass/stop filter is f_min (A=-3db*gain) .. f_cut (A=-3db*gain)"; parameter Boolean 'filter_fac4.normalized' = true "= true, if amplitude at f_cut = -3db, otherwise unmodified filter"; final parameter 'Modelica.Blocks.Types.Init' 'filter_fac4.init' = 'Modelica.Blocks.Types.Init'.'SteadyState' "Type of initialization (no init/steady state/initial state/initial output)" annotation(Evaluate = true); final parameter Integer 'filter_fac4.nx' = 2; parameter Real[2] 'filter_fac4.x_start' = {0.0, 0.0} "Initial or guess values of states"; parameter Real 'filter_fac4.y_start' = 0.0 "Initial value of output"; parameter Real 'filter_fac4.u_nominal' = 1.0 "Nominal value of input (used for scaling the states)"; Real[2] 'filter_fac4.x' "Filter states"; final parameter Integer 'filter_fac4.ncr' = 2; final parameter Integer 'filter_fac4.nc0' = 0; final parameter Integer 'filter_fac4.na' = 0; final parameter Integer 'filter_fac4.nr' = 2; parameter Real[2] 'filter_fac4.cr'(each fixed = false); parameter Real[0] 'filter_fac4.c0'(each fixed = false); parameter Real[0] 'filter_fac4.c1'(each fixed = false); parameter Real[2] 'filter_fac4.r'(each fixed = false); parameter Real[0] 'filter_fac4.a'(each fixed = false); parameter Real[0] 'filter_fac4.b'(each fixed = false); parameter Real[0] 'filter_fac4.ku'(each fixed = false); parameter Real[0] 'filter_fac4.k1'(each fixed = false); parameter Real[0] 'filter_fac4.k2'(each fixed = false); Real[3] 'filter_fac4.uu'; Real 'filter_fac3.u' "Connector of Real input signal"; Real 'filter_fac3.y' "Connector of Real output signal"; final parameter 'Modelica.Blocks.Types.AnalogFilter' 'filter_fac3.analogFilter' = 'Modelica.Blocks.Types.AnalogFilter'.'CriticalDamping' "Analog filter characteristics (CriticalDamping/Bessel/Butterworth/ChebyshevI)"; final parameter 'Modelica.Blocks.Types.FilterType' 'filter_fac3.filterType' = 'Modelica.Blocks.Types.FilterType'.'LowPass' "Type of filter (LowPass/HighPass/BandPass/BandStop)"; final parameter Integer 'filter_fac3.order'(min = 1) = 2 "Order of filter"; parameter Real 'filter_fac3.f_cut'(unit = "Hz", quantity = "Frequency") = 3.0 / (6.283185307179586 * 'riseTime') "Cut-off frequency"; parameter Real 'filter_fac3.gain' = 1.0 "Gain (= amplitude of frequency response at zero frequency)"; parameter Real 'filter_fac3.A_ripple'(unit = "dB") = 0.5 "Pass band ripple for Chebyshev filter (otherwise not used); > 0 required"; parameter Real 'filter_fac3.f_min'(unit = "Hz", quantity = "Frequency") = 0.0 "Band of band pass/stop filter is f_min (A=-3db*gain) .. f_cut (A=-3db*gain)"; parameter Boolean 'filter_fac3.normalized' = true "= true, if amplitude at f_cut = -3db, otherwise unmodified filter"; final parameter 'Modelica.Blocks.Types.Init' 'filter_fac3.init' = 'Modelica.Blocks.Types.Init'.'SteadyState' "Type of initialization (no init/steady state/initial state/initial output)" annotation(Evaluate = true); final parameter Integer 'filter_fac3.nx' = 2; parameter Real[2] 'filter_fac3.x_start' = {0.0, 0.0} "Initial or guess values of states"; parameter Real 'filter_fac3.y_start' = 0.0 "Initial value of output"; parameter Real 'filter_fac3.u_nominal' = 1.0 "Nominal value of input (used for scaling the states)"; Real[2] 'filter_fac3.x' "Filter states"; final parameter Integer 'filter_fac3.ncr' = 2; final parameter Integer 'filter_fac3.nc0' = 0; final parameter Integer 'filter_fac3.na' = 0; final parameter Integer 'filter_fac3.nr' = 2; parameter Real[2] 'filter_fac3.cr'(each fixed = false); parameter Real[0] 'filter_fac3.c0'(each fixed = false); parameter Real[0] 'filter_fac3.c1'(each fixed = false); parameter Real[2] 'filter_fac3.r'(each fixed = false); parameter Real[0] 'filter_fac3.a'(each fixed = false); parameter Real[0] 'filter_fac3.b'(each fixed = false); parameter Real[0] 'filter_fac3.ku'(each fixed = false); parameter Real[0] 'filter_fac3.k1'(each fixed = false); parameter Real[0] 'filter_fac3.k2'(each fixed = false); Real[3] 'filter_fac3.uu'; initial equation 'filter_fac5.cr' = 'Modelica.Blocks.Continuous.Internal.Filter.base.CriticalDamping'(2, 'filter_fac5.normalized'); ('filter_fac5.r', , , ) = 'Modelica.Blocks.Continuous.Internal.Filter.roots.lowPass'('filter_fac5.cr', fill(0.0, 0), fill(0.0, 0), 'filter_fac5.f_cut'); der('filter_fac5.x') = {0.0, 0.0}; 'filter_fac4.cr' = 'Modelica.Blocks.Continuous.Internal.Filter.base.CriticalDamping'(2, 'filter_fac4.normalized'); ('filter_fac4.r', , , ) = 'Modelica.Blocks.Continuous.Internal.Filter.roots.lowPass'('filter_fac4.cr', fill(0.0, 0), fill(0.0, 0), 'filter_fac4.f_cut'); der('filter_fac4.x') = {0.0, 0.0}; 'filter_fac3.cr' = 'Modelica.Blocks.Continuous.Internal.Filter.base.CriticalDamping'(2, 'filter_fac3.normalized'); ('filter_fac3.r', , , ) = 'Modelica.Blocks.Continuous.Internal.Filter.roots.lowPass'('filter_fac3.cr', fill(0.0, 0), fill(0.0, 0), 'filter_fac3.f_cut'); der('filter_fac3.x') = {0.0, 0.0}; equation 'step.y' = 'filter_fac3.u'; 'step.y' = 'filter_fac4.u'; 'step.y' = 'filter_fac5.u'; assert('filter_fac5.u_nominal' > 0.0, "u_nominal > 0 required", AssertionLevel.error); assert('filter_fac5.A_ripple' > 0.0, "A_ripple > 0 required", AssertionLevel.error); assert('filter_fac5.f_cut' > 0.0, "f_cut > 0 required", AssertionLevel.error); 'filter_fac5.uu'[1] = 'filter_fac5.u' / 'filter_fac5.u_nominal'; der('filter_fac5.x'[1]) = 'filter_fac5.r'[1] * ('filter_fac5.x'[1] - 'filter_fac5.uu'[1]); der('filter_fac5.x'[2]) = 'filter_fac5.r'[2] * ('filter_fac5.x'[2] - 'filter_fac5.uu'[2]); 'filter_fac5.uu'[2] = 'filter_fac5.x'[1]; 'filter_fac5.uu'[3] = 'filter_fac5.x'[2]; 'filter_fac5.y' = 'filter_fac5.gain' * 'filter_fac5.u_nominal' * 'filter_fac5.uu'[3]; 'step.y' = 'step.offset' + (if time < 'step.startTime' then 0.0 else 'step.height'); assert('filter_fac4.u_nominal' > 0.0, "u_nominal > 0 required", AssertionLevel.error); assert('filter_fac4.A_ripple' > 0.0, "A_ripple > 0 required", AssertionLevel.error); assert('filter_fac4.f_cut' > 0.0, "f_cut > 0 required", AssertionLevel.error); 'filter_fac4.uu'[1] = 'filter_fac4.u' / 'filter_fac4.u_nominal'; der('filter_fac4.x'[1]) = 'filter_fac4.r'[1] * ('filter_fac4.x'[1] - 'filter_fac4.uu'[1]); der('filter_fac4.x'[2]) = 'filter_fac4.r'[2] * ('filter_fac4.x'[2] - 'filter_fac4.uu'[2]); 'filter_fac4.uu'[2] = 'filter_fac4.x'[1]; 'filter_fac4.uu'[3] = 'filter_fac4.x'[2]; 'filter_fac4.y' = 'filter_fac4.gain' * 'filter_fac4.u_nominal' * 'filter_fac4.uu'[3]; assert('filter_fac3.u_nominal' > 0.0, "u_nominal > 0 required", AssertionLevel.error); assert('filter_fac3.A_ripple' > 0.0, "A_ripple > 0 required", AssertionLevel.error); assert('filter_fac3.f_cut' > 0.0, "f_cut > 0 required", AssertionLevel.error); 'filter_fac3.uu'[1] = 'filter_fac3.u' / 'filter_fac3.u_nominal'; der('filter_fac3.x'[1]) = 'filter_fac3.r'[1] * ('filter_fac3.x'[1] - 'filter_fac3.uu'[1]); der('filter_fac3.x'[2]) = 'filter_fac3.r'[2] * ('filter_fac3.x'[2] - 'filter_fac3.uu'[2]); 'filter_fac3.uu'[2] = 'filter_fac3.x'[1]; 'filter_fac3.uu'[3] = 'filter_fac3.x'[2]; 'filter_fac3.y' = 'filter_fac3.gain' * 'filter_fac3.u_nominal' * 'filter_fac3.uu'[3]; annotation(experiment(StopTime = 4)); end 'FilterWithRiseTime'; end 'FilterWithRiseTime';
julia Modelica.Blocks.Examples.PID_Controller_test.jl ERROR: LoadError: ParserCombinator.ParserException("cannot parse") Stacktrace: [1] once(channel::Channel{Any}) @ ParserCombinator ~/.julia/packages/ParserCombinator/kIa3L/src/core/parsers.jl:196 [2] single_result @ ~/.julia/packages/ParserCombinator/kIa3L/src/core/parsers.jl:201 [inlined] [3] (::ParserCombinator.var"#single_result#36"{ParserCombinator.var"#single_result#35#37"{@Kwargs{}, UnionAll}})(source::String, matcher::ParserCombinator.Transform) @ ParserCombinator ~/.julia/packages/ParserCombinator/kIa3L/src/core/parsers.jl:200 [4] parse_str(data::String) @ BaseModelica ~/.julia/packages/BaseModelica/qCG6a/src/parser.jl:603 [5] parse_file @ ~/.julia/packages/BaseModelica/qCG6a/src/parser.jl:610 [inlined] [6] parse_basemodelica(filename::String) @ BaseModelica ~/.julia/packages/BaseModelica/qCG6a/src/BaseModelica.jl:22 [7] macro expansion @ /[...]/OpenModelicaLibraryTesting/TestBaseModelica/src/TestBaseModelica.jl:23 [inlined] [8] macro expansion @ ./timing.jl:421 [inlined] [9] run_test(base_modelica_file::String; settings::TestSettings) @ TestBaseModelica /[...]/OpenModelicaLibraryTesting/TestBaseModelica/src/TestBaseModelica.jl:22 [10] top-level scope @ /[...]/OpenModelicaLibraryTesting/Modelica_4.1.0_Modelica.Blocks.Examples.PID_Controller/Modelica.Blocks.Examples.PID_Controller_test.jl:4 in expression starting at /[...]/OpenModelicaLibraryTesting/Modelica_4.1.0_Modelica.Blocks.Examples.PID_Controller/Modelica.Blocks.Examples.PID_Controller_test.jl:4A few comments
- I don't think that the current BaseModelica.jl handles Modelica functions
- Why should it be so slow to compile?
- Maybe you can start testing Modelica.Electrical.Analog.Examples. The ones without swiching, e.g. ChuaCircuit, should be straightforward once flattened.
9 remaining items
grep looks like a good idea to filter out the bulk of doomed models without too much effort. No need to be highly selective.
Okay, precompiling with PackageCompiler.jl is the way to go. It works fine on our server. Takes around 7 minutes, let's say 10 minuters to pre-compile. And then each call with the system image takes around 6 instead of 36 seconds 😲
I espesially like how the CI times out after an hour precompiling, so disabeling that as well.
The nightly test is broken, see #222.
I need to fixe that one the see if this is realy done.Let's see if the first run will finish: https://test.openmodelica.org/jenkins/blue/organizations/jenkins/LibraryTesting%2FLibraryTest/detail/LibraryTest/9962/pipeline
Okay, we now have our first test results for the MSL: https://libraries.openmodelica.org/branches/basemodelica_jl_master/
The test is started manually. You can write me and I can start a test job. If needed I can also run the test on a scedule.
All models are exported to Base Modelica and than usually the import fails with:
julia --sysimage=/var/lib/jenkins/ws/OpenModelicaLibraryTestingWork/OpenModelicaLibraryTesting/TestBaseModelica.so Modelica.Blocks.Examples.BooleanNetwork1_test.jl ERROR: LoadError: ParserCombinator.ParserException("cannot parse") Stacktrace: [1] once(channel::Channel{Any}) @ ParserCombinator ~/.julia/packages/ParserCombinator/kIa3L/src/core/parsers.jl:196 [2] single_result @ ~/.julia/packages/ParserCombinator/kIa3L/src/core/parsers.jl:201 [inlined] [3] (::ParserCombinator.var"#single_result#36"{ParserCombinator.var"#single_result#35#37"{@Kwargs{}, UnionAll}})(source::String, matcher::ParserCombinator.Transform) @ ParserCombinator ~/.julia/packages/ParserCombinator/kIa3L/src/core/parsers.jl:200 [4] parse_str(data::String) @ BaseModelica ~/.julia/packages/BaseModelica/VN8w7/src/parser.jl:610 [5] parse_file @ ~/.julia/packages/BaseModelica/VN8w7/src/parser.jl:617 [inlined] [6] parse_basemodelica(filename::String) @ BaseModelica ~/.julia/packages/BaseModelica/VN8w7/src/BaseModelica.jl:22 [7] macro expansion @ /var/lib/jenkins/ws/OpenModelicaLibraryTestingWork/OpenModelicaLibraryTesting/TestBaseModelica/src/TestBaseModelica.jl:23 [inlined] [8] macro expansion @ ./timing.jl:421 [inlined] [9] run_test(base_modelica_file::String; settings::TestSettings) @ TestBaseModelica /var/lib/jenkins/ws/OpenModelicaLibraryTestingWork/OpenModelicaLibraryTesting/TestBaseModelica/src/TestBaseModelica.jl:22 [10] top-level scope @ /var/lib/jenkins/ws/OpenModelicaLibraryTestingWork/OpenModelicaLibraryTesting/Modelica_4.1.0_Modelica.Blocks.Examples.BooleanNetwork1/Modelica.Blocks.Examples.BooleanNetwork1_test.jl:4 in expression starting at /var/lib/jenkins/ws/OpenModelicaLibraryTestingWork/OpenModelicaLibraryTesting/Modelica_4.1.0_Modelica.Blocks.Examples.BooleanNetwork1/Modelica.Blocks.Examples.BooleanNetwork1_test.jl:4
Looks like some tests timed out: Modelica.Electrical.Analog.Examples.ChuaCircuit (sim)
I guess that's mostly because the Julia system image wasn't build with the specific functions used in those examples. I'll update TestBaseModelica/precompile_skript.jl as soon as BaseModleica.jl can handle a few more models.
It's a pity that exception doesn't print the line/location it could not parse (as I would normally expect from Julia). Having to pull a file out of CI to check line 4 is probably quite annoying.
It's a pity that exception doesn't print the line/location it could not parse (as I would normally expect from Julia). Having to pull a file out of CI to check line 4 is probably quite annoying.
Is this a Julia issue, or an implementation issue on our side?
It's an issue from the parer (so Julia side). I opened an issue for it: SciML/BaseModelica.jl#45
Reacted by Francesco Casella@AnHeuermann could you also open an issue on the support of experiment annotation (or follow up the AI thing, I can't find it now)? Thanks!
It's an issue from the parer (so Julia side). I opened an issue for it: SciML/BaseModelica.jl#45
I'm assuming the problem is in https://github.com/andrewcooke/ParserCombinator.jl, because that is where the thrown exception comes from AFAICT. In any case, that package seems unmaintained, so BaseModelica.jl is probably the better place to raise it, in any case. :-P
@AnHeuermann could you also open an issue on the support of experiment annotation (or follow up the AI thing, I can't find it now)? Thanks!
I already did in SciML/BaseModelica.jl#38.
@jClugstor has successfully implemented a first version of Base Modelica import into ModellingTookit.jl. This has been tried on a few test cases, but we could actually try it on the entire library testsuite.
@jClugstor, can you please share the Julia code you wrote to run those tests, so we can generalize it and put it into our CI?
Thanks!