# Latest

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

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

**Page:** 442

---

## [Concise way to initialize field in terms of another field](https://discourse.julialang.org/t/concise-way-to-initialize-field-in-terms-of-another-field/112536)

<div class="topic-metadata">

**Author:** [@Stephen\_Vavasis](https://discourse.julialang.org/u/Stephen_Vavasis)\
**Replies:** 6\
**Last updated:** [April 5, 2024, 3:53pm UTC](https://discourse.julialang.org/t/concise-way-to-initialize-field-in-terms-of-another-field/112536 "2024-04-05T15:53:32Z")

</div>

Suppose I have: Base.@kwdef struct Example a::Int b::Int end I would like the initialization of b to refer to the initial value of a, but the following does not work: x = Example(a = 6, b = a+9) because the “a…

---

## [Dot products: a'b or a'\*b](https://discourse.julialang.org/t/dot-products-ab-or-a-b/112572)

<div class="topic-metadata">

**Author:** [@martin\_sanchez](https://discourse.julialang.org/u/martin_sanchez)\
**Replies:** 2\
**Last updated:** [April 5, 2024, 3:49pm UTC](https://discourse.julialang.org/t/dot-products-ab-or-a-b/112572 "2024-04-05T15:49:08Z")

</div>

If I run a=randn(10^8) b=randn(10^8) @time s=a'b the time it takes is 0.129 seconds and it says (22.98 k allocations: 1.613 MiB, 31.73% compilation time) 74.59337300358766. If in the last step I say @time s=a'\*b I …

---

## [\[ANN\] SummaryTables.jl & WriteDocx.jl](https://discourse.julialang.org/t/ann-summarytables-jl-writedocx-jl/112240)

<div class="topic-metadata">

**Author:** [@jules](https://discourse.julialang.org/u/jules)\
**Replies:** 9\
**Last updated:** [April 5, 2024, 3:39pm UTC](https://discourse.julialang.org/t/ann-summarytables-jl-writedocx-jl/112240 "2024-04-05T15:39:49Z")

</div>

The development team at PumasAI is happy to announce the open-source release of two packages: SummaryTables.jl for generating publication-ready tables in HTML, docx, LaTeX and Typst. We wrote SummaryTables fr…

---

## [Turing: Posterior Prediction](https://discourse.julialang.org/t/turing-posterior-prediction/111072)

<div class="topic-metadata">

**Author:** [@Sam\_P](https://discourse.julialang.org/u/Sam_P)\
**Replies:** 6\
**Last updated:** [April 5, 2024, 3:22pm UTC](https://discourse.julialang.org/t/turing-posterior-prediction/111072 "2024-04-05T15:22:36Z")

</div>

Hi, I’ve been trying to use the predict function in Turing for Posterior Prediction as per here: https://discourse.julialang.org/t/ann-turing-0-13-0-mle-map-and-prediction/40033#prediction-2 Based on that, I tried appl…

---

## [Challenges with Zygote Differentiation in Multivariate Mixture Models as input noise of an implicit machine learning method](https://discourse.julialang.org/t/challenges-with-zygote-differentiation-in-multivariate-mixture-models-as-input-noise-of-an-implicit-machine-learning-method/112560)

<div class="topic-metadata">

**Author:** [@josemanuel22](https://discourse.julialang.org/u/josemanuel22)\
**Replies:** 10\
**Last updated:** [April 5, 2024, 2:23pm UTC](https://discourse.julialang.org/t/challenges-with-zygote-differentiation-in-multivariate-mixture-models-as-input-noise-of-an-implicit-machine-learning-method/112560 "2024-04-05T14:23:25Z")

</div>

The following implicit machine learning method works well when the input noise is, for example, a multidimensional Gaussian function sliced\_invariant\_statistical\_loss\_optimized\_2(nn\_model, loader, hparams) @assert l…

---

## [Trying to solve KU=F, FEA problem, with roughly 5-10million DOFs](https://discourse.julialang.org/t/trying-to-solve-ku-f-fea-problem-with-roughly-5-10million-dofs/112480)

<div class="topic-metadata">

**Author:** [@balaji\_sriram](https://discourse.julialang.org/u/balaji_sriram)\
**Replies:** 7\
**Last updated:** [April 5, 2024, 2:20pm UTC](https://discourse.julialang.org/t/trying-to-solve-ku-f-fea-problem-with-roughly-5-10million-dofs/112480 "2024-04-05T14:20:48Z")

</div>

Hi, Im new to Julia, but i have experience with MATLAB, im trying to solve a KU=F, FEA type problem , with over 1 million DOFs. Note: the K matrix is sparse, symmetric, positive definite and banded. In matlab, the comman…

---

## [\`@kwdef\` with \`const\` in mutable struct triggering "Missing Reference"](https://discourse.julialang.org/t/kwdef-with-const-in-mutable-struct-triggering-missing-reference/112561)

<div class="topic-metadata">

**Author:** [@sstroemer](https://discourse.julialang.org/u/sstroemer)\
**Replies:** 3\
**Last updated:** [April 5, 2024, 1:41pm UTC](https://discourse.julialang.org/t/kwdef-with-const-in-mutable-struct-triggering-missing-reference/112561 "2024-04-05T13:41:32Z")

</div>

Why does @kwdef mutable struct MyStruct const x::Float64 = 1.0 end trigger a Missing reference: x? (using the standard VSCode extension)

---

## [Recommended equivalent to map / broadcast on GroupedDataFrame](https://discourse.julialang.org/t/recommended-equivalent-to-map-broadcast-on-groupeddataframe/110819)

<div class="topic-metadata">

**Author:** [@jeremiedb](https://discourse.julialang.org/u/jeremiedb)\
**Replies:** 4\
**Last updated:** [April 5, 2024, 1:11pm UTC](https://discourse.julialang.org/t/recommended-equivalent-to-map-broadcast-on-groupeddataframe/110819 "2024-04-05T13:11:59Z")

</div>

If we have function f1 that takes a DataFrame as an argument and returns a scalar, how can a reduction operation using f1 be applied over each SubDataFrame of a grouped dataframe? using DataFrames # reduce function f1(…

---

## [Trying to read from a HDF5 file and convert to another format in parallel?](https://discourse.julialang.org/t/trying-to-read-from-a-hdf5-file-and-convert-to-another-format-in-parallel/112479)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 17\
**Last updated:** [April 5, 2024, 10:50am UTC](https://discourse.julialang.org/t/trying-to-read-from-a-hdf5-file-and-convert-to-another-format-in-parallel/112479 "2024-04-05T10:50:51Z")

</div>

Hello! Using HDF5.jl I have constructed a .h5 file with multiple groups, with the keys, “0”, “1”, “2” up to “401”. I wish to read in data in parallel and convert to another format. I have tried to used such as loop: …

---

## [Julia in VS Code](https://discourse.julialang.org/t/julia-in-vs-code/112546)

<div class="topic-metadata">

**Author:** [@maggiwu](https://discourse.julialang.org/u/maggiwu)\
**Replies:** 5\
**Last updated:** [April 5, 2024, 10:27am UTC](https://discourse.julialang.org/t/julia-in-vs-code/112546 "2024-04-05T10:27:38Z")

</div>

Im trying to run a Julia Script in VS Code - However, it doesnt work as this error message appears “Could not start the Julia language server. Make sure the julia.executablePath setting is valid.” I dont know why its no…

---

## [Help to formulate an ODE problem to use OrdinaryDiffEq](https://discourse.julialang.org/t/help-to-formulate-an-ode-problem-to-use-ordinarydiffeq/112494)

<div class="topic-metadata">

**Author:** [@Iddingsite](https://discourse.julialang.org/u/Iddingsite)\
**Replies:** 4\
**Last updated:** [April 5, 2024, 8:31am UTC](https://discourse.julialang.org/t/help-to-formulate-an-ode-problem-to-use-ordinarydiffeq/112494 "2024-04-05T08:31:24Z")

</div>

Hi everyone, For one of my problem, I need to solve this ODE backwards: \\frac{dX}{dt} = a(X(t),t), \\\\ X(t^{n+1}) = X\_g where X is the position of a marker (could be 1d, 2d or 3d), a(X(t),t) is a velocity vector and X…

---

## [Running independent variable-length simulations on busy Slurm cluster](https://discourse.julialang.org/t/running-independent-variable-length-simulations-on-busy-slurm-cluster/112162)

<div class="topic-metadata">

**Author:** [@Sevi](https://discourse.julialang.org/u/Sevi)\
**Replies:** 2\
**Last updated:** [April 5, 2024, 7:40am UTC](https://discourse.julialang.org/t/running-independent-variable-length-simulations-on-busy-slurm-cluster/112162 "2024-04-05T07:40:19Z")

</div>

I’m running Julia code on a Slurm cluster, but this question is not entirely specific to Julia. I hope it’s OK to post it here anyway (I am also fine with a Julia-specific solution): Problem Suppose we have a large numb…

---

## [Differentiability of functions that have integer outputs](https://discourse.julialang.org/t/differentiability-of-functions-that-have-integer-outputs/112520)

<div class="topic-metadata">

**Author:** [@Arijit\_Bhattacharya](https://discourse.julialang.org/u/Arijit_Bhattacharya)\
**Replies:** 6\
**Last updated:** [April 5, 2024, 6:55am UTC](https://discourse.julialang.org/t/differentiability-of-functions-that-have-integer-outputs/112520 "2024-04-05T06:55:00Z")

</div>

Question: I’m currently implementing an Immersed Boundary Method (IBM) in Julia, and I’ve written a function to compute interpolation weights for IBM forcing. I want my IBM code to be differentiable for which I will be u…

---

## [Matlab's matmul much faster than julia's](https://discourse.julialang.org/t/matlabs-matmul-much-faster-than-julias/112476)

<div class="topic-metadata">

**Author:** [@yhuang](https://discourse.julialang.org/u/yhuang)\
**Replies:** 6\
**Last updated:** [April 5, 2024, 6:54am UTC](https://discourse.julialang.org/t/matlabs-matmul-much-faster-than-julias/112476 "2024-04-05T06:54:34Z")

</div>

Hey, I observed that on my machine matlab’s matmul faster than julia’s. I am quite confused since it seems I have already aligned all the different factors. Here is a minimal working example. Julia code: using MKL us…

---

## [Gridap function list and explanations](https://discourse.julialang.org/t/gridap-function-list-and-explanations/112559)

<div class="topic-metadata">

**Author:** [@Mishal](https://discourse.julialang.org/u/Mishal)\
**Replies:** 0\
**Last updated:** [April 5, 2024, 6:23am UTC](https://discourse.julialang.org/t/gridap-function-list-and-explanations/112559 "2024-04-05T06:23:16Z")

</div>

Hi Guys Does anyone know a good source which explains the Gridap functions? In the below link many of the functions do not have explanations and it is sometimes hard to follow with the examples. Gridap Functions TestF…

---

## [Monte Carlo simulation and probabilistic programming packages](https://discourse.julialang.org/t/monte-carlo-simulation-and-probabilistic-programming-packages/111408)

<div class="topic-metadata">

**Author:** [@askvorts](https://discourse.julialang.org/u/askvorts)\
**Replies:** 3\
**Last updated:** [April 5, 2024, 6:12am UTC](https://discourse.julialang.org/t/monte-carlo-simulation-and-probabilistic-programming-packages/111408 "2024-04-05T06:12:11Z")

</div>

I’m trying to find Julia packages to perform (financial) quantitative analysis under uncertainty, typicaly by Monte Carlo simulation. Somewhat similar to Oracle Crystal Ball or Palisade @RISK. Found MCHammer.jl that seem…

---

## [Loaded v1.10.2; receiving LoadError: MethodError: no method matching var"@agent](https://discourse.julialang.org/t/loaded-v1-10-2-receiving-loaderror-methoderror-no-method-matching-var-agent/112549)

<div class="topic-metadata">

**Author:** [@tfranks](https://discourse.julialang.org/u/tfranks)\
**Replies:** 7\
**Last updated:** [April 5, 2024, 3:34am UTC](https://discourse.julialang.org/t/loaded-v1-10-2-receiving-loaderror-methoderror-no-method-matching-var-agent/112549 "2024-04-05T03:34:38Z")

</div>

Hello, I’ve installed the latest version 1.10.2 and using the predator-prey example. When I run my code (shown below) and the predator-prey code, both get the same error message: LoadError: MethodError: no method matc…

---

## [Fixing the Piping/Chaining Issue (Rev 3)](https://discourse.julialang.org/t/fixing-the-piping-chaining-issue-rev-3/90836)

<div class="topic-metadata">

**Author:** [@uniment](https://discourse.julialang.org/u/uniment)\
**Replies:** 89\
**Last updated:** [April 5, 2024, 3:13am UTC](https://discourse.julialang.org/t/fixing-the-piping-chaining-issue-rev-3/90836 "2024-04-05T03:13:54Z")

</div>

Third time’s (hopefully) the charm :wink: Okay so in contrast with my last two proposals (1, 2) this proposal is less preachy, and more “hey check out this crazy cool thing I did and please offer feedback.” Hopefully it…

---

## [Gradient-based parameter estimation for Catalyst.jl models](https://discourse.julialang.org/t/gradient-based-parameter-estimation-for-catalyst-jl-models/112542)

<div class="topic-metadata">

**Author:** [@dhowsmon](https://discourse.julialang.org/u/dhowsmon)\
**Replies:** 1\
**Last updated:** [April 5, 2024, 3:03am UTC](https://discourse.julialang.org/t/gradient-based-parameter-estimation-for-catalyst-jl-models/112542 "2024-04-05T03:03:48Z")

</div>

Hi, I am trying to estimate parameters/initial conditions in an ODE system built with Catalyst.jl. I first find the steady-state using a callback, and then in a separate simulation I add some input to get my actual desir…

---

## [Code Organization](https://discourse.julialang.org/t/code-organization/112314)

<div class="topic-metadata">

**Author:** [@lancejnelson](https://discourse.julialang.org/u/lancejnelson)\
**Replies:** 20\
**Last updated:** [April 5, 2024, 1:24am UTC](https://discourse.julialang.org/t/code-organization/112314 "2024-04-05T01:24:39Z")

</div>

I’m having a really hard time finding a code structure that works for me. I’m building a pretty big library of interatomic potentials. I’ve broken the code up into several files: One for each of the following sets of t…

---

## [Loading from parent scope in package](https://discourse.julialang.org/t/loading-from-parent-scope-in-package/112434)

<div class="topic-metadata">

**Author:** [@lancejnelson](https://discourse.julialang.org/u/lancejnelson)\
**Replies:** 34\
**Last updated:** [April 4, 2024, 11:07pm UTC](https://discourse.julialang.org/t/loading-from-parent-scope-in-package/112434 "2024-04-04T23:07:29Z")

</div>

I have one package that contains all types and another packages that uses those types. Here is the types package: module MatTypes using LinearAlgebra using StaticArrays include("types.jl") end # module MatTypes and…

---

## [Why does using StaticArrays causes more allocations?](https://discourse.julialang.org/t/why-does-using-staticarrays-causes-more-allocations/112515)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 1\
**Last updated:** [April 4, 2024, 10:27pm UTC](https://discourse.julialang.org/t/why-does-using-staticarrays-causes-more-allocations/112515 "2024-04-04T22:27:51Z")

</div>

I have the following code: using OrdinaryDiffEq, ControlPlots, Sundials, StaticArrays STATIC\_ARRAYS::Bool = true if STATIC\_ARRAYS const G\_EARTH = SA\[0.0, 0.0, -9.81\] # gravitational acceleration else const G\_E…

---

## [Multiple dispatch](https://discourse.julialang.org/t/multiple-dispatch/112541)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 4\
**Last updated:** [April 4, 2024, 8:47pm UTC](https://discourse.julialang.org/t/multiple-dispatch/112541 "2024-04-04T20:47:44Z")

</div>

Is it possible to do a dispatch on a parameter of the types Vector{Float64} and Vector{Vector{Float64}} ?

---

## [Unexpected behavior of vectorized += with duplicate indices](https://discourse.julialang.org/t/unexpected-behavior-of-vectorized-with-duplicate-indices/112537)

<div class="topic-metadata">

**Author:** [@mattwigway](https://discourse.julialang.org/u/mattwigway)\
**Replies:** 4\
**Last updated:** [April 4, 2024, 7:26pm UTC](https://discourse.julialang.org/t/unexpected-behavior-of-vectorized-with-duplicate-indices/112537 "2024-04-04T19:26:33Z")

</div>

I have some code that accumulates a list of indices in a vector that need to be incremented, and then does the incrementing after the fact with vector\[indices\] += increment (I do it this way instead of incrementing as I …

---

## [PlutoUI: Trigger long computation only after user sets many parameters and confirms](https://discourse.julialang.org/t/plutoui-trigger-long-computation-only-after-user-sets-many-parameters-and-confirms/112475)

<div class="topic-metadata">

**Author:** [@70Gage70](https://discourse.julialang.org/u/70Gage70)\
**Replies:** 7\
**Last updated:** [April 4, 2024, 6:15pm UTC](https://discourse.julialang.org/t/plutoui-trigger-long-computation-only-after-user-sets-many-parameters-and-confirms/112475 "2024-04-04T18:15:31Z")

</div>

Consider the case where you have many e.g. TextFields across many cells which set the parameters for some long computation. You want the user to be able to set all the parameters and not have the long calculation trigge…

---

## [@test\_throws UndefVarError f(x::A)=x](https://discourse.julialang.org/t/test-throws-undefvarerror-f-x-a-x/112497)

<div class="topic-metadata">

**Author:** [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Replies:** 3\
**Last updated:** [April 4, 2024, 5:18pm UTC](https://discourse.julialang.org/t/test-throws-undefvarerror-f-x-a-x/112497 "2024-04-04T17:18:43Z")

</div>

With a fresh Julia session: julia\> using Test julia\> @test\_throws UndefVarError foo(x::A)=x ERROR: UndefVarError: \`A\` not defined Should this be a passing test? I don’t quite get why the UndefVarError escapes the @tes…

---

## [Need help with makie animation](https://discourse.julialang.org/t/need-help-with-makie-animation/112527)

<div class="topic-metadata">

**Author:** [@oddsen](https://discourse.julialang.org/u/oddsen)\
**Replies:** 1\
**Last updated:** [April 4, 2024, 3:54pm UTC](https://discourse.julialang.org/t/need-help-with-makie-animation/112527 "2024-04-04T15:54:56Z")

</div>

This is my code : I want to create an animation or slide illustrating the movement of my points on a sphere as the variable ‘i’ increases from 1 to ‘Stop’. This will allow me to visualize the trajectory of my three p…

---

## [Two ways to get C++ interface class from C API](https://discourse.julialang.org/t/two-ways-to-get-c-interface-class-from-c-api/112522)

<div class="topic-metadata">

**Author:** [@sairus7](https://discourse.julialang.org/u/sairus7)\
**Replies:** 0\
**Last updated:** [April 4, 2024, 1:41pm UTC](https://discourse.julialang.org/t/two-ways-to-get-c-interface-class-from-c-api/112522 "2024-04-04T13:41:09Z")

</div>

Consider simple C++ interface class: ▶ File \`shape.h\` Since Cxx.jl in obsolete, so you cannot generate julia types from C++, and CxxWrap.jl means you have to make changes on C++ side, so I’ve made two C library wrappers …

---

## [Traits and type piracy](https://discourse.julialang.org/t/traits-and-type-piracy/112516)

<div class="topic-metadata">

**Author:** [@pat-alt](https://discourse.julialang.org/u/pat-alt)\
**Replies:** 3\
**Last updated:** [April 4, 2024, 12:27pm UTC](https://discourse.julialang.org/t/traits-and-type-piracy/112516 "2024-04-04T12:27:31Z")

</div>

TLDR: I’m defining a trait in a meta package A and trying to assign the trait in a package B that imports A. This causes type piracy and I don’t know how to resolve it. Background: Inspired by other examples such as MLJ…

---

## [How to transpose Matrix{Any} that contains strings?](https://discourse.julialang.org/t/how-to-transpose-matrix-any-that-contains-strings/112514)

<div class="topic-metadata">

**Author:** [@homocomputeris](https://discourse.julialang.org/u/homocomputeris)\
**Replies:** 3\
**Last updated:** [April 4, 2024, 11:24am UTC](https://discourse.julialang.org/t/how-to-transpose-matrix-any-that-contains-strings/112514 "2024-04-04T11:24:16Z")

</div>

How to transpose Matrix{Any} that contains strings? The obvious way doesn’t work: transpose(\["aoeu", 2\]) 1×2 transpose(::Vector{Any}) with eltype Any: Error showing value of type LinearAlgebra.Transpose{Any, Vector{Any}…

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

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