# Latest

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

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

**Page:** 392

---

## [Method Error for ForwardDiff.hessian when ForwardDiff.Jacobian and ForwardDiff.gradient works perfectly fine. How to resolve?](https://discourse.julialang.org/t/method-error-for-forwarddiff-hessian-when-forwarddiff-jacobian-and-forwarddiff-gradient-works-perfectly-fine-how-to-resolve/115152)

<div class="topic-metadata">

**Author:** [@ij05](https://discourse.julialang.org/u/ij05)\
**Replies:** 18\
**Last updated:** [June 7, 2024, 11:09pm UTC](https://discourse.julialang.org/t/method-error-for-forwarddiff-hessian-when-forwarddiff-jacobian-and-forwarddiff-gradient-works-perfectly-fine-how-to-resolve/115152 "2024-06-07T23:09:26Z")

</div>

Hello all, This conversation is in continuation with the conversation I had here. I wanted to find the partial double and mixed derivatives of the variables c1,c2 and c3 with respect to the two variables theta and psi. …

---

## [Insert package version number at top of documentation](https://discourse.julialang.org/t/insert-package-version-number-at-top-of-documentation/115350)

<div class="topic-metadata">

**Author:** [@loisel](https://discourse.julialang.org/u/loisel)\
**Replies:** 2\
**Last updated:** [June 7, 2024, 9:48pm UTC](https://discourse.julialang.org/t/insert-package-version-number-at-top-of-documentation/115350 "2024-06-07T21:48:42Z")

</div>

Hello, I like to have the version number of the package included in the documentation, so that you can immediately tell if you’re reading the right version of the documentation. To do this, I’ve put the following near t…

---

## [Pyplot in Julia PyError](https://discourse.julialang.org/t/pyplot-in-julia-pyerror/115310)

<div class="topic-metadata">

**Author:** [@Sihyun\_Kim](https://discourse.julialang.org/u/Sihyun_Kim)\
**Replies:** 7\
**Last updated:** [June 7, 2024, 8:33pm UTC](https://discourse.julialang.org/t/pyplot-in-julia-pyerror/115310 "2024-06-07T20:33:59Z")

</div>

Python and matplotlib are installed in anaconda 3. I am trying to import it to julia. I type in repl: using PyPlot Then It shows the following message: \[ Info: Installing matplotlib via the Conda matplotlib package...…

---

## [Is there a possibility of transcoding QNDF?](https://discourse.julialang.org/t/is-there-a-possibility-of-transcoding-qndf/114757)

<div class="topic-metadata">

**Author:** [@Pugolas](https://discourse.julialang.org/u/Pugolas)\
**Replies:** 4\
**Last updated:** [June 7, 2024, 6:42pm UTC](https://discourse.julialang.org/t/is-there-a-possibility-of-transcoding-qndf/114757 "2024-06-07T18:42:15Z")

</div>

I am currently working on a \*\*C++\*\*project that requires solving large rigid differential equations. I have learned that QNDF in OrdinariDiffEq.jl is very good at it. Is it possible to complete code conversion based on o…

---

## [Confusing behaviour of include("source.jl") in parallel codes](https://discourse.julialang.org/t/confusing-behaviour-of-include-source-jl-in-parallel-codes/115295)

<div class="topic-metadata">

**Author:** [@singularity](https://discourse.julialang.org/u/singularity)\
**Replies:** 6\
**Last updated:** [June 7, 2024, 6:40pm UTC](https://discourse.julialang.org/t/confusing-behaviour-of-include-source-jl-in-parallel-codes/115295 "2024-06-07T18:40:46Z")

</div>

Julia’s rules when writing parallelized codes have caused a lot of frustration since I started using Julia many years ago. I have encountered another issue today. When using @everywhere workers() with the include("source…

---

## [Failing to precompile OptimizationBase](https://discourse.julialang.org/t/failing-to-precompile-optimizationbase/114926)

<div class="topic-metadata">

**Author:** [@PetrosStefanou](https://discourse.julialang.org/u/PetrosStefanou)\
**Replies:** 32\
**Last updated:** [June 7, 2024, 4:47pm UTC](https://discourse.julialang.org/t/failing-to-precompile-optimizationbase/114926 "2024-06-07T16:47:07Z")

</div>

Hi everyone, I am getting a precompilation error when trying to using Optimization. I am not sure how to interpret the error message I am getting. The problem is that precompilation is triggered and fails every time, …

---

## [Encountering Method error when using abs2 function on a Complex{Num}](https://discourse.julialang.org/t/encountering-method-error-when-using-abs2-function-on-a-complex-num/115341)

<div class="topic-metadata">

**Author:** [@vikram\_backup](https://discourse.julialang.org/u/vikram_backup)\
**Replies:** 2\
**Last updated:** [June 7, 2024, 4:00pm UTC](https://discourse.julialang.org/t/encountering-method-error-when-using-abs2-function-on-a-complex-num/115341 "2024-06-07T16:00:34Z")

</div>

I have published my code here: GitHub - VikramD2k/Hydrogen-Atom-Simulator: This computes and plots the probability density of any orbital of the hydrogen atom and I am also pasting my code down below ## using Symbolics…

---

## [Type instability when solving ODEProblem](https://discourse.julialang.org/t/type-instability-when-solving-odeproblem/105687)

<div class="topic-metadata">

**Author:** [@albertomercurio](https://discourse.julialang.org/u/albertomercurio)\
**Replies:** 3\
**Last updated:** [June 7, 2024, 3:57pm UTC](https://discourse.julialang.org/t/type-instability-when-solving-odeproblem/105687 "2024-06-07T15:57:26Z")

</div>

Hello, in the following I show a minimal working example of the problem. I want to implement a type stable function that solves an ODE. But I figured out that the solve function returns Any type. This is the minimal code…

---

## [Documentation PR learning curve still too steep](https://discourse.julialang.org/t/documentation-pr-learning-curve-still-too-steep/115031)

<div class="topic-metadata">

**Author:** [@Nathan\_Boyer](https://discourse.julialang.org/u/Nathan_Boyer)\
**Replies:** 9\
**Last updated:** [June 7, 2024, 3:35pm UTC](https://discourse.julialang.org/t/documentation-pr-learning-curve-still-too-steep/115031 "2024-06-07T15:35:12Z")

</div>

Continuing the discussion from Lowering the bar for beginner contributions. I have more experience with PRs since that post two years ago, but I still flub it up over half the time. At the risk of looking like a fool, …

---

## [Error while installing Packages](https://discourse.julialang.org/t/error-while-installing-packages/115068)

<div class="topic-metadata">

**Author:** [@fsadu](https://discourse.julialang.org/u/fsadu)\
**Replies:** 12\
**Last updated:** [June 7, 2024, 3:33pm UTC](https://discourse.julialang.org/t/error-while-installing-packages/115068 "2024-06-07T15:33:41Z")

</div>

Hi I am new to Julia. When I try to install several packages (JuMP, CSV, …) with import Pkg Pkg.add(“JuMP”) I get Resolving package versions… ERROR: cannot find name corresponding to UUID 8bb1440f-4735-579b-a4ab-40…

---

## [How to maximize a scalar function of a scalar argument?](https://discourse.julialang.org/t/how-to-maximize-a-scalar-function-of-a-scalar-argument/115318)

<div class="topic-metadata">

**Author:** [@homocomputeris](https://discourse.julialang.org/u/homocomputeris)\
**Replies:** 1\
**Last updated:** [June 7, 2024, 12:24pm UTC](https://discourse.julialang.org/t/how-to-maximize-a-scalar-function-of-a-scalar-argument/115318 "2024-06-07T12:24:53Z")

</div>

I want to maximize a scala function, say NMaximize\[{1/(x - 1), -10 \< x \< 0}, {x}\] I tried: module test using Optimization, OptimizationOptimJL, NonlinearSolve function f(x, p) return 1 / (x - 1) end u0 = -0.5 p …

---

## [Why is usage of llvmcall so restricted?](https://discourse.julialang.org/t/why-is-usage-of-llvmcall-so-restricted/115274)

<div class="topic-metadata">

**Author:** [@aramend](https://discourse.julialang.org/u/aramend)\
**Replies:** 12\
**Last updated:** [June 7, 2024, 2:56pm UTC](https://discourse.julialang.org/t/why-is-usage-of-llvmcall-so-restricted/115274 "2024-06-07T14:56:33Z")

</div>

Hi all. I would otherwise post in Internals & Design but I’m not allowed to. So I’ve looked around the discourse and elsewhere but would still like to better know why llvmcall works the way it does, and if there are othe…

---

## [\`MPI.jl\` RMA function's usage](https://discourse.julialang.org/t/mpi-jl-rma-functions-usage/115328)

<div class="topic-metadata">

**Author:** [@Devansh1106](https://discourse.julialang.org/u/Devansh1106)\
**Replies:** 11\
**Last updated:** [June 7, 2024, 2:39pm UTC](https://discourse.julialang.org/t/mpi-jl-rma-functions-usage/115328 "2024-06-07T14:39:35Z")

</div>

using MPI MPI.Init() comm = MPI.COMM\_WORLD rank = MPI.Comm\_rank(MPI.COMM\_WORLD) size = MPI.Comm\_size(MPI.COMM\_WORLD) buf = fill(0, 10) win = MPI.MPI\_Win MPI.API.MPI\_Win\_allocate(10\*sizeof(Int), sizeof(Int), MPI.INFO\_NU…

---

## [How is memory allocated for a vector of structs?](https://discourse.julialang.org/t/how-is-memory-allocated-for-a-vector-of-structs/115314)

<div class="topic-metadata">

**Author:** [@fmario](https://discourse.julialang.org/u/fmario)\
**Replies:** 9\
**Last updated:** [June 7, 2024, 2:31pm UTC](https://discourse.julialang.org/t/how-is-memory-allocated-for-a-vector-of-structs/115314 "2024-06-07T14:31:54Z")

</div>

Say we have a mutable struct like this: mutable struct Foo a::Int b::Int end I have to allocate many of these structs. In C, I would allocate them all at once in an array, instead of using malloc to allocate e…

---

## [Looping through timeseries points of voronoi](https://discourse.julialang.org/t/looping-through-timeseries-points-of-voronoi/115294)

<div class="topic-metadata">

**Author:** [@Manasa\_S](https://discourse.julialang.org/u/Manasa_S)\
**Replies:** 6\
**Last updated:** [June 7, 2024, 2:09pm UTC](https://discourse.julialang.org/t/looping-through-timeseries-points-of-voronoi/115294 "2024-06-07T14:09:47Z")

</div>

Hi, I want to loop through the voronoi triangles, get their (x,y) cordinates and then check for the density values which i have in a form of 2d array. How can i do that? This is my code: using Distributions mean\_signa…

---

## [Effect of typing in structures](https://discourse.julialang.org/t/effect-of-typing-in-structures/115331)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 4\
**Last updated:** [June 7, 2024, 2:01pm UTC](https://discourse.julialang.org/t/effect-of-typing-in-structures/115331 "2024-06-07T14:01:13Z")

</div>

I have a package which contains a couple of structures that are essential to the package’s functionality. There has been a question of how to handle unknown/parametric types. Basically, to my knowledge, there are three a…

---

## [Interacting\_pairs() for EventQueueABM](https://discourse.julialang.org/t/interacting-pairs-for-eventqueueabm/115332)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 0\
**Last updated:** [June 7, 2024, 1:28pm UTC](https://discourse.julialang.org/t/interacting-pairs-for-eventqueueabm/115332 "2024-06-07T13:28:22Z")

</div>

Hello, I’m trying to modify interacting\_pairs() function for EventQueueABM model which only looks for true pairs. As EventQueueABM doesn’t have Scheduler. So, I replaced it with allids(model). Now this does give pairs b…

---

## [Is the flag --project expected to activate/instantiate?](https://discourse.julialang.org/t/is-the-flag-project-expected-to-activate-instantiate/115265)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 7\
**Last updated:** [June 7, 2024, 1:44pm UTC](https://discourse.julialang.org/t/is-the-flag-project-expected-to-activate-instantiate/115265 "2024-06-07T13:44:25Z")

</div>

I run julia as julia --project=., and I get So it looks like just using this command line flag did not cause activate/instantiate to run. Is that expected?

---

## [How to plot isosurfaces of complex scalar fields?](https://discourse.julialang.org/t/how-to-plot-isosurfaces-of-complex-scalar-fields/115293)

<div class="topic-metadata">

**Author:** [@jagot](https://discourse.julialang.org/u/jagot)\
**Replies:** 0\
**Last updated:** [June 6, 2024, 7:21pm UTC](https://discourse.julialang.org/t/how-to-plot-isosurfaces-of-complex-scalar-fields/115293 "2024-06-06T19:21:05Z")

</div>

I would like to plot isosurfaces of a complex-valued scalar field. This is commonly used to visualize atomic and molecular orbitals, where the isosurfaces are taken at some specified magnitudes of the underlying scalar f…

---

## [How to make a random selection keeping minimum distance between values](https://discourse.julialang.org/t/how-to-make-a-random-selection-keeping-minimum-distance-between-values/115315)

<div class="topic-metadata">

**Author:** [@VinodV](https://discourse.julialang.org/u/VinodV)\
**Replies:** 3\
**Last updated:** [June 7, 2024, 12:12pm UTC](https://discourse.julialang.org/t/how-to-make-a-random-selection-keeping-minimum-distance-between-values/115315 "2024-06-07T12:12:34Z")

</div>

m = 100 n = 10 b = rand(1:m,n) b = sort(b) I want the minimum distance between adjacent values of b to be \>= 2. How can I do that. I have tried b = rand(1:m,n) while true if lengt…

---

## [Behaviour of Ref?](https://discourse.julialang.org/t/behaviour-of-ref/115321)

<div class="topic-metadata">

**Author:** [@dmolina](https://discourse.julialang.org/u/dmolina)\
**Replies:** 1\
**Last updated:** [June 7, 2024, 12:08pm UTC](https://discourse.julialang.org/t/behaviour-of-ref/115321 "2024-06-07T12:08:19Z")

</div>

Hello everybody, I am trying to use Ref to change a variable, and it does not work as expected (at least, as I expected). julia\> a = 5 5 julia\> typeof(a) Int64 julia\> b = Ref(a) Base.RefValue{Int64}(5) julia\> typeof…

---

## [Strange performance problem](https://discourse.julialang.org/t/strange-performance-problem/115227)

<div class="topic-metadata">

**Author:** [@0samuraiE](https://discourse.julialang.org/u/0samuraiE)\
**Replies:** 14\
**Last updated:** [June 7, 2024, 9:12am UTC](https://discourse.julialang.org/t/strange-performance-problem/115227 "2024-06-07T09:12:00Z")

</div>

Hi all, I am new to this forum. Nice to meet you. Today I encouted a strange performance problem. I benchmarked below codes with Benchmarktools. NG = 2 N = NX = NY = NZ = 256 U = rand!(zeros(N + 2NG, N + 2NG, N + 2NG)…

---

## [Multiple dispatch doesn't find the correct method using \`Type\`](https://discourse.julialang.org/t/multiple-dispatch-doesnt-find-the-correct-method-using-type/115247)

<div class="topic-metadata">

**Author:** [@filchristou](https://discourse.julialang.org/u/filchristou)\
**Replies:** 11\
**Last updated:** [June 7, 2024, 8:38am UTC](https://discourse.julialang.org/t/multiple-dispatch-doesnt-find-the-correct-method-using-type/115247 "2024-06-07T08:38:11Z")

</div>

I am in a confusing situation where I cannot find out why a method is not found. Since it’s hard to explain I will directly post the MWE. using Test abstract type RSAState end abstract type RSAAction end abstract type…

---

## [Sample dependent variables in Turing](https://discourse.julialang.org/t/sample-dependent-variables-in-turing/114993)

<div class="topic-metadata">

**Author:** [@swsw](https://discourse.julialang.org/u/swsw)\
**Replies:** 7\
**Last updated:** [June 7, 2024, 8:31am UTC](https://discourse.julialang.org/t/sample-dependent-variables-in-turing/114993 "2024-06-07T08:31:35Z")

</div>

I’d like to sample two variables X1 ~ Uniform(0,1) and X2 ~ Uniform(0, X1) using Turing @model function model() X1 ~ Uniform(1e-5, 1) X2 ~ Uniform(0, X1) end my\_model = model(); sample(my\_model, NUTS(), 10000) …

---

## [Suggestion: Allow type variables with \`do\` syntax](https://discourse.julialang.org/t/suggestion-allow-type-variables-with-do-syntax/115276)

<div class="topic-metadata">

**Author:** [@sgaure](https://discourse.julialang.org/u/sgaure)\
**Replies:** 3\
**Last updated:** [June 7, 2024, 7:54am UTC](https://discourse.julialang.org/t/suggestion-allow-type-variables-with-do-syntax/115276 "2024-06-07T07:54:47Z")

</div>

It came up in Do-Block Syntax with Where Keyword - #16 by sgaure whether it was possible to use type variables in anonymous functions created with the do syntax. Although I do not think it would solve the particular prob…

---

## [\[ANN\] Training course “Julia for HPC” in Stuttgart, Germany on Sept 10-13, 2024](https://discourse.julialang.org/t/ann-training-course-julia-for-hpc-in-stuttgart-germany-on-sept-10-13-2024/115311)

<div class="topic-metadata">

**Author:** [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Replies:** 0\
**Last updated:** [June 7, 2024, 7:44am UTC](https://discourse.julialang.org/t/ann-training-course-julia-for-hpc-in-stuttgart-germany-on-sept-10-13-2024/115311 "2024-06-07T07:44:13Z")

</div>

After the great positive feedback of the last two years, there will be another opportunity to learn more about using Julia for high-performance computing this fall! In collaboration with the High-Performance Computing C…

---

## [Do-Block Syntax with Where Keyword](https://discourse.julialang.org/t/do-block-syntax-with-where-keyword/115131)

<div class="topic-metadata">

**Author:** [@PatrickHaecker](https://discourse.julialang.org/u/PatrickHaecker)\
**Replies:** 16\
**Last updated:** [June 7, 2024, 6:46am UTC](https://discourse.julialang.org/t/do-block-syntax-with-where-keyword/115131 "2024-06-07T06:46:28Z")

</div>

I want to use a finalizer for a parametric type using the type parameter in the finalizer. I have a solution for that, but I wondered whether I can use the do syntax, but I simply do not know where the where needs to be …

---

## [Is there a simple way to differentiate multiple lines with sparse markers?](https://discourse.julialang.org/t/is-there-a-simple-way-to-differentiate-multiple-lines-with-sparse-markers/115307)

<div class="topic-metadata">

**Author:** [@lionisxn](https://discourse.julialang.org/u/lionisxn)\
**Replies:** 6\
**Last updated:** [June 7, 2024, 6:31am UTC](https://discourse.julialang.org/t/is-there-a-simple-way-to-differentiate-multiple-lines-with-sparse-markers/115307 "2024-06-07T06:31:28Z")

</div>

Hi, I have a multiple-line plot like this The figure is ugly owing to the unnecessary markers for each data point. How can I differentiate the two lines with less markers?

---

## [Building Julia for Nix](https://discourse.julialang.org/t/building-julia-for-nix/115304)

<div class="topic-metadata">

**Author:** [@MilesCranmer](https://discourse.julialang.org/u/MilesCranmer)\
**Replies:** 14\
**Last updated:** [June 7, 2024, 5:44am UTC](https://discourse.julialang.org/t/building-julia-for-nix/115304 "2024-06-07T05:44:06Z")

</div>

Nix is this nice tool for reproducible builds on Linux and MacOS that I’ve been trying to learn. Currently the main nixpkgs repository only builds Julia on Linux\[1\] (both x86\_64 and aarch64), so I’m trying to add suppor…

---

## [Zygote.hessian of loss function when defining ODEs with modeling toolkit](https://discourse.julialang.org/t/zygote-hessian-of-loss-function-when-defining-odes-with-modeling-toolkit/115302)

<div class="topic-metadata">

**Author:** [@cefitzg](https://discourse.julialang.org/u/cefitzg)\
**Replies:** 1\
**Last updated:** [June 7, 2024, 2:02am UTC](https://discourse.julialang.org/t/zygote-hessian-of-loss-function-when-defining-odes-with-modeling-toolkit/115302 "2024-06-07T02:02:29Z")

</div>

I’m doing parameter estimation on an ODE system, which I define using modelingtoolkit. I need to generate hessian of cost function with respect to parameters to access fit. No issue with parameter estimation. Loss funct…

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

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