Skip to content

Commit 604a284

Browse files
mbaumanLiozou
authored andcommitted
Specify init when calling maximum(...; dims)
There's a proposed "minor change" to Julia v1.13 that would make `maximum([], dims=2)` (and other such reductions) an error, akin to how `maximum([])` is an error when `init` is not specified. This package was flagged as having (at least) one such usage here; it errored in [PkgEval](https://s3.amazonaws.com/julialang-reports/nanosoldier/pkgeval/by_hash/813bcf3_vs_c3e7b1b/report.html). See JuliaLang/julia#55628 for more details.
1 parent 9e32bfe commit 604a284

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/algorithms/dimensionality.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ function PeriodicGraph{D}(graph::PeriodicGraph{N}, dims=_dimensionality(graph))
307307
basis, _d = normal_basis(l)
308308
@assert _d == d
309309
_invmat::Matrix{Rational{Int}} = inv(Rational.(basis))[1:d,:]
310-
maxden = maximum(denominator.(_invmat); dims=2)
310+
maxden = maximum(denominator.(_invmat); dims=2, init=0)
311311
invmat::Matrix{Int} = maximum(maxden; init=0) > 1 ? (maxden .* _invmat) : _invmat
312312
newedges = Vector{PeriodicEdge{D}}(undef, n)
313313
if d == D

0 commit comments

Comments
 (0)