Skip to content

Commit 791cc98

Browse files
authored
Merge pull request #4 from ModiaSim/dev
Improvements
2 parents d4f7c6b + d77722a commit 791cc98

16 files changed

+2124
-31
lines changed

.github/workflows/test.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Run tests
2+
3+
env:
4+
JULIA_NUM_THREADS: 4
5+
on:
6+
pull_request:
7+
branches:
8+
- main
9+
jobs:
10+
test:
11+
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
version:
17+
- '1.7.3'
18+
os:
19+
- ubuntu-latest
20+
- windows-latest
21+
arch:
22+
- x64
23+
steps:
24+
- uses: actions/checkout@v2
25+
- uses: julia-actions/setup-julia@v1
26+
with:
27+
version: ${{ matrix.version }}
28+
arch: ${{ matrix.arch }}
29+
- uses: actions/cache@v1
30+
env:
31+
cache-name: cache-artifacts
32+
with:
33+
path: ~/.julia/artifacts
34+
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
35+
restore-keys: |
36+
${{ runner.os }}-test-${{ env.cache-name }}-
37+
${{ runner.os }}-test-
38+
${{ runner.os }}-
39+
- uses: julia-actions/julia-buildpkg@v1
40+
- uses: julia-actions/julia-runtest@v1

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "SignalTables"
22
uuid = "3201582d-3078-4276-ba5d-0a1254d79d7c"
33
authors = ["Martin.Otter@dlr.de <Martin.Otter@dlr.de>"]
4-
version = "0.3.4"
4+
version = "0.3.5"
55

66
[deps]
77
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Binary file not shown.

docs/src/index.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,16 @@ are different to the Python 2.x version.
187187

188188
## Release Notes
189189

190+
### Version 0.3.5
191+
192+
- @usingPlotPackage(): If SilentNoPlot selected, use "using SignalTables.SilentNoPlot" instead of "import SignalTables.SilentNoPlot: plot ..:".
193+
- writeSignalTable(..): Arrays get an additional key `layout = "column-major"` to clearly define that storage is in column-major order.
194+
Furthermore, if a signal has an *alias* key, then the *values* or *value* array is not stored on file.
195+
196+
**Bug fixes**
197+
198+
- writeSignalTable(..): If arrays or numbers have Unitful units, these units are stripped off and provided via key `unit` as a string.
199+
190200
### Version 0.3.4
191201

192202
- Bug fix in usePreviousPlotPackage()

examples/fileIO/CSV_ReadFromFile.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module CSV_ReadFromFile
2+
3+
using SignalTables
4+
import CSV
5+
6+
file = joinpath(SignalTables.path, "examples", "fileIO", "Rotational_First.csv")
7+
println("\n... Read csv file \"$file\"")
8+
sigTable = CSV.File(file)
9+
10+
println("\n... Show csv file as signal table")
11+
showInfo(sigTable)
12+
13+
println("\ntime[1:10] = ", getSignal(sigTable, "time")[:values][1:10])
14+
15+
end

examples/fileIO/JSON_WriteToFile.jl

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
module JSON_WriteToFile
22

3-
using SignalTables
4-
import JSON
3+
using SignalTables
54

65
sigTable = getSignalTableExample("VariousTypes")
7-
8-
open("VariousTypes_prettyPrint.json", "w") do io
9-
JSON.print(io, sigTable, 2)
10-
end
11-
12-
open("VariousTypes_compact.json", "w") do io
13-
JSON.print(io, sigTable)
14-
end
6+
writeSignalTable("VariousTypes_prettyPrint.json", sigTable; indent=2, log=true)
7+
writeSignalTable("VariousTypes_compact.json" , sigTable)
158

169
end

examples/fileIO/JSON_WriteToString.jl

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
module JSON_WriteToString
22

3-
using SignalTables
4-
import JSON
3+
using SignalTables
54

6-
sigTable = getSignalTableExample("VariousTypes")
7-
str = JSON.json(sigTable)
8-
9-
println("VariousType string = \n", str)
5+
str = signalTableToJSON( getSignalTableExample("VariousTypes") )
6+
println(str)
107

118
end

examples/fileIO/Rotational_First.csv

Lines changed: 2003 additions & 0 deletions
Large diffs are not rendered by default.

examples/fileIO/_include_all.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
include("JSON_WriteToFile.jl")
3+
include("JSON_WriteToString.jl")
4+

src/ExampleSignalTables.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ elseif signalTableName == "VariousTypes"
129129
"time" => Var(values= t, unit="s", independent=true),
130130
"load.r" => Var(values= [sin.(t) cos.(t) sin.(t)], unit="m"),
131131
"motor.angle" => Var(values= sin.(t), unit="rad", state=true, der="motor.w"),
132-
"motor.w" => Var(values= cos.(t), unit="rad/s"),
132+
"motor.w" => Var(values= cos.(t), unit="rad/s", state=true, start=1.0u"rad/s"),
133133
"motor.w_ref" => Var(values= 0.9*[sin.(t) cos.(t)], unit = ["rad", "1/s"],
134134
info="Reference angle and speed"),
135135
"wm" => Var(alias = "motor.w"),

0 commit comments

Comments
 (0)