# Latest

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

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

**Page:** 1121

---

## [Consistency checks missing when constructing linear algebra objects](https://discourse.julialang.org/t/consistency-checks-missing-when-constructing-linear-algebra-objects/76419)

<div class="topic-metadata">

**Author:** [@andreasvarga](https://discourse.julialang.org/u/andreasvarga)\
**Replies:** 3\
**Last updated:** [February 15, 2022, 7:22pm UTC](https://discourse.julialang.org/t/consistency-checks-missing-when-constructing-linear-algebra-objects/76419 "2022-02-15T19:22:14Z")

</div>

I have the following question which virtually applies to all defined linear algebra objects in Julia/LinearAlgebra: Why there are no consistency checks when constructing linear algebra objects? As an example, let’s con…

---

## [Random numbers in KernelAbstractions](https://discourse.julialang.org/t/random-numbers-in-kernelabstractions/76476)

<div class="topic-metadata">

**Author:** [@lawless-m](https://discourse.julialang.org/u/lawless-m)\
**Replies:** 4\
**Last updated:** [February 15, 2022, 7:00pm UTC](https://discourse.julialang.org/t/random-numbers-in-kernelabstractions/76476 "2022-02-15T19:00:25Z")

</div>

Cuda has random numbers CUDA.rand(2) but I can’t see how/if I can create them inside a @kernel. I need x,y pairs in a specific range and x^2 + y^ \<= 1 I used just plain rand() and got ... resulted in invalid LLVM IR …

---

## [Breaking up long testset descriptions](https://discourse.julialang.org/t/breaking-up-long-testset-descriptions/76488)

<div class="topic-metadata">

**Author:** [@danielsoutar](https://discourse.julialang.org/u/danielsoutar)\
**Replies:** 5\
**Last updated:** [February 15, 2022, 4:28pm UTC](https://discourse.julialang.org/t/breaking-up-long-testset-descriptions/76488 "2022-02-15T16:28:47Z")

</div>

Very simple question - maybe even a feature request to open on JuliaLang repo. Basically, I would like to enforce a style guide where my code is at most 80 characters long, including tests. However, the @testset macro d…

---

## [Should julia libs adhere to a common Array & dataframe API?](https://discourse.julialang.org/t/should-julia-libs-adhere-to-a-common-array-dataframe-api/76491)

<div class="topic-metadata">

**Author:** [@Steven\_Sagaert](https://discourse.julialang.org/u/Steven_Sagaert)\
**Replies:** 2\
**Last updated:** [February 15, 2022, 4:01pm UTC](https://discourse.julialang.org/t/should-julia-libs-adhere-to-a-common-array-dataframe-api/76491 "2022-02-15T16:01:59Z")

</div>

Hi, I recently discovered this: Announcing the Consortium for Python Data API Standards. This is of course for Python but I wonder if a similar effort in julia would be opportune. I realise that in julia due to multipl…

---

## [How to check if date is summer time](https://discourse.julialang.org/t/how-to-check-if-date-is-summer-time/75950)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 4\
**Last updated:** [February 15, 2022, 3:44pm UTC](https://discourse.julialang.org/t/how-to-check-if-date-is-summer-time/75950 "2022-02-15T15:44:31Z")

</div>

Hi all, Didn’t find anything online and here on discourse. So here is my my question. How would I check if a date is summer or winter time? Cheers

---

## [RCall and Out of Memory Errors. Are there limits?](https://discourse.julialang.org/t/rcall-and-out-of-memory-errors-are-there-limits/76486)

<div class="topic-metadata">

**Author:** [@tbeason](https://discourse.julialang.org/u/tbeason)\
**Replies:** 1\
**Last updated:** [February 15, 2022, 2:59pm UTC](https://discourse.julialang.org/t/rcall-and-out-of-memory-errors-are-there-limits/76486 "2022-02-15T14:59:17Z")

</div>

I am using RCall.jl to run some estimations of hidden markov models using the R package seqHMM. I have 64GB of RAM and task manager never shows me using above 20GB total, yet I am getting out of memory errors when estima…

---

## [Excessive memory usage parallel Julia job](https://discourse.julialang.org/t/excessive-memory-usage-parallel-julia-job/75256)

<div class="topic-metadata">

**Author:** [@Chiil](https://discourse.julialang.org/u/Chiil)\
**Replies:** 6\
**Last updated:** [February 15, 2022, 2:05pm UTC](https://discourse.julialang.org/t/excessive-memory-usage-parallel-julia-job/75256 "2022-02-15T14:05:52Z")

</div>

I have ported the dynamical core of our C++ CFD code to Julia (https://github.com/Chiil/MicroHH.jl) and have been implementing MPI.jl over the past days. I ran my first few large test jobs (1024 cores on 8 EPYC nodes wit…

---

## [10 Years of JuliaLang](https://discourse.julialang.org/t/10-years-of-julialang/76459)

<div class="topic-metadata">

**Author:** [@avik](https://discourse.julialang.org/u/avik)\
**Replies:** 5\
**Last updated:** [February 15, 2022, 2:04pm UTC](https://discourse.julialang.org/t/10-years-of-julialang/76459 "2022-02-15T14:04:16Z")

</div>

Today is the 10 year anniversary of the “Why we created Julia” blog post which was the first public announcement for the language. To celebrate, we just published a set of stories from our community, reflecting on the pa…

---

## [Handling Dual types in my Turing model in a more elegant way](https://discourse.julialang.org/t/handling-dual-types-in-my-turing-model-in-a-more-elegant-way/76365)

<div class="topic-metadata">

**Author:** [@jacobusmmsmit](https://discourse.julialang.org/u/jacobusmmsmit)\
**Replies:** 3\
**Last updated:** [February 14, 2022, 2:17pm UTC](https://discourse.julialang.org/t/handling-dual-types-in-my-turing-model-in-a-more-elegant-way/76365 "2022-02-14T14:17:56Z")

</div>

Hello everyone, I’m doing inference on a system of ODEs solved with Rodas5. To use Rodas5 while writing inplace to my du, I check if one of u or du is a Dual so there’s no typeassert based errors. To use Turing with the…

---

## [Create individual plot and save as pdf](https://discourse.julialang.org/t/create-individual-plot-and-save-as-pdf/76458)

<div class="topic-metadata">

**Author:** [@sai\_matcha](https://discourse.julialang.org/u/sai_matcha)\
**Replies:** 17\
**Last updated:** [February 15, 2022, 1:21pm UTC](https://discourse.julialang.org/t/create-individual-plot-and-save-as-pdf/76458 "2022-02-15T13:21:36Z")

</div>

Hi … i used to use this code in r studio to generate individual plots for each id and save them as combined pdf for the offline evaluation. can someone help me to translate code to julia. pdf("path\\\\indplots.pdf") for(i…

---

## [How to use ApproxFun to multiply differential operators without running into incompatible space issues?](https://discourse.julialang.org/t/how-to-use-approxfun-to-multiply-differential-operators-without-running-into-incompatible-space-issues/76481)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 2\
**Last updated:** [February 15, 2022, 12:54pm UTC](https://discourse.julialang.org/t/how-to-use-approxfun-to-multiply-differential-operators-without-running-into-incompatible-space-issues/76481 "2022-02-15T12:54:54Z")

</div>

I’m trying to compute (D + x)^2, where D is the derivative operator. julia\> x = Fun(identity) Fun(Chebyshev(),\[0.0, 1.0\]) julia\> D = Derivative(Chebyshev()) ConcreteDerivative : Chebyshev() → Ultraspherical(1) ⋅ 1.0 …

---

## [Plot not defined](https://discourse.julialang.org/t/plot-not-defined/76482)

<div class="topic-metadata">

**Author:** [@sai\_matcha](https://discourse.julialang.org/u/sai_matcha)\
**Replies:** 1\
**Last updated:** [February 15, 2022, 12:32pm UTC](https://discourse.julialang.org/t/plot-not-defined/76482 "2022-02-15T12:32:39Z")

</div>

I was using plots previously. suddenly it stopped working. julia\> using Plots julia\> x = 1:10 ; y = rand(10) 10-element Vector{Float64}: 0.328078505773031 0.1228315686010254 0.18449539206763776 0.9873483723089912 …

---

## [Distributed IO works only on main process but not on workers](https://discourse.julialang.org/t/distributed-io-works-only-on-main-process-but-not-on-workers/36105)

<div class="topic-metadata">

**Author:** [@meritwagner](https://discourse.julialang.org/u/meritwagner)\
**Replies:** 1\
**Last updated:** [February 15, 2022, 11:43am UTC](https://discourse.julialang.org/t/distributed-io-works-only-on-main-process-but-not-on-workers/36105 "2022-02-15T11:43:14Z")

</div>

I am playing around with the parallel functionality in Julia and trying to make a specific worker load a big feather file. Surprisingly this works, since fetch returns a DataFrame: using Distributed addprocs(4) @everywh…

---

## [VSCode setting for setting editor (for use with @edit)](https://discourse.julialang.org/t/vscode-setting-for-setting-editor-for-use-with-edit/75716)

<div class="topic-metadata">

**Author:** [@albheim](https://discourse.julialang.org/u/albheim)\
**Replies:** 2\
**Last updated:** [February 15, 2022, 10:20am UTC](https://discourse.julialang.org/t/vscode-setting-for-setting-editor-for-use-with-edit/75716 "2022-02-15T10:20:48Z")

</div>

I wanted julia to automatically figure out and set the editor for use with @edit depending on if I was in a terminal (use vim) or if I was in vscode julia repl (use vscode). I saw that in julia vscode settings there is …

---

## [Strategies to reuse memory](https://discourse.julialang.org/t/strategies-to-reuse-memory/74743)

<div class="topic-metadata">

**Author:** [@Dharik\_Arsath](https://discourse.julialang.org/u/Dharik_Arsath)\
**Replies:** 9\
**Last updated:** [February 15, 2022, 10:17am UTC](https://discourse.julialang.org/t/strategies-to-reuse-memory/74743 "2022-02-15T10:17:43Z")

</div>

I’ve a preallocated vector temp which has the values of (y - y\_pred ).^2 where y and y\_pred are 1D vectors. I’ve to reuse that vector in 2 or more different functions, what is the best solution for this. Note: performan…

---

## [Why does the arrow option in plot() not work when plotting with 3 axes?](https://discourse.julialang.org/t/why-does-the-arrow-option-in-plot-not-work-when-plotting-with-3-axes/76479)

<div class="topic-metadata">

**Author:** [@chrisoffner](https://discourse.julialang.org/u/chrisoffner)\
**Replies:** 0\
**Last updated:** [February 15, 2022, 10:01am UTC](https://discourse.julialang.org/t/why-does-the-arrow-option-in-plot-not-work-when-plotting-with-3-axes/76479 "2022-02-15T10:01:03Z")

</div>

For some reason, the arrow=true argument doesn’t seem to have any effect once I give plot a three-dimensional line. Is this a bug, or intended behaviour? Is there a way to get arrow heads in 3D, without having to resort …

---

## [Ifelse in a DataFrame](https://discourse.julialang.org/t/ifelse-in-a-dataframe/76463)

<div class="topic-metadata">

**Author:** [@CompulsoryCoffee](https://discourse.julialang.org/u/CompulsoryCoffee)\
**Replies:** 13\
**Last updated:** [February 15, 2022, 9:56am UTC](https://discourse.julialang.org/t/ifelse-in-a-dataframe/76463 "2022-02-15T09:56:18Z")

</div>

I recently found out about the ifelse statement in Julia. test = DataFrame(a = 1:10, b = rand(10), c=\[2,2,2,2,2,5,5,5,5,5\]) Row │ a b c d │ Int64 Float64 Int64 Int64 ─────┼───────────…

---

## [Finding the position in array](https://discourse.julialang.org/t/finding-the-position-in-array/76430)

<div class="topic-metadata">

**Author:** [@Mastomaki](https://discourse.julialang.org/u/Mastomaki)\
**Replies:** 8\
**Last updated:** [February 15, 2022, 7:12am UTC](https://discourse.julialang.org/t/finding-the-position-in-array/76430 "2022-02-15T07:12:51Z")

</div>

myd = DataFrame(a = 1:3, b = \["aba","saba","daba" \]) Now trying to find the position of :b elements in certain vector and make a new column out of it: myd = transform(myd, :b =\> (v -\> findfirst(x -\> x==v, \["saba","daba…

---

## [Fillalpha in Makie band plot](https://discourse.julialang.org/t/fillalpha-in-makie-band-plot/76469)

<div class="topic-metadata">

**Author:** [@DanielVandH](https://discourse.julialang.org/u/DanielVandH)\
**Replies:** 1\
**Last updated:** [February 15, 2022, 7:01am UTC](https://discourse.julialang.org/t/fillalpha-in-makie-band-plot/76469 "2022-02-15T07:01:33Z")

</div>

Is there a way to set the transparency of the filled band plots from Makie.jl? For example, what option can I add onto band! in the following code to give transparency, similarly to fillalpha in Plots.jl? using CairoMak…

---

## [AD with respect to Flux parameters](https://discourse.julialang.org/t/ad-with-respect-to-flux-parameters/76468)

<div class="topic-metadata">

**Author:** [@raktim](https://discourse.julialang.org/u/raktim)\
**Replies:** 1\
**Last updated:** [February 15, 2022, 5:11am UTC](https://discourse.julialang.org/t/ad-with-respect-to-flux-parameters/76468 "2022-02-15T05:11:17Z")

</div>

I am trying to compute gradient of a function with respect to Flux parameters. Example: using Flux, ForwardDiff function f(x::Vector) return \[x\[2\]; -x\[1\] + (1 - x\[1\]^2) \* x\[2\]\] end # Function approximation n = 2…

---

## [\`depart\` for \`return\`, a syntactic sugar for blocks with early-stop](https://discourse.julialang.org/t/depart-for-return-a-syntactic-sugar-for-blocks-with-early-stop/76407)

<div class="topic-metadata">

**Author:** [@complyue](https://discourse.julialang.org/u/complyue)\
**Replies:** 7\
**Last updated:** [February 15, 2022, 4:55am UTC](https://discourse.julialang.org/t/depart-for-return-a-syntactic-sugar-for-blocks-with-early-stop/76407 "2022-02-15T04:55:29Z")

</div>

Julia has let block in case you need a local scope, so you don’t often need ad-hoc defined+called anonymous function for that as in JavaScript. But another sugar in the ad-hoc called function syntax is, you can early-ret…

---

## [Reshape vector of odd length to multi-dimensional array](https://discourse.julialang.org/t/reshape-vector-of-odd-length-to-multi-dimensional-array/76465)

<div class="topic-metadata">

**Author:** [@lln](https://discourse.julialang.org/u/lln)\
**Replies:** 6\
**Last updated:** [February 15, 2022, 12:17am UTC](https://discourse.julialang.org/t/reshape-vector-of-odd-length-to-multi-dimensional-array/76465 "2022-02-15T00:17:43Z")

</div>

Hi, I’m trying to reshape a vector of odd length (15) into a multi-dimensional array and getting a DimensionMismatch("array size 15 must be divisible by the product of the new dimensions (2, Colon())") error, which make…

---

## [How to construct non-square sparse matrix with multiple diagonals](https://discourse.julialang.org/t/how-to-construct-non-square-sparse-matrix-with-multiple-diagonals/76456)

<div class="topic-metadata">

**Author:** [@jinml](https://discourse.julialang.org/u/jinml)\
**Replies:** 6\
**Last updated:** [February 14, 2022, 11:56pm UTC](https://discourse.julialang.org/t/how-to-construct-non-square-sparse-matrix-with-multiple-diagonals/76456 "2022-02-14T23:56:40Z")

</div>

I need to construct a non-square (N by N+2) matrix with 3 diagonal vectors of length N each, I can’t seem to use Tridiagonal(vsub,v0,vsuper) as this function wants to form a square matrix. What is the function that does …

---

## [Handling pre-parsed XLSX file](https://discourse.julialang.org/t/handling-pre-parsed-xlsx-file/76455)

<div class="topic-metadata">

**Author:** [@jeremiedb](https://discourse.julialang.org/u/jeremiedb)\
**Replies:** 2\
**Last updated:** [February 14, 2022, 9:22pm UTC](https://discourse.julialang.org/t/handling-pre-parsed-xlsx-file/76455 "2022-02-14T21:22:48Z")

</div>

Package XLSX.jl provides tool to import XLSX file from path name: readxlsx. However, I struggle handle an XLSX that is first parsed by the file upload functionality in Dash.jl. The resulting parsing from the upload is a…

---

## [How to capture an index in closure without allocating (or workaround)?](https://discourse.julialang.org/t/how-to-capture-an-index-in-closure-without-allocating-or-workaround/76334)

<div class="topic-metadata">

**Author:** [@taotree](https://discourse.julialang.org/u/taotree)\
**Replies:** 4\
**Last updated:** [February 14, 2022, 9:20pm UTC](https://discourse.julialang.org/t/how-to-capture-an-index-in-closure-without-allocating-or-workaround/76334 "2022-02-14T21:20:36Z")

</div>

Sorry the code is a bit long but the middle testIt! function is where the question is. If I run run() as-is, there are ~160k allocations. However, if I comment out the code with i, then there are no allocations. I’m assu…

---

## [Open Python serialized object in julia](https://discourse.julialang.org/t/open-python-serialized-object-in-julia/76415)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 3\
**Last updated:** [February 14, 2022, 8:46pm UTC](https://discourse.julialang.org/t/open-python-serialized-object-in-julia/76415 "2022-02-14T20:46:51Z")

</div>

So I have a python script that produces a vector of float values. I wish to save this vector of values and then open it in Julia. Is there some serialization (for float vectors) which is both julia and python compatible…

---

## [Tullio 0.3.3 fails in Julia 1.7.2](https://discourse.julialang.org/t/tullio-0-3-3-fails-in-julia-1-7-2/76453)

<div class="topic-metadata">

**Author:** [@00shiv](https://discourse.julialang.org/u/00shiv)\
**Replies:** 13\
**Last updated:** [February 14, 2022, 8:44pm UTC](https://discourse.julialang.org/t/tullio-0-3-3-fails-in-julia-1-7-2/76453 "2022-02-14T20:44:41Z")

</div>

I have some Tullio 0.3.3.) code that works in 1.7.1 but not 1.7.2. I get a fairly large error message which I attach at the bottom. Before I try to produce a MWE I was wondering if someone knows something already. Thanks…

---

## [Serialize() is prohibitively slow for recursive structs. What am I missing?](https://discourse.julialang.org/t/serialize-is-prohibitively-slow-for-recursive-structs-what-am-i-missing/76276)

<div class="topic-metadata">

**Author:** [@SortofDamocles](https://discourse.julialang.org/u/SortofDamocles)\
**Replies:** 15\
**Last updated:** [February 14, 2022, 8:11pm UTC](https://discourse.julialang.org/t/serialize-is-prohibitively-slow-for-recursive-structs-what-am-i-missing/76276 "2022-02-14T20:11:16Z")

</div>

I am representing some data with a large number of tree structs: mutable struct MinimalNode childvalues::Union{NTuple{4, Int8}, NTuple{3, Int8}, NTuple{2, Int8}, NTuple{1, Int8}, Tuple{}}; childnodes::Union{NTup…

---

## [Can you define a JuMP variable using the keys of an existing DenseAxisArray?](https://discourse.julialang.org/t/can-you-define-a-jump-variable-using-the-keys-of-an-existing-denseaxisarray/76443)

<div class="topic-metadata">

**Author:** [@MartinBonde](https://discourse.julialang.org/u/MartinBonde)\
**Replies:** 2\
**Last updated:** [February 14, 2022, 7:08pm UTC](https://discourse.julialang.org/t/can-you-define-a-jump-variable-using-the-keys-of-an-existing-denseaxisarray/76443 "2022-02-14T19:08:59Z")

</div>

Say I have a variable defined over two axes: @variable(m, x\[1:3,\[:a, :b\]\]) 2-dimensional DenseAxisArray{VariableRef,2,...} with index sets: Dimension 1, Base.OneTo(3) Dimension 2, \[:a, :b\] And data, a 3×2 Matri…

---

## [Problems regarding an implementation of a word2word Autoencoder](https://discourse.julialang.org/t/problems-regarding-an-implementation-of-a-word2word-autoencoder/76255)

<div class="topic-metadata">

**Author:** [@Arcumenn](https://discourse.julialang.org/u/Arcumenn)\
**Replies:** 7\
**Last updated:** [February 14, 2022, 6:14pm UTC](https://discourse.julialang.org/t/problems-regarding-an-implementation-of-a-word2word-autoencoder/76255 "2022-02-14T18:14:25Z")

</div>

Hello there! I am currently trying to implement a word-2-word Autoencoder with the Flux.jl package. It went mostly well, but I’m running into some problems now and I hope someone might be able to nudge me into the righ…

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

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