# Latest

**URL:** https://discourse.julialang.org/latest.md?page=444

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

**Page:** 445

---

## [Using ForwardDiff.jl with BlockDiagonals.jl](https://discourse.julialang.org/t/using-forwarddiff-jl-with-blockdiagonals-jl/112396)

<div class="topic-metadata">

**Author:** [@Mizu49](https://discourse.julialang.org/u/Mizu49)\
**Replies:** 1\
**Last updated:** [April 2, 2024, 4:58am UTC](https://discourse.julialang.org/t/using-forwarddiff-jl-with-blockdiagonals-jl/112396 "2024-04-02T04:58:17Z")

</div>

I want to calcuate the jacobian for a vector calculated with the following function. function test(A1, A2, x) A = BlockDiagonal(\[A1 \* x, A2\]) return A \* vcat(x, x) end However, when I calculate the jacobi…

---

## [Testing docs locally with Documenter.jl](https://discourse.julialang.org/t/testing-docs-locally-with-documenter-jl/112371)

<div class="topic-metadata">

**Author:** [@garrek](https://discourse.julialang.org/u/garrek)\
**Replies:** 9\
**Last updated:** [April 2, 2024, 4:22am UTC](https://discourse.julialang.org/t/testing-docs-locally-with-documenter-jl/112371 "2024-04-02T04:22:34Z")

</div>

I’m using Documenter.jl to build my docs for a package. I have a new version of my package on a test branch and I want to build the docs locally. I try to dev the local version of the package (on the test branch) but ev…

---

## [Package dependencies](https://discourse.julialang.org/t/package-dependencies/112393)

<div class="topic-metadata">

**Author:** [@lancejnelson](https://discourse.julialang.org/u/lancejnelson)\
**Replies:** 2\
**Last updated:** [April 2, 2024, 2:41am UTC](https://discourse.julialang.org/t/package-dependencies/112393 "2024-04-02T02:41:36Z")

</div>

Currently trying to understand packages and dependencies. I’ve created a package that just holds type definitions, made the git repo and done all of the setup. Now I’m creating a second package that will need access to …

---

## [On the solution of an unbounded optimization problem](https://discourse.julialang.org/t/on-the-solution-of-an-unbounded-optimization-problem/112373)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 2\
**Last updated:** [April 2, 2024, 1:38am UTC](https://discourse.julialang.org/t/on-the-solution-of-an-unbounded-optimization-problem/112373 "2024-04-02T01:38:19Z")

</div>

using JuMP, HiGHS M = Model(HiGHS.Optimizer) @variable(M, y, Bin) @variable(M, η) @objective(M, Min, y + η) optimize!(M) The result: Running HiGHS 1.7.0 (git hash: 50670fd4c): Copyright (c) 2024 HiGHS under MIT licenc…

---

## [Why would \`\<:\` in Unions for keyword arguments create allocations](https://discourse.julialang.org/t/why-would-in-unions-for-keyword-arguments-create-allocations/112390)

<div class="topic-metadata">

**Author:** [@mattsignorelli](https://discourse.julialang.org/u/mattsignorelli)\
**Replies:** 2\
**Last updated:** [April 2, 2024, 12:56am UTC](https://discourse.julialang.org/t/why-would-in-unions-for-keyword-arguments-create-allocations/112390 "2024-04-02T00:56:50Z")

</div>

Take this MWE function which simply returns the argument at the specified index idx or y in the vector v: function foo(v::Vector{Int}, idx::Union{Nothing,Int}=nothing; y::Union{Nothing,Integer}=nothing) if !xor(isnoth…

---

## [Marginal water value while using SDDP.jl](https://discourse.julialang.org/t/marginal-water-value-while-using-sddp-jl/112169)

<div class="topic-metadata">

**Author:** [@Sorooshsa](https://discourse.julialang.org/u/Sorooshsa)\
**Replies:** 7\
**Last updated:** [April 2, 2024, 12:24am UTC](https://discourse.julialang.org/t/marginal-water-value-while-using-sddp-jl/112169 "2024-04-02T00:24:54Z")

</div>

I have a multi-stage stochastic hydro-electric scheduling problem that SDDP.jl models and solves. The model includes a set of constraints related to water level control. So now I’d like to determine the reservoirs’ mar…

---

## [How to use @sprintf with "parametric" format string?](https://discourse.julialang.org/t/how-to-use-sprintf-with-parametric-format-string/70364)

<div class="topic-metadata">

**Author:** [@ryszard314159](https://discourse.julialang.org/u/ryszard314159)\
**Replies:** 5\
**Last updated:** [April 1, 2024, 9:01pm UTC](https://discourse.julialang.org/t/how-to-use-sprintf-with-parametric-format-string/70364 "2024-04-01T21:01:33Z")

</div>

Is there a way to use @sprintf with “parametric” format string? or it has to be hardcoded? This is an example: julia\> @sprintf(“test: %s”, “test”) “test: test” julia\> fmt = “test: %s”; @sprintf(fmt, “test”) ERROR: L…

---

## [Math support for GPU kernels](https://discourse.julialang.org/t/math-support-for-gpu-kernels/112381)

<div class="topic-metadata">

**Author:** [@fwinter](https://discourse.julialang.org/u/fwinter)\
**Replies:** 3\
**Last updated:** [April 1, 2024, 8:15pm UTC](https://discourse.julialang.org/t/math-support-for-gpu-kernels/112381 "2024-04-01T20:15:52Z")

</div>

I was hoping you could provide some insight into the process of incorporating support for mathematical functions (such as sin, cos, sqrt, etc.) in GPU kernels. Within the ROCm installation, there exists a file located a…

---

## [Convert value type of dictionary](https://discourse.julialang.org/t/convert-value-type-of-dictionary/67419)

<div class="topic-metadata">

**Author:** [@Mastomaki](https://discourse.julialang.org/u/Mastomaki)\
**Replies:** 4\
**Last updated:** [April 1, 2024, 8:03pm UTC](https://discourse.julialang.org/t/convert-value-type-of-dictionary/67419 "2024-04-01T20:03:06Z")

</div>

Hello! How would I convert Dict{String,String} to Dict{String,Float}? I have got this far so that I can convert the values: map(v-\>parse(Float64,v),values(mydict)) But how can I match these with the original keys and …

---

## [Revise and commenting out lines in package](https://discourse.julialang.org/t/revise-and-commenting-out-lines-in-package/112385)

<div class="topic-metadata">

**Author:** [@p\_f](https://discourse.julialang.org/u/p_f)\
**Replies:** 0\
**Last updated:** [April 1, 2024, 6:22pm UTC](https://discourse.julialang.org/t/revise-and-commenting-out-lines-in-package/112385 "2024-04-01T18:22:26Z")

</div>

Say I have a package that looks like this: module test\_pkg include("file1.jl") # include("file2.jl") export f end # module test\_pkg ##file1.jl: f() = print("file 1") ##file2.jl f() = print("file 2") Revis…

---

## [What is the fastest way of making a vector of dictionaries?](https://discourse.julialang.org/t/what-is-the-fastest-way-of-making-a-vector-of-dictionaries/112363)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 11\
**Last updated:** [April 1, 2024, 3:36pm UTC](https://discourse.julialang.org/t/what-is-the-fastest-way-of-making-a-vector-of-dictionaries/112363 "2024-04-01T15:36:47Z")

</div>

I know the type (Dict{Int,Int}) and I know the size of the vector. How do I make the vector quickly? (Just to be explicit, all those dictionaries are independent; I do not want to fill the vector with just a single dic…

---

## [Using vs import](https://discourse.julialang.org/t/using-vs-import/112366)

<div class="topic-metadata">

**Author:** [@lancejnelson](https://discourse.julialang.org/u/lancejnelson)\
**Replies:** 2\
**Last updated:** [April 1, 2024, 3:20pm UTC](https://discourse.julialang.org/t/using-vs-import/112366 "2024-04-01T15:20:58Z")

</div>

Why can I load some modules/packages like this using LinearAlgebra but if I make my own module named test.jl (located in subdirectory “modules”), I can’t load it like this: push!(LOAD\_PATH,"./modules") using test Ins…

---

## [ECMWF Open Data (Meteorology Forecasts)](https://discourse.julialang.org/t/ecmwf-open-data-meteorology-forecasts/112375)

<div class="topic-metadata">

**Author:** [@tom-plaa](https://discourse.julialang.org/u/tom-plaa)\
**Replies:** 4\
**Last updated:** [April 1, 2024, 1:52pm UTC](https://discourse.julialang.org/t/ecmwf-open-data-meteorology-forecasts/112375 "2024-04-01T13:52:23Z")

</div>

I figured this might be an interesting place to ask about this. Has anyone here used the data from ECMWF Open Data? I just stumbled into it but the website/documentation is a bit confusing to me. It’s not clear what is o…

---

## [What is faster: sparse vector or a dictionary?](https://discourse.julialang.org/t/what-is-faster-sparse-vector-or-a-dictionary/112341)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 14\
**Last updated:** [April 1, 2024, 1:40pm UTC](https://discourse.julialang.org/t/what-is-faster-sparse-vector-or-a-dictionary/112341 "2024-04-01T13:40:00Z")

</div>

Sparse vector uses binary search. Dictionary uses a hash. Anyone has an experience to share?

---

## [Deforming an image according to a matrix of displacements](https://discourse.julialang.org/t/deforming-an-image-according-to-a-matrix-of-displacements/112295)

<div class="topic-metadata">

**Author:** [@JonathanH](https://discourse.julialang.org/u/JonathanH)\
**Replies:** 6\
**Last updated:** [April 1, 2024, 12:33pm UTC](https://discourse.julialang.org/t/deforming-an-image-according-to-a-matrix-of-displacements/112295 "2024-04-01T12:33:57Z")

</div>

Hi, I’m struggling to do the following in Julia: I have an image and a corresponding matrix of 2D translations at each pixel location. I would like to warp the image according to this transformation and fill with 0 at di…

---

## [Base.nullspace for general matrices](https://discourse.julialang.org/t/base-nullspace-for-general-matrices/112356)

<div class="topic-metadata">

**Author:** [@azoviktor](https://discourse.julialang.org/u/azoviktor)\
**Replies:** 5\
**Last updated:** [April 1, 2024, 1:24pm UTC](https://discourse.julialang.org/t/base-nullspace-for-general-matrices/112356 "2024-04-01T13:24:34Z")

</div>

Let’s say I would like to use the nullspace method from julia Base module for a matrix of type AbstractMatrix{MyNumberType}. What interface should I implement in order to make it work? Does such an interface technically …

---

## [Approach to iterative functions in julia?](https://discourse.julialang.org/t/approach-to-iterative-functions-in-julia/112369)

<div class="topic-metadata">

**Author:** [@corpserot](https://discourse.julialang.org/u/corpserot)\
**Replies:** 3\
**Last updated:** [April 1, 2024, 8:30am UTC](https://discourse.julialang.org/t/approach-to-iterative-functions-in-julia/112369 "2024-04-01T08:30:36Z")

</div>

Hello, I’ve just spent yesterday learning Julia and it’s been a blast! Previously, I used Python and Lua for quick projects. In those languages, I used iterative functions (or generators) but I’m having a hard time figur…

---

## [Are Enzyme's custom rules for sparse arrays different from regular Matrix?](https://discourse.julialang.org/t/are-enzymes-custom-rules-for-sparse-arrays-different-from-regular-matrix/112352)

<div class="topic-metadata">

**Author:** [@ToPo](https://discourse.julialang.org/u/ToPo)\
**Replies:** 3\
**Last updated:** [April 1, 2024, 6:14am UTC](https://discourse.julialang.org/t/are-enzymes-custom-rules-for-sparse-arrays-different-from-regular-matrix/112352 "2024-04-01T06:14:00Z")

</div>

I am creating custom rules for sparse arrays in Enzyme, an automatic differentiation package. The following program is a custom rule for the computation of matrix adds of type SparseMatrixCSC. using SparseArrays #-----…

---

## [Correct way to create dataset with DataToolkit.jl programmatically](https://discourse.julialang.org/t/correct-way-to-create-dataset-with-datatoolkit-jl-programmatically/112368)

<div class="topic-metadata">

**Author:** [@myrddin89](https://discourse.julialang.org/u/myrddin89)\
**Replies:** 0\
**Last updated:** [April 1, 2024, 5:48am UTC](https://discourse.julialang.org/t/correct-way-to-create-dataset-with-datatoolkit-jl-programmatically/112368 "2024-04-01T05:48:36Z")

</div>

Hi! I have been trying the DataToolkit.jl package for my workflow. I have encountered some issues when creating datasets programmatically. Specifically, I am having trouble adding storage drivers, resulting always in a…

---

## [Hard crash using @spawn instead of @async](https://discourse.julialang.org/t/hard-crash-using-spawn-instead-of-async/112209)

<div class="topic-metadata">

**Author:** [@oscarvdvelde](https://discourse.julialang.org/u/oscarvdvelde)\
**Replies:** 7\
**Last updated:** [April 1, 2024, 5:18am UTC](https://discourse.julialang.org/t/hard-crash-using-spawn-instead-of-async/112209 "2024-04-01T05:18:02Z")

</div>

I am trying to modify a function that currently works fine with @async, but by manually feeding it batches (4 hours) to generate about as many processes as I have available threads (on this Linux server, 32). I am changi…

---

## [LaTeX friendly vector graphics with Makie](https://discourse.julialang.org/t/latex-friendly-vector-graphics-with-makie/84704)

<div class="topic-metadata">

**Author:** [@jlbosse](https://discourse.julialang.org/u/jlbosse)\
**Replies:** 3\
**Last updated:** [April 1, 2024, 2:26am UTC](https://discourse.julialang.org/t/latex-friendly-vector-graphics-with-makie/84704 "2024-04-01T02:26:43Z")

</div>

Is there a way to produce vector graphics figures with Makie such that they can be included in a LaTeX document and have LaTeX typeset all text in the figure? My first idea was to use CairoMakie to produce a figure.svg f…

---

## [Unexpected behavior when returning DifferentialEquations solve() solution from external .jl file](https://discourse.julialang.org/t/unexpected-behavior-when-returning-differentialequations-solve-solution-from-external-jl-file/112263)

<div class="topic-metadata">

**Author:** [@thedeyan](https://discourse.julialang.org/u/thedeyan)\
**Replies:** 1\
**Last updated:** [April 1, 2024, 2:01am UTC](https://discourse.julialang.org/t/unexpected-behavior-when-returning-differentialequations-solve-solution-from-external-jl-file/112263 "2024-04-01T02:01:14Z")

</div>

I am new to Julia. I am trying to use the DifferentialEquations.jl to solve, well, some ODEs, via Python. I can, for example, use the following python script to solve the Lorenz attractor: from diffeqpy import de from j…

---

## [Error while running a PDE model using ModelingToolkit and MethodOfLines!](https://discourse.julialang.org/t/error-while-running-a-pde-model-using-modelingtoolkit-and-methodoflines/112160)

<div class="topic-metadata">

**Author:** [@aelmokadem](https://discourse.julialang.org/u/aelmokadem)\
**Replies:** 1\
**Last updated:** [April 1, 2024, 2:00am UTC](https://discourse.julialang.org/t/error-while-running-a-pde-model-using-modelingtoolkit-and-methodoflines/112160 "2024-04-01T02:00:17Z")

</div>

Hi, I am trying to solve this PDE system and getting the error below. Any ideas what I am missing here?! Thank you. Modeling code: using DifferentialEquations, ModelingToolkit, MethodOfLines, DomainSets @parameters …

---

## [Guidelines for wrapping a simple C library in Julia](https://discourse.julialang.org/t/guidelines-for-wrapping-a-simple-c-library-in-julia/112335)

<div class="topic-metadata">

**Author:** [@pjssilva](https://discourse.julialang.org/u/pjssilva)\
**Replies:** 6\
**Last updated:** [March 31, 2024, 11:57pm UTC](https://discourse.julialang.org/t/guidelines-for-wrapping-a-simple-c-library-in-julia/112335 "2024-03-31T23:57:53Z")

</div>

I am scratching my own itch here and decided to write a wrapper to a small C library I wrote to solve the problem of projecting a point onto the intersection of a box and a hyperplane. Is there a good “best practices” d…

---

## [Is there a differentiable implementation of matrix square root?](https://discourse.julialang.org/t/is-there-a-differentiable-implementation-of-matrix-square-root/112334)

<div class="topic-metadata">

**Author:** [@marcsgil](https://discourse.julialang.org/u/marcsgil)\
**Replies:** 5\
**Last updated:** [March 31, 2024, 10:15pm UTC](https://discourse.julialang.org/t/is-there-a-differentiable-implementation-of-matrix-square-root/112334 "2024-03-31T22:15:47Z")

</div>

Hello! I’m trying to make the following code work: using ForwardDiff, LinearAlgebra # Fidelity between two density matrices function fidelity(ρ::AbstractMatrix, σ::AbstractMatrix) sqrt\_ρ = sqrt(ρ) abs2(tr(sqrt…

---

## [How to not plot axis ticks on top and right in Plots.jl with GR backend?](https://discourse.julialang.org/t/how-to-not-plot-axis-ticks-on-top-and-right-in-plots-jl-with-gr-backend/112345)

<div class="topic-metadata">

**Author:** [@singularitti](https://discourse.julialang.org/u/singularitti)\
**Replies:** 5\
**Last updated:** [March 31, 2024, 6:35pm UTC](https://discourse.julialang.org/t/how-to-not-plot-axis-ticks-on-top-and-right-in-plots-jl-with-gr-backend/112345 "2024-03-31T18:35:06Z")

</div>

This is the inverse question for: Axis ticks on top and right plot with framestyle=:box used to not put axis ticks on top and right, but after Feature request: plot axes and ticks on all four sides · Issue #2218 · Julia…

---

## [What the differences of the 6 solutions please](https://discourse.julialang.org/t/what-the-differences-of-the-6-solutions-please/112300)

<div class="topic-metadata">

**Author:** [@ajsagit](https://discourse.julialang.org/u/ajsagit)\
**Replies:** 6\
**Last updated:** [March 31, 2024, 5:51pm UTC](https://discourse.julialang.org/t/what-the-differences-of-the-6-solutions-please/112300 "2024-03-31T17:51:41Z")

</div>

using BenchmarkTools datasize = 10000000 data = randn(Float32, datasize) #recip\_vector = similar(data, Float32) recip\_vector = similar(data) # 1）0.007099 seconds (1 allocation: 32 bytes) @timev recip\_vector .= 1 ./ dat…

---

## [Possible to speed up this function for calculating cartesian indices?](https://discourse.julialang.org/t/possible-to-speed-up-this-function-for-calculating-cartesian-indices/112333)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 19\
**Last updated:** [March 31, 2024, 5:08pm UTC](https://discourse.julialang.org/t/possible-to-speed-up-this-function-for-calculating-cartesian-indices/112333 "2024-03-31T17:08:23Z")

</div>

Hello! I have a small function which I call a lot: function BatchExtractCells!(Cells, Points, CutOff) @batch per=thread for i ∈ eachindex(Cells) ci = CartesianIndex(@. Int(fld(Points\[i\], CutOff))...) …

---

## [Pseudo-random freeze during Flux training](https://discourse.julialang.org/t/pseudo-random-freeze-during-flux-training/112357)

<div class="topic-metadata">

**Author:** [@CM1](https://discourse.julialang.org/u/CM1)\
**Replies:** 0\
**Last updated:** [March 31, 2024, 4:54pm UTC](https://discourse.julialang.org/t/pseudo-random-freeze-during-flux-training/112357 "2024-03-31T16:54:34Z")

</div>

I am training the parameters of an epidemiology model via Flux. I am able to obtain gradients for the parameters and for a few epochs, the training works well. However, after some more epochs, the training freezes. Weird…

---

## [Can RuntimeGeneratedFunctions.jl cause memory leak issue?](https://discourse.julialang.org/t/can-runtimegeneratedfunctions-jl-cause-memory-leak-issue/112261)

<div class="topic-metadata">

**Author:** [@VPBML](https://discourse.julialang.org/u/VPBML)\
**Replies:** 1\
**Last updated:** [March 31, 2024, 4:33pm UTC](https://discourse.julialang.org/t/can-runtimegeneratedfunctions-jl-cause-memory-leak-issue/112261 "2024-03-31T16:33:34Z")

</div>

Hi, I am writing a Genetic Programming-styled code to search for solutions to specific problems. The solutions are in the form of functions. Thus, I use RuntimeGeneratedFunctions.jl to generate functions in runtime in o…

[Previous page](https://discourse.julialang.org/latest.md?page=443)

[Next page](https://discourse.julialang.org/latest.md?page=445)
