# Latest

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

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

**Page:** 513

---

## [Should a helper function be defined inside or outside the main function?](https://discourse.julialang.org/t/should-a-helper-function-be-defined-inside-or-outside-the-main-function/108649)

<div class="topic-metadata">

**Author:** [@sadish-d](https://discourse.julialang.org/u/sadish-d)\
**Replies:** 4\
**Last updated:** [January 11, 2024, 7:10am UTC](https://discourse.julialang.org/t/should-a-helper-function-be-defined-inside-or-outside-the-main-function/108649 "2024-01-11T07:10:57Z")

</div>

I have a function f that uses a helper function h (which has no use beyond f). I face the choice of whether to define h inside or outside f. As in: inside function f() h() = ... return h() end outside h() = ... f…

---

## [Function specialization in Printf](https://discourse.julialang.org/t/function-specialization-in-printf/108611)

<div class="topic-metadata">

**Author:** [@jsjie](https://discourse.julialang.org/u/jsjie)\
**Replies:** 2\
**Last updated:** [January 11, 2024, 2:15am UTC](https://discourse.julialang.org/t/function-specialization-in-printf/108611 "2024-01-11T02:15:09Z")

</div>

My code, after compiled with PackageCompiler, show some memory allocation in logging functions. With the help of --trace-compile, I’ve found that when the compiled binary is running, the following functions are precompil…

---

## [\_set\_value!(w, key, val) = w\[key\] = val](https://discourse.julialang.org/t/set-value-w-key-val-w-key-val/108656)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 2\
**Last updated:** [January 11, 2024, 4:52am UTC](https://discourse.julialang.org/t/set-value-w-key-val-w-key-val/108656 "2024-01-11T04:52:02Z")

</div>

Is this equivalent to the function function \_set\_value!(w, key, val) w\[key\] = val end

---

## [Poor Distributed performance for independent linear algebra operators](https://discourse.julialang.org/t/poor-distributed-performance-for-independent-linear-algebra-operators/108480)

<div class="topic-metadata">

**Author:** [@hshackle](https://discourse.julialang.org/u/hshackle)\
**Replies:** 9\
**Last updated:** [January 10, 2024, 9:29pm UTC](https://discourse.julialang.org/t/poor-distributed-performance-for-independent-linear-algebra-operators/108480 "2024-01-10T21:29:05Z")

</div>

I’m trying to run some embarrasingly parallel code using Distributed but am seeing poor scaling when scaling up the number of cores. The actual code is rather complicated but for the most part just involves a lot of line…

---

## [What does 'using ..SomeMudule' mean?](https://discourse.julialang.org/t/what-does-using-somemudule-mean/108655)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 1\
**Last updated:** [January 11, 2024, 2:47am UTC](https://discourse.julialang.org/t/what-does-using-somemudule-mean/108655 "2024-01-11T02:47:49Z")

</div>

What does the two dots mean? I guess it is path relevant.

---

## [Automatic keyword argument constructor](https://discourse.julialang.org/t/automatic-keyword-argument-constructor/36573)

<div class="topic-metadata">

**Author:** [@HugoTrentesaux](https://discourse.julialang.org/u/HugoTrentesaux)\
**Replies:** 9\
**Last updated:** [January 11, 2024, 1:57am UTC](https://discourse.julialang.org/t/automatic-keyword-argument-constructor/36573 "2024-01-11T01:57:06Z")

</div>

Is there a way to have Julia automatically defining a constructor using keywords arguments? # the composite type struct Person name::String age::Int end # generates automatically this constructor: me = Person("Hugo"…

---

## [Fourier expansion package](https://discourse.julialang.org/t/fourier-expansion-package/108621)

<div class="topic-metadata">

**Author:** [@baizhan](https://discourse.julialang.org/u/baizhan)\
**Replies:** 8\
**Last updated:** [January 11, 2024, 1:33am UTC](https://discourse.julialang.org/t/fourier-expansion-package/108621 "2024-01-11T01:33:42Z")

</div>

I have a periodic function, say f(x+T)=f(x), then it can be decomposed into a sum of sin and cos functions. For example, f(x)=\\sum\_{s=-\\infty}^{\\infty}A\_{s}e^{isx}, where A\_{s}=\\frac{1}{T}\\int\_{-T/2}^{T/2}f(x)e^{-is…

---

## [How to unsmooth GLMakie volume plot?](https://discourse.julialang.org/t/how-to-unsmooth-glmakie-volume-plot/107659)

<div class="topic-metadata">

**Author:** [@xinady](https://discourse.julialang.org/u/xinady)\
**Replies:** 10\
**Last updated:** [January 11, 2024, 1:16am UTC](https://discourse.julialang.org/t/how-to-unsmooth-glmakie-volume-plot/107659 "2024-01-11T01:16:28Z")

</div>

Hi, I’m working with 3d voxels data and want to use volume function from GLMakie. I noticed that visualized volume is kind of smoothed/averaged. For example, code for one voxel inside cube is: julia\> using GLMakie ju…

---

## [Replace lines of file A using advanced regex and write to file B](https://discourse.julialang.org/t/replace-lines-of-file-a-using-advanced-regex-and-write-to-file-b/94362)

<div class="topic-metadata">

**Author:** [@Johannes\_Schweichhar](https://discourse.julialang.org/u/Johannes_Schweichhar)\
**Replies:** 16\
**Last updated:** [January 10, 2024, 10:23pm UTC](https://discourse.julialang.org/t/replace-lines-of-file-a-using-advanced-regex-and-write-to-file-b/94362 "2024-01-10T22:23:52Z")

</div>

Hi, I 've tried for quite some time now to replace a regex pattern in a large file and to write the result to second file. The replace expression using a dummy string works as expected. With the files I always end up wi…

---

## [DiffEqGPU.jl with CUDA: Error computing gradients through SDE solver](https://discourse.julialang.org/t/diffeqgpu-jl-with-cuda-error-computing-gradients-through-sde-solver/108545)

<div class="topic-metadata">

**Author:** [@MatthieuDarcy](https://discourse.julialang.org/u/MatthieuDarcy)\
**Replies:** 12\
**Last updated:** [January 10, 2024, 7:32pm UTC](https://discourse.julialang.org/t/diffeqgpu-jl-with-cuda-error-computing-gradients-through-sde-solver/108545 "2024-01-10T19:32:12Z")

</div>

Hi Julia community! I’m trying to fit a custom, one-layer NN to an SDE by computing an MSE loss. Here is my code defining the model and computing the loss (noise and sample\_features are cuda matrices defined globally) d…

---

## [Efficient Minors of a Toeplitz Matrix - Is There Demand?](https://discourse.julialang.org/t/efficient-minors-of-a-toeplitz-matrix-is-there-demand/108318)

<div class="topic-metadata">

**Author:** [@bremez](https://discourse.julialang.org/u/bremez)\
**Replies:** 6\
**Last updated:** [January 10, 2024, 8:27pm UTC](https://discourse.julialang.org/t/efficient-minors-of-a-toeplitz-matrix-is-there-demand/108318 "2024-01-10T20:27:34Z")

</div>

I have had a use case there I need (the FFT of) the sequence of the primary minors of a square matrix A, e.g. schematically fft(\[det(A\[1:m, 1:m\] for m in 1:size(A,1)\]). One would expect naively that this is O(n^4) in the…

---

## [Angle of complex numbers: how to get continuous plot?](https://discourse.julialang.org/t/angle-of-complex-numbers-how-to-get-continuous-plot/108624)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 7\
**Last updated:** [January 10, 2024, 8:18pm UTC](https://discourse.julialang.org/t/angle-of-complex-numbers-how-to-get-continuous-plot/108624 "2024-01-10T20:18:03Z")

</div>

I’m trying to plot the phase of a complex transfer function (as in control engineering) using the angle function. So essentially, if I have a transfer function g(s), I compute the angle (with rad2deg conversion) of g(j\\…

---

## [Overlaying a grid of colored squares onto a map in GMT](https://discourse.julialang.org/t/overlaying-a-grid-of-colored-squares-onto-a-map-in-gmt/108547)

<div class="topic-metadata">

**Author:** [@yalonso](https://discourse.julialang.org/u/yalonso)\
**Replies:** 5\
**Last updated:** [January 10, 2024, 7:42pm UTC](https://discourse.julialang.org/t/overlaying-a-grid-of-colored-squares-onto-a-map-in-gmt/108547 "2024-01-10T19:42:03Z")

</div>

Hello! I am new to Julia and GMT and am looking to see if it’s possible to overlay a grid (in which i define how large each box should be and the color it should be) on top of a plot of a certain region of the US. funct…

---

## [Differentiation (Zygote, but the issue is likely in ChainRules) return different types with \`Diagonal\`](https://discourse.julialang.org/t/differentiation-zygote-but-the-issue-is-likely-in-chainrules-return-different-types-with-diagonal/108608)

<div class="topic-metadata">

**Author:** [@Tomas\_Pevny](https://discourse.julialang.org/u/Tomas_Pevny)\
**Replies:** 2\
**Last updated:** [January 10, 2024, 7:09pm UTC](https://discourse.julialang.org/t/differentiation-zygote-but-the-issue-is-likely-in-chainrules-return-different-types-with-diagonal/108608 "2024-01-10T19:09:24Z")

</div>

Dear All, We are hacking a bit AbstractGP.jl and we have found an inconsistency in the returned type of Diagonal, which causes Zygote to complain. An MWE adapted from GPs is using LinearAlgebra, Zygote K = \[1.0009999…

---

## [VTK in IJulia / Visualizing Ferrite Results](https://discourse.julialang.org/t/vtk-in-ijulia-visualizing-ferrite-results/108484)

<div class="topic-metadata">

**Author:** [@cortner](https://discourse.julialang.org/u/cortner)\
**Replies:** 18\
**Last updated:** [January 10, 2024, 6:01pm UTC](https://discourse.julialang.org/t/vtk-in-ijulia-visualizing-ferrite-results/108484 "2024-01-10T18:01:34Z")

</div>

I am looking for a way to open/visualize VTK files generated by Ferrite.jl, ideally in a Jupyter notebook but any other suggestions will be welcome. VTKView seems abandoned and DashVTK just seems to have vanished. Is the…

---

## [Makie: Unwanted whitespace to right of 3D subplots, and don't fully understand behaviour of colgap! with 3D plots](https://discourse.julialang.org/t/makie-unwanted-whitespace-to-right-of-3d-subplots-and-dont-fully-understand-behaviour-of-colgap-with-3d-plots/108636)

<div class="topic-metadata">

**Author:** [@p\_f](https://discourse.julialang.org/u/p_f)\
**Replies:** 2\
**Last updated:** [January 10, 2024, 5:26pm UTC](https://discourse.julialang.org/t/makie-unwanted-whitespace-to-right-of-3d-subplots-and-dont-fully-understand-behaviour-of-colgap-with-3d-plots/108636 "2024-01-10T17:26:34Z")

</div>

I have a small issue where there is some unwanted whitespace on the right of my figure. Also, the behaviour of colgap is a bit weird to me with 3D plots. The code I am using just makes four 2d plots and four 3d plots in…

---

## ["Reset" Makie without killing Julia process?](https://discourse.julialang.org/t/reset-makie-without-killing-julia-process/108504)

<div class="topic-metadata">

**Author:** [@p\_f](https://discourse.julialang.org/u/p_f)\
**Replies:** 11\
**Last updated:** [January 10, 2024, 5:18pm UTC](https://discourse.julialang.org/t/reset-makie-without-killing-julia-process/108504 "2024-01-10T17:18:38Z")

</div>

I semi-frequently seem to try things using Makie that stops it from working. Just now, I set rowsize! and colsize!(fig.layout,1,Aspect(1,1.0)), which gave an error. Not a problem, I thought I’d just create a new figure a…

---

## [Error from closure definition inside @batch](https://discourse.julialang.org/t/error-from-closure-definition-inside-batch/108631)

<div class="topic-metadata">

**Author:** [@svretina](https://discourse.julialang.org/u/svretina)\
**Replies:** 2\
**Last updated:** [January 10, 2024, 4:50pm UTC](https://discourse.julialang.org/t/error-from-closure-definition-inside-batch/108631 "2024-01-10T16:50:22Z")

</div>

I am trying to use the @batch from Polyester.jl as an alternative to the Base.Threads.@threads but inside my loops I need to define some closures which produced an UndefVarError. A MWE is the following function func() …

---

## [Provenance of data in scientific packages](https://discourse.julialang.org/t/provenance-of-data-in-scientific-packages/108625)

<div class="topic-metadata">

**Author:** [@NicholasWMRitchie](https://discourse.julialang.org/u/NicholasWMRitchie)\
**Replies:** 4\
**Last updated:** [January 10, 2024, 5:11pm UTC](https://discourse.julialang.org/t/provenance-of-data-in-scientific-packages/108625 "2024-01-10T17:11:01Z")

</div>

I’m not sure how pervasive it is but I’ve noticed this issue a couple of times. The issue is this: The provenance of data used to implement basic “scientific packages” is ambiguous. This could mean the source of the d…

---

## [Struct and memory allocation](https://discourse.julialang.org/t/struct-and-memory-allocation/108632)

<div class="topic-metadata">

**Author:** [@fdekerme](https://discourse.julialang.org/u/fdekerme)\
**Replies:** 4\
**Last updated:** [January 10, 2024, 4:29pm UTC](https://discourse.julialang.org/t/struct-and-memory-allocation/108632 "2024-01-10T16:29:07Z")

</div>

Hello ! :slight\_smile: I don’t understand why there is memory allocation when I acces to a parameters of my immutable struct ? julia\> using BenchmarkTools julia\> struct S1 a::NTuple{3,Int64} b::Float64 …

---

## [Why does this example usage of digits! not work?](https://discourse.julialang.org/t/why-does-this-example-usage-of-digits-not-work/108633)

<div class="topic-metadata">

**Author:** [@r32679](https://discourse.julialang.org/u/r32679)\
**Replies:** 2\
**Last updated:** [January 10, 2024, 4:18pm UTC](https://discourse.julialang.org/t/why-does-this-example-usage-of-digits-not-work/108633 "2024-01-10T16:18:22Z")

</div>

used this example julia\> arr=\[0,0,0\]; julia\>digits!(arr,123,10) Get this output from Julia. ERROR: LoadError: no method matching digits!(::Vector\[Int64}, ::Int64, ::Int64)

---

## [NeuralODE - Array has no field layer](https://discourse.julialang.org/t/neuralode-array-has-no-field-layer/108586)

<div class="topic-metadata">

**Author:** [@Nocix](https://discourse.julialang.org/u/Nocix)\
**Replies:** 6\
**Last updated:** [January 10, 2024, 2:46pm UTC](https://discourse.julialang.org/t/neuralode-array-has-no-field-layer/108586 "2024-01-10T14:46:11Z")

</div>

Hi, I’m new here and have a question about extrapolating data using neural ordinary differential equations. I am in the process of training a mathematical function in steps of four. Training the neural network seems to …

---

## [Collect (flat) iterator as an Array](https://discourse.julialang.org/t/collect-flat-iterator-as-an-array/108617)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 3\
**Last updated:** [January 10, 2024, 12:52pm UTC](https://discourse.julialang.org/t/collect-flat-iterator-as-an-array/108617 "2024-01-10T12:52:54Z")

</div>

Is there a default generic way I can collect an iterator itr that HasLength into an Array of given (compatible) dims? Eg collect itr = (i for i in 1:6) into a 2x3 Matrix. Just to clarify, it is easy to write a wrappe…

---

## [How to return self recursive function?](https://discourse.julialang.org/t/how-to-return-self-recursive-function/108564)

<div class="topic-metadata">

**Author:** [@AwesomeQuest](https://discourse.julialang.org/u/AwesomeQuest)\
**Replies:** 8\
**Last updated:** [January 10, 2024, 11:57am UTC](https://discourse.julialang.org/t/how-to-return-self-recursive-function/108564 "2024-01-10T11:57:17Z")

</div>

I want to make a function that takes a function and vector of initial conditions as arguments. function recseq( a::T, init::AbstractVector) where{T\<:Function} return n-\> begin if(n in init) return init\[n+1\] e…

---

## [Julia and Pkg are the best](https://discourse.julialang.org/t/julia-and-pkg-are-the-best/108610)

<div class="topic-metadata">

**Author:** [@cdawg](https://discourse.julialang.org/u/cdawg)\
**Replies:** 2\
**Last updated:** [January 10, 2024, 11:24am UTC](https://discourse.julialang.org/t/julia-and-pkg-are-the-best/108610 "2024-01-10T11:24:50Z")

</div>

I have a pipeline that has Julia, R and python and bash-run docker clis and everything is fragile and breaking across builds. But! when the julia package chokes on unexpected input, I dev the package, and revise (on by …

---

## [Makie.jl: How to color a density plot according to a given colormap/colorbar](https://discourse.julialang.org/t/makie-jl-how-to-color-a-density-plot-according-to-a-given-colormap-colorbar/60575)

<div class="topic-metadata">

**Author:** [@briochemc](https://discourse.julialang.org/u/briochemc)\
**Replies:** 1\
**Last updated:** [January 10, 2024, 9:47am UTC](https://discourse.julialang.org/t/makie-jl-how-to-color-a-density-plot-according-to-a-given-colormap-colorbar/60575 "2024-01-10T09:47:13Z")

</div>

Is it possible to color densities according to a given colormap/colorbar? @yakir12 already helped me on zulip with the “ridgeplot layout” of the densities as shown in the docs, which worked for me like below: But I’…

---

## [Research intership offer (master level) in Marseille](https://discourse.julialang.org/t/research-intership-offer-master-level-in-marseille/108379)

<div class="topic-metadata">

**Author:** [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Replies:** 0\
**Last updated:** [January 5, 2024, 10:16am UTC](https://discourse.julialang.org/t/research-intership-offer-master-level-in-marseille/108379 "2024-01-05T10:16:54Z")

</div>

I am happy to announce that we are looking for a 4-to-6 months research intern at the SESSTIM, my research unit in Marseille, to work on the exiting development of relative survival analysis in Julia :slight\_smile: Prio…

---

## [Cannot access MTK's observed variables in steady-state solutions (NonlinearSolution)](https://discourse.julialang.org/t/cannot-access-mtks-observed-variables-in-steady-state-solutions-nonlinearsolution/108524)

<div class="topic-metadata">

**Author:** [@Wen-Wei\_Tseng](https://discourse.julialang.org/u/Wen-Wei_Tseng)\
**Replies:** 3\
**Last updated:** [January 10, 2024, 8:42am UTC](https://discourse.julialang.org/t/cannot-access-mtks-observed-variables-in-steady-state-solutions-nonlinearsolution/108524 "2024-01-10T08:42:20Z")

</div>

MWE: using DifferentialEquations using ModelingToolkit @variables t x(t) RHS(t) @parameters τ D = Differential(t) eqs = \[ RHS ~ (1 - x) / τ D(x) ~ RHS \] @named sys = ODESystem(eqs, defaults=\[x=\>0.0, τ=\>3.0\]) …

---

## [Ensuring Forward and Backward Differentiability in Classical Inversion Process](https://discourse.julialang.org/t/ensuring-forward-and-backward-differentiability-in-classical-inversion-process/108609)

<div class="topic-metadata">

**Author:** [@vivekag7](https://discourse.julialang.org/u/vivekag7)\
**Replies:** 1\
**Last updated:** [January 10, 2024, 8:18am UTC](https://discourse.julialang.org/t/ensuring-forward-and-backward-differentiability-in-classical-inversion-process/108609 "2024-01-10T08:18:57Z")

</div>

Hi everyone, I am going to start off with some context and then proceed with describing my problem, so you get a better understanding of the scope. I am currently working on creating a classical inversion in the field …

---

## [ComplexityMeasures.jl v3 - a mathematically rigorous software for probability, entropy, and complexity](https://discourse.julialang.org/t/complexitymeasures-jl-v3-a-mathematically-rigorous-software-for-probability-entropy-and-complexity/108562)

<div class="topic-metadata">

**Author:** [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Replies:** 3\
**Last updated:** [January 10, 2024, 8:16am UTC](https://discourse.julialang.org/t/complexitymeasures-jl-v3-a-mathematically-rigorous-software-for-probability-entropy-and-complexity/108562 "2024-01-10T08:16:12Z")

</div>

We (@kahaaga and @datseris) are very proud to announce v3 of ComplexityMeasures.jl. This v3 is the result of a year of very intensive thinking, redesigning, reimplementing, and going lots of back and forth, in order to m…

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

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