# Latest

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

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

**Page:** 231

---

## [Suggestion for how to organize code that requires many parameters](https://discourse.julialang.org/t/suggestion-for-how-to-organize-code-that-requires-many-parameters/125230)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 12\
**Last updated:** [January 26, 2025, 9:19pm UTC](https://discourse.julialang.org/t/suggestion-for-how-to-organize-code-that-requires-many-parameters/125230 "2025-01-26T21:19:29Z")

</div>

I have a “model” that require many parameters and I am struggling to keep a reference to all the paramters in the various subcalls. I would like instead to define a julia file to host the “default” parameters, itself a p…

---

## [Problems with accessing ODE parameters after optimisation when modelling with ModelingToolkit](https://discourse.julialang.org/t/problems-with-accessing-ode-parameters-after-optimisation-when-modelling-with-modelingtoolkit/112323)

<div class="topic-metadata">

**Author:** [@giro](https://discourse.julialang.org/u/giro)\
**Replies:** 8\
**Last updated:** [January 26, 2025, 5:54pm UTC](https://discourse.julialang.org/t/problems-with-accessing-ode-parameters-after-optimisation-when-modelling-with-modelingtoolkit/112323 "2025-01-26T17:54:02Z")

</div>

Hello, I am working with a small non-linear ODE problem to model some protein dynamics data. I am fitting my model to the data and estimating the parameters using Optimization.jl. So far everything worked fine, my probl…

---

## [Understanding \`Base.findall\` and customizing it](https://discourse.julialang.org/t/understanding-base-findall-and-customizing-it/125220)

<div class="topic-metadata">

**Author:** [@Leo\_I](https://discourse.julialang.org/u/Leo_I)\
**Replies:** 2\
**Last updated:** [January 26, 2025, 1:24pm UTC](https://discourse.julialang.org/t/understanding-base-findall-and-customizing-it/125220 "2025-01-26T13:24:58Z")

</div>

Given a vector ww, I wish to obtain all its nonzero values and the corresponding positions (with specified type). I solve this with: using BenchmarkTools, Test function \_find0(::tp, ww::AbstractVector{tw}) ::Tuple{Vecto…

---

## [How to initialize a \`Dict\` with \`#undef\` content?](https://discourse.julialang.org/t/how-to-initialize-a-dict-with-undef-content/125154)

<div class="topic-metadata">

**Author:** [@Shayan](https://discourse.julialang.org/u/Shayan)\
**Replies:** 6\
**Last updated:** [January 26, 2025, 1:10pm UTC](https://discourse.julialang.org/t/how-to-initialize-a-dict-with-undef-content/125154 "2025-01-26T13:10:28Z")

</div>

I want to initialize a Dict comprised of some #undef values. How can I do this? I tried Dict{String, Float64}(undef, 3) but it throws the following error: ERROR: MethodError: no method matching Dict{String, Float64}(::…

---

## [QuantumCircuitDraw.jl drawing quantum circuits in qiskit style](https://discourse.julialang.org/t/quantumcircuitdraw-jl-drawing-quantum-circuits-in-qiskit-style/125224)

<div class="topic-metadata">

**Author:** [@Nichola](https://discourse.julialang.org/u/Nichola)\
**Replies:** 0\
**Last updated:** [January 26, 2025, 12:44pm UTC](https://discourse.julialang.org/t/quantumcircuitdraw-jl-drawing-quantum-circuits-in-qiskit-style/125224 "2025-01-26T12:44:30Z")

</div>

Hi ! QuantumCircuitDraw.jl is a new package for plotting quantum circuits in qiskit style. Feel free to contribute ! Example : using Plots using QuantumCircuitDraw N = 5 # number of qubits steps = 8 # number of steps…

---

## [Error in precompiling DifferentialEquations](https://discourse.julialang.org/t/error-in-precompiling-differentialequations/124803)

<div class="topic-metadata">

**Author:** [@Ashima\_Kalathingal](https://discourse.julialang.org/u/Ashima_Kalathingal)\
**Replies:** 19\
**Last updated:** [January 26, 2025, 12:37pm UTC](https://discourse.julialang.org/t/error-in-precompiling-differentialequations/124803 "2025-01-26T12:37:00Z")

</div>

I am trying to use DifferentialEquations package for my work and the following error pops up. The error message is really large. So I am posting parts of it. ERROR: LoadError: Failed to precompile BoundaryValueDiffEq \[7…

---

## [How to upgrade easily?](https://discourse.julialang.org/t/how-to-upgrade-easily/27753)

<div class="topic-metadata">

**Author:** [@mystis](https://discourse.julialang.org/u/mystis)\
**Replies:** 14\
**Last updated:** [December 21, 2024, 3:16pm UTC](https://discourse.julialang.org/t/how-to-upgrade-easily/27753 "2024-12-21T15:16:07Z")

</div>

Hi, I see there are threads about updates but is there a way to easily update Julia ? I’d hope for something like : \] update julia without the hassle to download a new version, remove the old one, etc.

---

## [LoadError: UndefVarError: \`@threads\` not defined in \`Main\`](https://discourse.julialang.org/t/loaderror-undefvarerror-threads-not-defined-in-main/125216)

<div class="topic-metadata">

**Author:** [@Mohamad\_Badiez](https://discourse.julialang.org/u/Mohamad_Badiez)\
**Replies:** 3\
**Last updated:** [January 26, 2025, 9:54am UTC](https://discourse.julialang.org/t/loaderror-undefvarerror-threads-not-defined-in-main/125216 "2025-01-26T09:54:36Z")

</div>

Hi everybody, I just want to stress test on all of my CPU threads with the multiplication of two random matrices but I got the following error: What should I do as a Julia new user? Thank you

---

## [AMDGPU.versioninfo() trips an assertion in AMD's code](https://discourse.julialang.org/t/amdgpu-versioninfo-trips-an-assertion-in-amds-code/125203)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 1\
**Last updated:** [January 26, 2025, 8:51am UTC](https://discourse.julialang.org/t/amdgpu-versioninfo-trips-an-assertion-in-amds-code/125203 "2025-01-26T08:51:27Z")

</div>

System and Julia info, ./julia-1.10.8/bin/julia -g2 -e 'using InteractiveUtils; versioninfo()': Julia Version 1.10.8 Commit 4c16ff44be8 (2025-01-22 10:06 UTC) Build Info: Official https://julialang.org/ release Platfo…

---

## [Parametric types & instances](https://discourse.julialang.org/t/parametric-types-instances/125213)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 5\
**Last updated:** [January 26, 2025, 7:41am UTC](https://discourse.julialang.org/t/parametric-types-instances/125213 "2025-01-26T07:41:47Z")

</div>

I have ~20 trade types. Each has a rate-set struct and a rate-set-instance struct. I’d like to define the rate-sets and rate-set-instances jointly (botom example). There are ~3 rate-set field types and each has a uniqu…

---

## [How to test a plotting package?](https://discourse.julialang.org/t/how-to-test-a-plotting-package/125206)

<div class="topic-metadata">

**Author:** [@Nichola](https://discourse.julialang.org/u/Nichola)\
**Replies:** 6\
**Last updated:** [January 26, 2025, 5:59am UTC](https://discourse.julialang.org/t/how-to-test-a-plotting-package/125206 "2025-01-26T05:59:01Z")

</div>

I’m writing a package to plot quantum circuits: QuantumCircuitDraw.jl but im not sure how to write testsets for this kind of code. How can I ensure its plotting the right thing without having to manually check the output…

---

## [Getting errors when adding \`DataDrivenDiffEq\` package](https://discourse.julialang.org/t/getting-errors-when-adding-datadrivendiffeq-package/118301)

<div class="topic-metadata">

**Author:** [@mmohammadi9812](https://discourse.julialang.org/u/mmohammadi9812)\
**Replies:** 2\
**Last updated:** [January 26, 2025, 4:34am UTC](https://discourse.julialang.org/t/getting-errors-when-adding-datadrivendiffeq-package/118301 "2025-01-26T04:34:47Z")

</div>

Hey guys. I’m having problems when trying to add DataDrivenDiffEq package. As per what the documentation and github readme of package says, I tried import Pkg; Pkg.add("DataDrivenDiffEq") and also pkg\> add DataDrivenDiff…

---

## [AD vs argument lists](https://discourse.julialang.org/t/ad-vs-argument-lists/125207)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 5\
**Last updated:** [January 26, 2025, 12:27am UTC](https://discourse.julialang.org/t/ad-vs-argument-lists/125207 "2025-01-26T00:27:06Z")

</div>

To enable AD I must do something about argument types. Let us say I have a function like this: add\_btdb\_ut\_only!(Ke::Matrix{T}, B::Matrix{T}, Jac\_w::T, D::Matrix{T}, DB::Matrix{T}) where {T} I might be able to guess wh…

---

## [Batched gradients and hessians with Flux](https://discourse.julialang.org/t/batched-gradients-and-hessians-with-flux/125130)

<div class="topic-metadata">

**Author:** [@Gattu\_Mytraya](https://discourse.julialang.org/u/Gattu_Mytraya)\
**Replies:** 10\
**Last updated:** [January 25, 2025, 10:55pm UTC](https://discourse.julialang.org/t/batched-gradients-and-hessians-with-flux/125130 "2025-01-25T22:55:35Z")

</div>

Hi, I am new to Flux, so I am not sure how to do the following. Say I have some model(params, x) where the model returns an A dimensional output, there are B params, and x is a C dimensional input. I have D inputs su…

---

## [TestItems falling at the first hurdle](https://discourse.julialang.org/t/testitems-falling-at-the-first-hurdle/125197)

<div class="topic-metadata">

**Author:** [@phulcq](https://discourse.julialang.org/u/phulcq)\
**Replies:** 3\
**Last updated:** [January 25, 2025, 9:49pm UTC](https://discourse.julialang.org/t/testitems-falling-at-the-first-hurdle/125197 "2025-01-25T21:49:32Z")

</div>

Hi, I’m very new to Julia and I thought I’d get started by creating a little toy project. I saw a recommendation somewhere to use the TestItems package to set up unit tests in VS code. I’ve had a little trouble getting …

---

## [JuMP.jl optimization which solver](https://discourse.julialang.org/t/jump-jl-optimization-which-solver/125182)

<div class="topic-metadata">

**Author:** [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Replies:** 5\
**Last updated:** [January 25, 2025, 9:48pm UTC](https://discourse.julialang.org/t/jump-jl-optimization-which-solver/125182 "2025-01-25T21:48:10Z")

</div>

I have an optimization problem, but I am unsure which solver to use. I think JuMP.jl might work for this (the problem looks linear to me). Either @objective(....) gives me an error or optimize!(model) errors. The prob…

---

## [GridapGmsh on gmsh.jl object](https://discourse.julialang.org/t/gridapgmsh-on-gmsh-jl-object/82681)

<div class="topic-metadata">

**Author:** [@chupin](https://discourse.julialang.org/u/chupin)\
**Replies:** 2\
**Last updated:** [January 25, 2025, 9:17pm UTC](https://discourse.julialang.org/t/gridapgmsh-on-gmsh-jl-object/82681 "2025-01-25T21:17:53Z")

</div>

I would like to generate a mesh from a set of points defining a contour computed by a Julia program and then to solve a PDE on the generated mesh. I found the package Gmsh.jl to use gmsh program to build a msh file. Th…

---

## [Is \`LsqFit.jl\` abandoned?](https://discourse.julialang.org/t/is-lsqfit-jl-abandoned/125192)

<div class="topic-metadata">

**Author:** [@cocoa1231](https://discourse.julialang.org/u/cocoa1231)\
**Replies:** 2\
**Last updated:** [January 25, 2025, 6:03pm UTC](https://discourse.julialang.org/t/is-lsqfit-jl-abandoned/125192 "2025-01-25T18:03:28Z")

</div>

As the title says, is the package abandoned? There’s PRs that go back to 2020. Is LsqFit.jl no longer maintained? If so what’s the preferred way to do curve fitting similar to scipy.optimize.curve\_fit?

---

## [Too many allocations in functions call](https://discourse.julialang.org/t/too-many-allocations-in-functions-call/125181)

<div class="topic-metadata">

**Author:** [@Miroboru](https://discourse.julialang.org/u/Miroboru)\
**Replies:** 6\
**Last updated:** [January 25, 2025, 3:45pm UTC](https://discourse.julialang.org/t/too-many-allocations-in-functions-call/125181 "2025-01-25T15:45:07Z")

</div>

Consider the following function function foo(n) bar = ones(n) return 0.0 end When running this function (twice) under the @allocations or @time macro, there will be one allocation, which is to be expected: @ti…

---

## [Economy-sized eigendecomposition?](https://discourse.julialang.org/t/economy-sized-eigendecomposition/125037)

<div class="topic-metadata">

**Author:** [@benninkrs](https://discourse.julialang.org/u/benninkrs)\
**Replies:** 4\
**Last updated:** [January 25, 2025, 3:29pm UTC](https://discourse.julialang.org/t/economy-sized-eigendecomposition/125037 "2025-01-25T15:29:55Z")

</div>

Perhaps I’ve missed it, but is there a way to obtain the “economy” eigendecomposition of a matrix whose rank is less than the dimension? That is, if A is size n and rank r \< n, I would like to store just r eigenvalues a…

---

## [Progressive colormap transparency](https://discourse.julialang.org/t/progressive-colormap-transparency/125194)

<div class="topic-metadata">

**Author:** [@Gravlax](https://discourse.julialang.org/u/Gravlax)\
**Replies:** 2\
**Last updated:** [January 25, 2025, 3:25pm UTC](https://discourse.julialang.org/t/progressive-colormap-transparency/125194 "2025-01-25T15:25:10Z")

</div>

I was wondering: what is the best way to make a colormap progressively transparent? In practice I’d like to use a colormap (e.g. :bilbao) but I’d like the color to progressively become transparent for low values of the …

---

## [Dict with integer keys and fastest insertion?](https://discourse.julialang.org/t/dict-with-integer-keys-and-fastest-insertion/125171)

<div class="topic-metadata">

**Author:** [@Leo\_I](https://discourse.julialang.org/u/Leo_I)\
**Replies:** 8\
**Last updated:** [January 25, 2025, 1:28pm UTC](https://discourse.julialang.org/t/dict-with-integer-keys-and-fastest-insertion/125171 "2025-01-25T13:28:35Z")

</div>

What are the best options for a dict/map with integer keys and the fastest insert/update? For background, I wish to aggregate those position-weight pairs (p,w) where the position is the same, I’m tinkering with the idea …

---

## [Vacuum & Substrate](https://discourse.julialang.org/t/vacuum-substrate/125161)

<div class="topic-metadata">

**Author:** [@Vincenzo\_Pierro](https://discourse.julialang.org/u/Vincenzo_Pierro)\
**Replies:** 5\
**Last updated:** [January 25, 2025, 9:46am UTC](https://discourse.julialang.org/t/vacuum-substrate/125161 "2025-01-25T09:46:06Z")

</div>

how I can define a infinite layer of Vacuum. It is no clear the substrate how can be defined in the structure

---

## [Designing a borrow checker for Julia](https://discourse.julialang.org/t/designing-a-borrow-checker-for-julia/124906)

<div class="topic-metadata">

**Author:** [@MilesCranmer](https://discourse.julialang.org/u/MilesCranmer)\
**Replies:** 8\
**Last updated:** [January 25, 2025, 9:02am UTC](https://discourse.julialang.org/t/designing-a-borrow-checker-for-julia/124906 "2025-01-25T09:02:52Z")

</div>

Hi everyone! I’m working on BorrowChecker.jl, a package that brings a layer of Rust-like ownership and borrowing semantics to Julia to improve memory safety of user code. Before making an official announcement or releasi…

---

## [Unexpected coalesced group behaviour in CUDA.jl](https://discourse.julialang.org/t/unexpected-coalesced-group-behaviour-in-cuda-jl/125109)

<div class="topic-metadata">

**Author:** [@eldee](https://discourse.julialang.org/u/eldee)\
**Replies:** 3\
**Last updated:** [January 25, 2025, 8:07am UTC](https://discourse.julialang.org/t/unexpected-coalesced-group-behaviour-in-cuda-jl/125109 "2025-01-25T08:07:31Z")

</div>

Hi, When experimenting a bit with cooperative groups and in particular coalesced groups, I’ve encountered some strange behaviour which I cannot explain. As a simple example, consider using CUDA using CUDA: i32 functio…

---

## [Naming convention for functions when an argument is optionally mutated](https://discourse.julialang.org/t/naming-convention-for-functions-when-an-argument-is-optionally-mutated/125180)

<div class="topic-metadata">

**Author:** [@frankwswang](https://discourse.julialang.org/u/frankwswang)\
**Replies:** 5\
**Last updated:** [January 25, 2025, 4:20am UTC](https://discourse.julialang.org/t/naming-convention-for-functions-when-an-argument-is-optionally-mutated/125180 "2025-01-25T04:20:35Z")

</div>

I have a function f with a signature: f(x, y, cache::Union{T1, T2}) where cache will be mutated (modified) when it’s of type T1 and not mutated when it’s of type T2. The type of cache is determined by the combinations …

---

## [Is it possible to do topology optimization with JuMP.jl?](https://discourse.julialang.org/t/is-it-possible-to-do-topology-optimization-with-jump-jl/125075)

<div class="topic-metadata">

**Author:** [@maphdze](https://discourse.julialang.org/u/maphdze)\
**Replies:** 4\
**Last updated:** [January 24, 2025, 10:49pm UTC](https://discourse.julialang.org/t/is-it-possible-to-do-topology-optimization-with-jump-jl/125075 "2025-01-24T22:49:30Z")

</div>

Hello everyone! I would like to know if it is possible to do topology optimization with JuMP.jl? For topology optimization problems the stiffness matrix changes in each step, could this be formulated in JuMP.jl? In the t…

---

## [Custom array type that defaults to views when sliced?](https://discourse.julialang.org/t/custom-array-type-that-defaults-to-views-when-sliced/125158)

<div class="topic-metadata">

**Author:** [@johnomotani](https://discourse.julialang.org/u/johnomotani)\
**Replies:** 6\
**Last updated:** [January 24, 2025, 7:31pm UTC](https://discourse.julialang.org/t/custom-array-type-that-defaults-to-views-when-sliced/125158 "2025-01-24T19:31:38Z")

</div>

I’m thinking about making a custom array type that defaults to creating a view when sliced. Is this a bad idea? Would it break things (if so, what things)? For clarity, this question is definitely not to resurrect the d…

---

## [Invalidating the generator of a \`@generated\` function](https://discourse.julialang.org/t/invalidating-the-generator-of-a-generated-function/125164)

<div class="topic-metadata">

**Author:** [@K11BN367](https://discourse.julialang.org/u/K11BN367)\
**Replies:** 1\
**Last updated:** [January 24, 2025, 1:03pm UTC](https://discourse.julialang.org/t/invalidating-the-generator-of-a-generated-function/125164 "2025-01-24T13:03:18Z")

</div>

Hello, i started to investigate the julia internals a bit and toyed around with some code that tries to invalidate the generator of a ‘@generated’ function. I came up with the following code: import Core.Compiler.Meth…

---

## [O.O.P in Julia](https://discourse.julialang.org/t/o-o-p-in-julia/124957)

<div class="topic-metadata">

**Author:** [@Gilles\_Dubois](https://discourse.julialang.org/u/Gilles_Dubois)\
**Replies:** 25\
**Last updated:** [January 24, 2025, 4:26pm UTC](https://discourse.julialang.org/t/o-o-p-in-julia/124957 "2025-01-24T16:26:53Z")

</div>

Hello everybody, I already used the ‘struct’ as an equivalent of class (say for Python or C++, or …) but I didn’t find what is the trick of Julia to emulate the ‘class-variable’ that is the variable which belongs to all…

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

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