# General Usage

**URL:** https://discourse.julialang.org/c/usage/6.md?page=48

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

**Page:** 49

---

## [Juliacall / PythonCall array conversion error](https://discourse.julialang.org/t/juliacall-pythoncall-array-conversion-error/131311)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 0\
**Last updated:** [August 3, 2025, 3:06am UTC](https://discourse.julialang.org/t/juliacall-pythoncall-array-conversion-error/131311 "2025-08-03T03:06:57Z")

</div>

I’m using the Python package juliacall to call my Julia code. I encounter sporadic errors from lines that look like this: import numpy as np from juliacall import Main as jl jl.seval("import mypackage") jl\_mypackage = j…

---

## [Julia autocompletion not working in VSCode](https://discourse.julialang.org/t/julia-autocompletion-not-working-in-vscode/107549)

<div class="topic-metadata">

**Author:** [@Maddy](https://discourse.julialang.org/u/Maddy)\
**Replies:** 16\
**Last updated:** [August 3, 2025, 1:25pm UTC](https://discourse.julialang.org/t/julia-autocompletion-not-working-in-vscode/107549 "2025-08-03T13:25:15Z")

</div>

I returned to programming after a few months. VScode seems to have changed. I can’t use Julia with the autocompletion anymore! Please help!!! look! I checked whether they work for python to make sure the problem is …

---

## [Plots with PlotlyJS error](https://discourse.julialang.org/t/plots-with-plotlyjs-error/131303)

<div class="topic-metadata">

**Author:** [@Jake](https://discourse.julialang.org/u/Jake)\
**Replies:** 4\
**Last updated:** [August 2, 2025, 7:31pm UTC](https://discourse.julialang.org/t/plots-with-plotlyjs-error/131303 "2025-08-02T19:31:52Z")

</div>

I am trying to use Plots with the PlotlyJS backend. Using 1.11.6 on Win 11 my code snippet is: using Plots using PlotlyKaleido using PlotlyJS plotlyjs() I get this message: Precompiling PlotlyJS... Info Given Plotly…

---

## [Conversion of inner "flag" type parameters from supertype "flag" type parameters for composite struct construcor](https://discourse.julialang.org/t/conversion-of-inner-flag-type-parameters-from-supertype-flag-type-parameters-for-composite-struct-construcor/131306)

<div class="topic-metadata">

**Author:** [@kunzaatko](https://discourse.julialang.org/u/kunzaatko)\
**Replies:** 3\
**Last updated:** [August 2, 2025, 1:08pm UTC](https://discourse.julialang.org/t/conversion-of-inner-flag-type-parameters-from-supertype-flag-type-parameters-for-composite-struct-construcor/131306 "2025-08-02T13:08:17Z")

</div>

I have a type structure that looks something like this: abstract type AbstractA{T} end struct A1{T} \<: AbstractA{T} end # no field of type \`T\` A1() = A1{Any}() struct A2{T} \<: AbstractA{T} end A2() = A2{Any}() and I wo…

---

## [Custom ForwardDiff rule for ternary function](https://discourse.julialang.org/t/custom-forwarddiff-rule-for-ternary-function/131257)

<div class="topic-metadata">

**Author:** [@jbrea](https://discourse.julialang.org/u/jbrea)\
**Replies:** 2\
**Last updated:** [August 2, 2025, 8:38am UTC](https://discourse.julialang.org/t/custom-forwarddiff-rule-for-ternary-function/131257 "2025-08-02T08:38:49Z")

</div>

I’m trying to define a custom ForwardDiff.jl differentiation rule for the bivariate normal cumulative function BvN(h, k, r). What I did so far works for first derivatives, but it doesn’t work for mixed higher derivatives…

---

## [Possible to make a specific parameterization into a subtype?](https://discourse.julialang.org/t/possible-to-make-a-specific-parameterization-into-a-subtype/84260)

<div class="topic-metadata">

**Author:** [@Stephen\_Vavasis](https://discourse.julialang.org/u/Stephen_Vavasis)\
**Replies:** 2\
**Last updated:** [August 1, 2025, 9:02pm UTC](https://discourse.julialang.org/t/possible-to-make-a-specific-parameterization-into-a-subtype/84260 "2025-08-01T21:02:21Z")

</div>

In the master branch of DataStructures.jl, I have written new iteration methods for the three sorted containers, SortedSet, SortedDict, and SortedMultiDict. The main structure that defines an iteration is: struct Itera…

---

## [Plotting in a different process](https://discourse.julialang.org/t/plotting-in-a-different-process/131300)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 2\
**Last updated:** [August 1, 2025, 8:43pm UTC](https://discourse.julialang.org/t/plotting-in-a-different-process/131300 "2025-08-01T20:43:37Z")

</div>

I want to start a second Julia process with using DistributedNext addprocs(1) and use a plotting library, like @everywhere using ControlPlots (or Plots or whatever you prefer) How can I now create a plot in the seco…

---

## [Multithreading with GC fails](https://discourse.julialang.org/t/multithreading-with-gc-fails/131269)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 8\
**Last updated:** [August 1, 2025, 7:28am UTC](https://discourse.julialang.org/t/multithreading-with-gc-fails/131269 "2025-08-01T07:28:03Z")

</div>

I have the following function: function getMeasurementsP(mx, my, nM, zh, wf::WindFarm, set::Settings, floris::Floris, wind::Wind) size\_mx = size(mx) mz = zeros(size\_mx\[1\], size\_mx\[2\], nM) # Create threa…

---

## [Interesting behaviour with parametric types in inner constructors](https://discourse.julialang.org/t/interesting-behaviour-with-parametric-types-in-inner-constructors/131290)

<div class="topic-metadata">

**Author:** [@jonas-pueschel](https://discourse.julialang.org/u/jonas-pueschel)\
**Replies:** 1\
**Last updated:** [August 1, 2025, 2:02pm UTC](https://discourse.julialang.org/t/interesting-behaviour-with-parametric-types-in-inner-constructors/131290 "2025-08-01T14:02:00Z")

</div>

Hi all, I recently stumbled over an interesting behaviour regarding parametric types used in inner constructors. The short version is, that this code struct TestStruct1{Tx\<:Integer,Ty\<:Float64} x::Tx y::Ty …

---

## [Unexpected allocations when passing types as arguments](https://discourse.julialang.org/t/unexpected-allocations-when-passing-types-as-arguments/131230)

<div class="topic-metadata">

**Author:** [@zmorrell](https://discourse.julialang.org/u/zmorrell)\
**Replies:** 8\
**Last updated:** [July 31, 2025, 5:52pm UTC](https://discourse.julialang.org/t/unexpected-allocations-when-passing-types-as-arguments/131230 "2025-07-31T17:52:52Z")

</div>

I have come across some somewhat unexpected behavior when passing types as arguments to a function. For reference, I am using the current Julia 1.10.10 (the current LTS). I am somewhat unclear what causes this behavior…

---

## [Nested task error on Julia-1.12-rc1](https://discourse.julialang.org/t/nested-task-error-on-julia-1-12-rc1/131256)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 4\
**Last updated:** [July 31, 2025, 4:49pm UTC](https://discourse.julialang.org/t/nested-task-error-on-julia-1-12-rc1/131256 "2025-07-31T16:49:56Z")

</div>

Any idea what is going on here? Enable multithreading · ufechner7/FLORIDyn.jl@f2175f3 · GitHub Testing Running tests... runFLORIDyn - online: Error During Test at /home/runner/work/FLORIDyn.jl/FLORIDyn.jl/test/tes…

---

## [JuliaHealth Meeting (Americas/Europe/Africa) – July 31st, 2025](https://discourse.julialang.org/t/juliahealth-meeting-americas-europe-africa-july-31st-2025/131250)

<div class="topic-metadata">

**Author:** [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Replies:** 0\
**Last updated:** [July 31, 2025, 2:00pm UTC](https://discourse.julialang.org/t/juliahealth-meeting-americas-europe-africa-july-31st-2025/131250 "2025-07-31T14:00:06Z")

</div>

Hi folks! :waving\_hand: After a long hiatus, we are having our monthly JuliaHealth meeting today! I didn’t have time to make a slide deck for this month (JuliaCon and coming home kept me busy!) so we’ll keep things a bi…

---

## [Help with reinterperating result of ccall](https://discourse.julialang.org/t/help-with-reinterperating-result-of-ccall/131227)

<div class="topic-metadata">

**Author:** [@AwesomeQuest](https://discourse.julialang.org/u/AwesomeQuest)\
**Replies:** 8\
**Last updated:** [July 31, 2025, 1:28pm UTC](https://discourse.julialang.org/t/help-with-reinterperating-result-of-ccall/131227 "2025-07-31T13:28:32Z")

</div>

So I have a function in a C library that returns a uint16\_t and I call it something like this (@ccall ".\\\\lib.dll".crc16()::UInt16) However, this gives the wrong result. But (@ccall ".\\\\lib.dll".crc16()::UInt16) |\> x…

---

## [ProfileView warntype\_last() throws error](https://discourse.julialang.org/t/profileview-warntype-last-throws-error/131247)

<div class="topic-metadata">

**Author:** [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Replies:** 0\
**Last updated:** [July 31, 2025, 12:29pm UTC](https://discourse.julialang.org/t/profileview-warntype-last-throws-error/131247 "2025-07-31T12:29:37Z")

</div>

In Julia 1.11, looking to understand sources of type instability, I profile my code: ... # "diffed\_residual", and some variables defined here by a large code base: # no MVE using ProfileView using Profile out = …

---

## [How to extract histogram from @benchmark results](https://discourse.julialang.org/t/how-to-extract-histogram-from-benchmark-results/131245)

<div class="topic-metadata">

**Author:** [@JJMerelo](https://discourse.julialang.org/u/JJMerelo)\
**Replies:** 2\
**Last updated:** [July 31, 2025, 11:23am UTC](https://discourse.julialang.org/t/how-to-extract-histogram-from-benchmark-results/131245 "2025-07-31T11:23:35Z")

</div>

How can we see the histogram results as shown in from the Julia prompt?

---

## [Using the result of NonlinearSolve.jl allocates memory](https://discourse.julialang.org/t/using-the-result-of-nonlinearsolve-jl-allocates-memory/131242)

<div class="topic-metadata">

**Author:** [@Gako](https://discourse.julialang.org/u/Gako)\
**Replies:** 3\
**Last updated:** [July 31, 2025, 10:41am UTC](https://discourse.julialang.org/t/using-the-result-of-nonlinearsolve-jl-allocates-memory/131242 "2025-07-31T10:41:09Z")

</div>

I’m using the following code to try and understand how broadcasting and allocation work in Julia: using NonlinearSolve function nonlin() nonlinprob(x, p) = return x - 3 prob = NonlinearProblem(nonlinprob, 2.) …

---

## [Idea: Mapping Dive Sites with Julia – A Chance to Show Off the Ecosystem](https://discourse.julialang.org/t/idea-mapping-dive-sites-with-julia-a-chance-to-show-off-the-ecosystem/131234)

<div class="topic-metadata">

**Author:** [@andreeco](https://discourse.julialang.org/u/andreeco)\
**Replies:** 1\
**Last updated:** [July 31, 2025, 7:04am UTC](https://discourse.julialang.org/t/idea-mapping-dive-sites-with-julia-a-chance-to-show-off-the-ecosystem/131234 "2025-07-31T07:04:19Z")

</div>

Hi all, I’ve been thinking about a practical and visually engaging way to highlight what Julia can do -especially when it comes to its growing ecosystem of packages. All over the world, some diving spots are described …

---

## [Terribly unoptimized combination of multiset\_permutations() and Iterators.product()](https://discourse.julialang.org/t/terribly-unoptimized-combination-of-multiset-permutations-and-iterators-product/130714)

<div class="topic-metadata">

**Author:** [@jonbir](https://discourse.julialang.org/u/jonbir)\
**Replies:** 9\
**Last updated:** [July 29, 2025, 11:42pm UTC](https://discourse.julialang.org/t/terribly-unoptimized-combination-of-multiset-permutations-and-iterators-product/130714 "2025-07-29T23:42:34Z")

</div>

Since I got great feedback on my first post, I turn to you again with another question. In my larger code base I want to iterate over a special kind of binary matrices. First fact about the binary matrices, they have ex…

---

## [REPL display options (such as shorter vector output)?](https://discourse.julialang.org/t/repl-display-options-such-as-shorter-vector-output/9237)

<div class="topic-metadata">

**Author:** [@ivo\_welch](https://discourse.julialang.org/u/ivo_welch)\
**Replies:** 3\
**Last updated:** [July 30, 2025, 4:32pm UTC](https://discourse.julialang.org/t/repl-display-options-such-as-shorter-vector-output/9237 "2025-07-30T16:32:31Z")

</div>

dear julia experts—does the REPL have options that set some default parameters on how it prints? (think R’s options(digits=10).) In particular, is it possible to get fewer lines for output of long vectors (e.g., rand(1…

---

## [What is closed module?](https://discourse.julialang.org/t/what-is-closed-module/90463)

<div class="topic-metadata">

**Author:** [@wsshin](https://discourse.julialang.org/u/wsshin)\
**Replies:** 6\
**Last updated:** [July 30, 2025, 1:40pm UTC](https://discourse.julialang.org/t/what-is-closed-module/90463 "2025-07-30T13:40:00Z")

</div>

I have a package named MyPkg, which depends on MyPkg2. When I load MyPkg, I get the following error: julia\> using MyPkg \[ Info: Precompiling MyPkg \[\<MyPkg uuid\>\] ERROR: LoadError: Evaluation into the closed module \`MyP…

---

## [Inspecting the stack](https://discourse.julialang.org/t/inspecting-the-stack/376)

<div class="topic-metadata">

**Author:** [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Replies:** 10\
**Last updated:** [July 30, 2025, 11:03am UTC](https://discourse.julialang.org/t/inspecting-the-stack/376 "2025-07-30T11:03:56Z")

</div>

Hello, Is there any way to inspect the stack when an exception is thrown? This was my top debugging tool in Python and Common Lisp, and I really miss it in Julia. To be clear, I mean going up and down stack frames, and …

---

## [Retrieve a value within a do block](https://discourse.julialang.org/t/retrieve-a-value-within-a-do-block/131121)

<div class="topic-metadata">

**Author:** [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Replies:** 10\
**Last updated:** [July 30, 2025, 10:06am UTC](https://discourse.julialang.org/t/retrieve-a-value-within-a-do-block/131121 "2025-07-30T10:06:15Z")

</div>

julia\> function a\_correct\_way\_to\_build\_with\_multithreading() model = Model() @variable(model, x\[1:10\]) my\_lock = Threads.ReentrantLock() Threads.@threads for i in 1:10 …

---

## [API‑design feedback for DataSplits.jl (dataset‑splitting package)](https://discourse.julialang.org/t/api-design-feedback-for-datasplits-jl-dataset-splitting-package/131193)

<div class="topic-metadata">

**Author:** [@davide.crucitti](https://discourse.julialang.org/u/davide.crucitti)\
**Replies:** 0\
**Last updated:** [July 30, 2025, 9:54am UTC](https://discourse.julialang.org/t/api-design-feedback-for-datasplits-jl-dataset-splitting-package/131193 "2025-07-30T09:54:43Z")

</div>

Hello everyone, In the past month I’ve been working on an article on the effectiveness of dataset splitting algorithms in cheminformatics. Since I didn’t need specific chemistry libraries for this project I decided to u…

---

## [Slicing a matrix of matrices](https://discourse.julialang.org/t/slicing-a-matrix-of-matrices/131161)

<div class="topic-metadata">

**Author:** [@tduretz](https://discourse.julialang.org/u/tduretz)\
**Replies:** 5\
**Last updated:** [July 30, 2025, 7:29am UTC](https://discourse.julialang.org/t/slicing-a-matrix-of-matrices/131161 "2025-07-30T07:29:52Z")

</div>

I would like to better understand how to slice matrices of matrices. For example, I initialise a matrix of matrices this way: M = \[\[1 0; 0 2\] for i = 1:2, j=1:2\] If I slice it this way: M\[1,1\]\[:,:\] I obtain the result…

---

## [Idiomatic way of writing function with all named arguments and no defaults](https://discourse.julialang.org/t/idiomatic-way-of-writing-function-with-all-named-arguments-and-no-defaults/131131)

<div class="topic-metadata">

**Author:** [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Replies:** 6\
**Last updated:** [July 29, 2025, 8:51pm UTC](https://discourse.julialang.org/t/idiomatic-way-of-writing-function-with-all-named-arguments-and-no-defaults/131131 "2025-07-29T20:51:09Z")

</div>

There are a few very similar threads but often old(ish) so I’ll add another one. What’s the idiomatic way of writing something like this: function myfun(; x = nothing, y = nothing, z = nothing) @assert !isnothing(x)…

---

## [Excessive allocations in basic SciMLSensitivity example](https://discourse.julialang.org/t/excessive-allocations-in-basic-scimlsensitivity-example/131145)

<div class="topic-metadata">

**Author:** [@moble](https://discourse.julialang.org/u/moble)\
**Replies:** 15\
**Last updated:** [July 29, 2025, 7:17pm UTC](https://discourse.julialang.org/t/excessive-allocations-in-basic-scimlsensitivity-example/131145 "2025-07-29T19:17:19Z")

</div>

The first example (copied below) in the SciMLSensitivity docs shows how to optimize the parameters of the Lotka-Volterra system to achieve a steady state. There’s no neural network, or anything, just an ODE system with …

---

## [How to check what method is used by dispatch?](https://discourse.julialang.org/t/how-to-check-what-method-is-used-by-dispatch/131178)

<div class="topic-metadata">

**Author:** [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Replies:** 3\
**Last updated:** [July 29, 2025, 5:27pm UTC](https://discourse.julialang.org/t/how-to-check-what-method-is-used-by-dispatch/131178 "2025-07-29T17:27:44Z")

</div>

Hey, Say I have an abstract type A and many subtypes B, C, D: abstract type A end struct B\<:A end struct C\<:A end should\_return\_one(::A) = 1 should\_return\_one(x::B) = # something else. # remark that, on purpose, I di…

---

## [Groupby generic table-shaped things](https://discourse.julialang.org/t/groupby-generic-table-shaped-things/131074)

<div class="topic-metadata">

**Author:** [@freeman](https://discourse.julialang.org/u/freeman)\
**Replies:** 5\
**Last updated:** [July 29, 2025, 4:18pm UTC](https://discourse.julialang.org/t/groupby-generic-table-shaped-things/131074 "2025-07-29T16:18:48Z")

</div>

I know of Query.jl but frankly I hate both its syntaxes \[1, 2\]. (And also weirdly doesn’t depend on Tables.jl?) In the Tables.jl universe, I know of TableOperations.jl and TableTransforms.jl but weirdly neither of them …

---

## [Unwanted clipping at corners of GLMakie 3d plot](https://discourse.julialang.org/t/unwanted-clipping-at-corners-of-glmakie-3d-plot/131053)

<div class="topic-metadata">

**Author:** [@fegomezl](https://discourse.julialang.org/u/fegomezl)\
**Replies:** 7\
**Last updated:** [July 29, 2025, 2:22pm UTC](https://discourse.julialang.org/t/unwanted-clipping-at-corners-of-glmakie-3d-plot/131053 "2025-07-29T14:22:39Z")

</div>

Hi everyone, I am using contour() from GLMakie to create a 3d level plot. My problem occurs when I zoom in; white triangles appear at the edges of the box, which cover my plot: Does someone know how to fix this? I h…

---

## [Cartesian For Loop](https://discourse.julialang.org/t/cartesian-for-loop/130353)

<div class="topic-metadata">

**Author:** [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Replies:** 23\
**Last updated:** [July 29, 2025, 12:55pm UTC](https://discourse.julialang.org/t/cartesian-for-loop/130353 "2025-07-29T12:55:34Z")

</div>

Here are three (I, II, III) implementations. import Random.seed! as seed! import Random.shuffle as shuffle seed!(1); # \[Code I\] for i = shuffle(1:3) for j = shuffle(1:4) println("($i, $j)") end end see…

[Previous page](https://discourse.julialang.org/c/usage/6.md?page=47)

[Next page](https://discourse.julialang.org/c/usage/6.md?page=49)
