Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change reduce(vcat, itr) to reduce(vcat, [itr]) #444

Merged
merged 6 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ steps:
- "KomaMRIBase/Project.toml"
- "benchmarks/**/*"
- ".buildkite/**/*"
- ".github/workflows/Benchmark.yml"
- "Project.toml"
config:
command: "buildkite-agent pipeline upload .buildkite/runbenchmarks.yml"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/Benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ on:

jobs:
benchmark:
if: "!contains(github.event.head_commit.message, '[skip benchmarks]')"
if: ${{ !contains(github.event.head_commit.message, '[skip benchmarks]') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -58,7 +58,7 @@ jobs:
tool: 'julia'
output-file-path: ${{ steps.locate.outputs.path }}
benchmark-data-dir-path: "benchmarks"
summary-always: true
summary-always: true # I think this doesn't work on PRs
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-always: true
alert-threshold: "150%"
Expand Down
24 changes: 12 additions & 12 deletions KomaMRIBase/src/datatypes/Sequence.jl
Original file line number Diff line number Diff line change
Expand Up @@ -314,23 +314,23 @@ function get_samples(seq::Sequence, range; events=[:rf, :gr, :adc], freq_in_phas
fill_if_empty(x) = isempty(x.t) && length(range) == length(seq) ? merge(x, (t=[0.0; dur(seq)], A=zeros(eltype(x.A), 2))) : x
# RF
if :rf in events
t_rf = reduce(vcat, T0[i] .+ times(seq.RF[1,i], :A) for i in range)
t_Δf = reduce(vcat, T0[i] .+ times(seq.RF[1,i], :Δf) for i in range)
A_rf = reduce(vcat, ampls(seq.RF[1,i]; freq_in_phase) for i in range)
A_Δf = reduce(vcat, freqs(seq.RF[1,i]) for i in range)
t_rf = reduce(vcat, [T0[i] .+ times(seq.RF[1,i], :A) for i in range])
t_Δf = reduce(vcat, [T0[i] .+ times(seq.RF[1,i], :Δf) for i in range])
A_rf = reduce(vcat, [ampls(seq.RF[1,i]; freq_in_phase) for i in range])
A_Δf = reduce(vcat, [freqs(seq.RF[1,i]) for i in range])
rf_samples = (
rf = fill_if_empty((t = t_rf, A = A_rf)),
Δf = fill_if_empty((t = t_Δf, A = A_Δf))
)
end
# Gradients
if :gr in events
t_gx = reduce(vcat, T0[i] .+ times(seq.GR[1,i]) for i in range)
t_gy = reduce(vcat, T0[i] .+ times(seq.GR[2,i]) for i in range)
t_gz = reduce(vcat, T0[i] .+ times(seq.GR[3,i]) for i in range)
A_gx = reduce(vcat, ampls(seq.GR[1,i]) for i in range)
A_gy = reduce(vcat, ampls(seq.GR[2,i]) for i in range)
A_gz = reduce(vcat, ampls(seq.GR[3,i]) for i in range)
t_gx = reduce(vcat, [T0[i] .+ times(seq.GR[1,i]) for i in range])
t_gy = reduce(vcat, [T0[i] .+ times(seq.GR[2,i]) for i in range])
t_gz = reduce(vcat, [T0[i] .+ times(seq.GR[3,i]) for i in range])
A_gx = reduce(vcat, [ampls(seq.GR[1,i]) for i in range])
A_gy = reduce(vcat, [ampls(seq.GR[2,i]) for i in range])
A_gz = reduce(vcat, [ampls(seq.GR[3,i]) for i in range])
gr_samples = (
gx = fill_if_empty((t = t_gx, A = A_gx)),
gy = fill_if_empty((t = t_gy, A = A_gy)),
Expand All @@ -339,8 +339,8 @@ function get_samples(seq::Sequence, range; events=[:rf, :gr, :adc], freq_in_phas
end
# ADC
if :adc in events
t_aq = reduce(vcat, T0[i] .+ times(seq.ADC[i]) for i in range)
A_aq = reduce(vcat, ampls(seq.ADC[i]) for i in range)
t_aq = reduce(vcat, [T0[i] .+ times(seq.ADC[i]) for i in range])
A_aq = reduce(vcat, [ampls(seq.ADC[i]) for i in range])
adc_samples = (
adc = fill_if_empty((t = t_aq, A = A_aq)),
)
Expand Down
Loading