Skip to content

Commit 366e3aa

Browse files
authored
fix CI errors (#104)
1 parent 049705d commit 366e3aa

File tree

7 files changed

+20
-11
lines changed

7 files changed

+20
-11
lines changed

.github/workflows/CI.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
version:
16-
- '1.1'
16+
- '1.10'
1717
- '1'
1818
os:
1919
- ubuntu-latest
@@ -25,7 +25,7 @@ jobs:
2525
with:
2626
version: ${{ matrix.version }}
2727
arch: ${{ matrix.arch }}
28-
- uses: actions/cache@v1
28+
- uses: actions/cache@v4
2929
env:
3030
cache-name: cache-artifacts
3131
with:

Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ImagineInterface"
22
uuid = "a9d8408c-0fb1-11e9-0067-cb067474114e"
3-
version = "0.1.7"
3+
version = "0.1.8"
44

55
[deps]
66
AxisArrays = "39de3d68-74b9-583c-8d2d-e117c070f3a9"
@@ -23,12 +23,12 @@ AxisArrays = "0.4"
2323
DSP = "0.6, 0.7, 0.8"
2424
DataStructures = "0.17, 0.18"
2525
ImagineFormat = "1"
26-
ImagineHardware = "0.0.1"
26+
ImagineHardware = "0.0.1, 0.1"
2727
IntervalSets = "0.4, 0.5, 0.6, 0.7"
2828
JSON = "0.21"
2929
MappedArrays = "0.2, 0.3, 0.4"
3030
Statistics = "1"
31-
UnitAliases = "0.0.1"
31+
UnitAliases = "0.0.1, 0.1"
3232
Unitful = "1"
3333
julia = "0.7, 1"
3434

src/ImagineInterface.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ using MappedArrays, IntervalSets, DataStructures, DSP
77
using ImagineFormat, ImagineHardware
88
import ImagineHardware:samprate
99
using AxisArrays
10+
using DSP.Filters: normalize_freq
1011
const axes = Base.axes
1112

1213
import Base: convert, show, length, size, isempty, ==, append!, prepend!, pop!, empty!, replace!#, scale

src/hardware_templates.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ function default_samplemapper(rig::AbstractString, daq_chan_name::String; sample
1616
end
1717
end
1818

19-
function generic_ao_samplemapper(r::AbstractInterval{Traw},v::AbstractInterval{TV};
19+
function generic_ao_samplemapper(r::AbstractInterval{Traw},v::AbstractInterval{TV}; rawtype=Int16,
2020
sample_rate::HasInverseTimeUnits{Int, TU}=10000s^-1) where{Traw<:Integer,TV<:HasVoltageUnits, TU}
21-
return SampleMapper(minimum(r), maximum(r), minimum(v), maximum(v), minimum(v), maximum(v), sample_rate)
21+
return SampleMapper(rawtype(minimum(r)), rawtype(maximum(r)), minimum(v), maximum(v), minimum(v), maximum(v), sample_rate)
2222
end
2323

2424
generic_ai_samplemapper = generic_ao_samplemapper
2525

26-
function piezo_samplemapper(r::AbstractInterval{Traw},p::AbstractInterval{TL}, v::AbstractInterval{TV};
26+
function piezo_samplemapper(r::AbstractInterval{Traw},p::AbstractInterval{TL}, v::AbstractInterval{TV}; rawtype=Int16,
2727
sample_rate::HasInverseTimeUnits{Int, TU}=10000s^-1) where{Traw<:Integer,TL<:HasLengthUnits,TV<:HasVoltageUnits, TU}
28-
return SampleMapper(minimum(r), maximum(r), minimum(v), maximum(v), minimum(p), maximum(p), sample_rate)
28+
return SampleMapper(rawtype(minimum(r)), rawtype(maximum(r)), minimum(v), maximum(v), minimum(p), maximum(p), sample_rate)
2929
end
3030

3131
function galvo_ctrl_samplemapper(rawtype=Int16, sample_rate::HasInverseTimeUnits{Int, TU}=10000s^-1) where TU

src/stack.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function apply_lp(mod_samps::AbstractVector, sampr::HasInverseTimeUnits, cutoff:
77
mod_samps3 = repeat(mod_samps, 11)
88
fs = ustrip(uconvert(Unitful.Hz, sampr))
99
cutoff = ustrip(uconvert(Unitful.Hz, cutoff))
10-
responsetype = Lowpass(cutoff; fs=fs)
10+
responsetype = Lowpass(normalize_freq(cutoff, fs))
1111
designmethod = Butterworth(4)
1212
filtd = filtfilt(digitalfilter(responsetype, designmethod), ustrip.(mod_samps3)).*unit(mod_samps[1])
1313
return filtd[5*length(mod_samps)+1:(6*length(mod_samps))]

src/validate_single.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function check_piezo(pos::ImagineSignal; window_sz = 100, val_state::ValidationS
2626
max_sp = PIEZO_MAX_SPEED[rig_name(pos)]
2727
window_dur = window_sz / samprate(pos)
2828
max_dist = max_sp * window_dur #length units
29-
max_dist_raw = ceil(Int, (max_dist/width(interval_world(pos))) * width(interval_raw(pos)))
29+
max_dist_raw = ceil(Int, (max_dist/width(interval_world(pos))) * width(convert(Int64,interval_raw(pos))))
3030
val_func = (samps, win_sz) -> check_max_speed(samps, max_dist_raw, win_sz)
3131
if length(pos) < window_sz #should this throw an error?
3232
@warn "Insufficient samples to check this signal with a window size setting of $window_sz"
@@ -40,6 +40,12 @@ function check_piezo(pos::ImagineSignal; window_sz = 100, val_state::ValidationS
4040
return val_state
4141
end
4242

43+
function convert(::Type{T1}, i::AbstractInterval{T2}) where {T1,T2}
44+
l = convert(T1,i.left)
45+
r = convert(T1,i.right)
46+
Interval{:closed,:closed,T1}(l,r)
47+
end
48+
4349
function check_max_speed(raw_samps::Vector, raw_change::Int, in_n_samps::Int)
4450
@assert length(raw_samps) >= in_n_samps
4551
niter = length(raw_samps) - in_n_samps + 1

test/validate.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ replace!(sigs[1], "test3", samps)
217217
############STACK PARAMETERS#################
218218
pmin = 0.0*μm #Piezo start position in microns
219219
pmax = 200.0*μm #Piezo stop position in microns
220+
pms = ImagineInterface.PIEZO_MAX_SPEED[rig]
221+
mn_stack_img_time = abs(pmax - pmin)/pms
220222
stack_img_time = 0.26s #Time to complete the imaging sweep with the piezo (remember we also need to reset it to its starting position)
221223
reset_time = 0.001s #Time to reset piezo to starting position. This time plus "stack_img_time" determines how long it takes to complete an entire stack and be ready to start a new stack
222224
z_spacing = 3.1μm #The space between slices in the z-stack.

0 commit comments

Comments
 (0)