# Latest

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

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

**Page:** 1312

---

## [Learning Julia advance level](https://discourse.julialang.org/t/learning-julia-advance-level/65778)

<div class="topic-metadata">

**Author:** [@juls](https://discourse.julialang.org/u/juls)\
**Replies:** 1\
**Last updated:** [August 4, 2021, 4:50am UTC](https://discourse.julialang.org/t/learning-julia-advance-level/65778 "2021-08-04T04:50:12Z")

</div>

Hi, I have had started my Julia journey months back and have been working to improve my skills to an advance level. I am a research student and my work lies in areas of computational electromagnetics, signal processing…

---

## [Plots are tiny](https://discourse.julialang.org/t/plots-are-tiny/52184)

<div class="topic-metadata">

**Author:** [@Peter\_Adelman](https://discourse.julialang.org/u/Peter_Adelman)\
**Replies:** 10\
**Last updated:** [August 4, 2021, 4:22am UTC](https://discourse.julialang.org/t/plots-are-tiny/52184 "2021-08-04T04:22:30Z")

</div>

Within the last two months, my plots started rendering as tiny in VS Code. If I set the default size as (900,600), my plots are tiny: if I change it to (3600,2400), my plots get bigger: VS Code correctly detects …

---

## [Upcoming AlgebraOfGraphics release](https://discourse.julialang.org/t/upcoming-algebraofgraphics-release/60968)

<div class="topic-metadata">

**Author:** [@piever](https://discourse.julialang.org/u/piever)\
**Replies:** 38\
**Last updated:** [August 4, 2021, 3:32am UTC](https://discourse.julialang.org/t/upcoming-algebraofgraphics-release/60968 "2021-08-04T03:32:40Z")

</div>

This is a pre-announcement about an upcoming release of AlgebraOfGraphics: AlgebraOfGraphics defines a language to make data visualizations by combining basic building blocks with \* and +. It is based on Makie to act…

---

## [Undefined variable error](https://discourse.julialang.org/t/undefined-variable-error/65685)

<div class="topic-metadata">

**Author:** [@wmen](https://discourse.julialang.org/u/wmen)\
**Replies:** 4\
**Last updated:** [August 4, 2021, 2:06am UTC](https://discourse.julialang.org/t/undefined-variable-error/65685 "2021-08-04T02:06:34Z")

</div>

I tried to run the while loop example (from Visual Studio Code on Windows 10): n = 0 while n \< 10 n += 1 println(n) end and got the following error: Warning: Assignment to n in soft scope is ambiguous because a gl…

---

## [Handling fluid systems in MTK](https://discourse.julialang.org/t/handling-fluid-systems-in-mtk/65305)

<div class="topic-metadata">

**Author:** [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Replies:** 1\
**Last updated:** [August 4, 2021, 1:50am UTC](https://discourse.julialang.org/t/handling-fluid-systems-in-mtk/65305 "2021-08-04T01:50:45Z")

</div>

In Modelica a fluid Connector has a medium property, see \[1\]. Is this possible with the existing parameter system in MTK? As I understand it it has to be a subtype of Real, which a medium would not. If a large fluid s…

---

## [Juliapackages.com and juliaobserver.com broken?](https://discourse.julialang.org/t/juliapackages-com-and-juliaobserver-com-broken/64578)

<div class="topic-metadata">

**Author:** [@murrayE](https://discourse.julialang.org/u/murrayE)\
**Replies:** 6\
**Last updated:** [August 4, 2021, 1:19am UTC](https://discourse.julialang.org/t/juliapackages-com-and-juliaobserver-com-broken/64578 "2021-08-04T01:19:41Z")

</div>

Both those sites seem to be down. Trying to visit juliapackages.com gives an Application Error. Trying to visit juliaobserver.com gives a “Whoops…Something went wrong.”

---

## [Choosing a Plotting Base to Build a Statistical Plotting Package](https://discourse.julialang.org/t/choosing-a-plotting-base-to-build-a-statistical-plotting-package/62240)

<div class="topic-metadata">

**Author:** [@ParadaCarleton](https://discourse.julialang.org/u/ParadaCarleton)\
**Replies:** 19\
**Last updated:** [August 4, 2021, 12:39am UTC](https://discourse.julialang.org/t/choosing-a-plotting-base-to-build-a-statistical-plotting-package/62240 "2021-08-04T00:39:08Z")

</div>

If I wanted to build a package that adds more kinds of statistical plots to Julia, what would be the best plotting package to build it on top of? (e.g. Plots.jl, Makie, Gadfly, VegaLite) What advantages/disadvantages do …

---

## [Calling functions with named tuples by element name](https://discourse.julialang.org/t/calling-functions-with-named-tuples-by-element-name/65469)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 7\
**Last updated:** [July 30, 2021, 2:22pm UTC](https://discourse.julialang.org/t/calling-functions-with-named-tuples-by-element-name/65469 "2021-07-30T14:22:43Z")

</div>

Allowing functions to read named tuple elements by name is a wonderful feature of 1.7. Thank you :slight\_smile: I can now write: a,b,c,d = 1:4 f( (;a,b) = (a=0,b=0) ) = a - b f((;c,d,b,a)) #result -1 f() …

---

## [Log scale in histogram](https://discourse.julialang.org/t/log-scale-in-histogram/65723)

<div class="topic-metadata">

**Author:** [@maxkapur](https://discourse.julialang.org/u/maxkapur)\
**Replies:** 5\
**Last updated:** [August 3, 2021, 11:26pm UTC](https://discourse.julialang.org/t/log-scale-in-histogram/65723 "2021-08-03T23:26:13Z")

</div>

I don’t mind specifying my histogram bins manually in order to get a log scale, but it appears to break the viewport in Plots.jl: using Plots x = rand(1000) b = 10.0 .^ (-5:0) histogram(x, bins=b) And setting the x-a…

---

## [Pkg.build() vs Pkg.add() with julia -e](https://discourse.julialang.org/t/pkg-build-vs-pkg-add-with-julia-e/65762)

<div class="topic-metadata">

**Author:** [@banksiaboy](https://discourse.julialang.org/u/banksiaboy)\
**Replies:** 0\
**Last updated:** [August 3, 2021, 10:54pm UTC](https://discourse.julialang.org/t/pkg-build-vs-pkg-add-with-julia-e/65762 "2021-08-03T22:54:28Z")

</div>

When constructing command-lines to start he Julia REPL, I’m noticing some folks using Pkg.build("PyCall) rather than Pkg.add("PyCall"). The command-line I want to build is to allow many Julia environments, particularl…

---

## [A faster way of getting image size from jpg files?](https://discourse.julialang.org/t/a-faster-way-of-getting-image-size-from-jpg-files/65760)

<div class="topic-metadata">

**Author:** [@rafelafrance](https://discourse.julialang.org/u/rafelafrance)\
**Replies:** 7\
**Last updated:** [August 3, 2021, 10:07pm UTC](https://discourse.julialang.org/t/a-faster-way-of-getting-image-size-from-jpg-files/65760 "2021-08-03T22:07:08Z")

</div>

I was trying to figure out why my Python script was well over 1000 times faster than my translation to Julia and the profiler narrowed it down to a single line, the loading of the images to get image dimensions for clipp…

---

## [How to sum tuple elements](https://discourse.julialang.org/t/how-to-sum-tuple-elements/65753)

<div class="topic-metadata">

**Author:** [@sbacelar](https://discourse.julialang.org/u/sbacelar)\
**Replies:** 14\
**Last updated:** [August 3, 2021, 8:52pm UTC](https://discourse.julialang.org/t/how-to-sum-tuple-elements/65753 "2021-08-03T20:52:59Z")

</div>

x is a matrix 5x5 of tuples. How can I filter the tuples where the sum of their elements is 6? numbers = \[1,2,3,4,5\] x = collect(Iterators.product(numbers, numbers))

---

## [Queryverse \`load(f) ▷ @take(3)\` appears to read the whole file](https://discourse.julialang.org/t/queryverse-load-f-take-3-appears-to-read-the-whole-file/63272)

<div class="topic-metadata">

**Author:** [@dereksz](https://discourse.julialang.org/u/dereksz)\
**Replies:** 2\
**Last updated:** [August 3, 2021, 6:28pm UTC](https://discourse.julialang.org/t/queryverse-load-f-take-3-appears-to-read-the-whole-file/63272 "2021-08-03T18:28:13Z")

</div>

Just watched David Anthoff’s awsome Introduction to the Queryverse video. David emphasises that the Queryverse is designed to work in a “streaming” fashion, and that data is supposed to be “pulled” through the stages in…

---

## [Structures containing a function field](https://discourse.julialang.org/t/structures-containing-a-function-field/65696)

<div class="topic-metadata">

**Author:** [@aaraujo71](https://discourse.julialang.org/u/aaraujo71)\
**Replies:** 12\
**Last updated:** [August 3, 2021, 5:50pm UTC](https://discourse.julialang.org/t/structures-containing-a-function-field/65696 "2021-08-03T17:50:46Z")

</div>

I would like to include a function as part of a Julia object (struct). However, when I, for example, execute using BenchmarkTools func(x) = 2\*x^2 struct Test k :: Float64 V :: Array{Float64, 1} fn :: Funct…

---

## [Stipple error in PlotOptions](https://discourse.julialang.org/t/stipple-error-in-plotoptions/65757)

<div class="topic-metadata">

**Author:** [@Rafael\_Brus](https://discourse.julialang.org/u/Rafael_Brus)\
**Replies:** 0\
**Last updated:** [August 3, 2021, 5:49pm UTC](https://discourse.julialang.org/t/stipple-error-in-plotoptions/65757 "2021-08-03T17:49:20Z")

</div>

I am trying to get the German credit demo for STipple running. The “Credits by age” graph is not showing correctly I noticed that the problem is with the xaxis\_max option: const bar\_plot\_opts = PlotOptions(xaxis\_tick\_…

---

## [Cannot specify symbolic types](https://discourse.julialang.org/t/cannot-specify-symbolic-types/65702)

<div class="topic-metadata">

**Author:** [@yuvalw](https://discourse.julialang.org/u/yuvalw)\
**Replies:** 2\
**Last updated:** [August 3, 2021, 5:42pm UTC](https://discourse.julialang.org/t/cannot-specify-symbolic-types/65702 "2021-08-03T17:42:28Z")

</div>

Hello, I cannot specify any symbolic type. using Symbolics @variables u::Complex # or any other type gives the following error: ERROR: LoadError: AssertionError: @variables expects a tuple of expressions or an expres…

---

## [Why doesn't this work with DataFrames.jl \`combine\`?](https://discourse.julialang.org/t/why-doesnt-this-work-with-dataframes-jl-combine/65549)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 13\
**Last updated:** [August 3, 2021, 3:46pm UTC](https://discourse.julialang.org/t/why-doesnt-this-work-with-dataframes-jl-combine/65549 "2021-08-03T15:46:35Z")

</div>

This works df = DataFrame( a = rand(1:8, 1000), b = rand(1:8, 1000), c = rand(1:8, 1000), ) combine(groupby(df, :a), nrow =\> :meh) # this works function \_meh(sdf) \[sdf\[!, Not(:a)\]\] end c…

---

## [Using revise.jl to sort Invalid redefinition of constant](https://discourse.julialang.org/t/using-revise-jl-to-sort-invalid-redefinition-of-constant/65752)

<div class="topic-metadata">

**Author:** [@imantha](https://discourse.julialang.org/u/imantha)\
**Replies:** 1\
**Last updated:** [August 3, 2021, 3:42pm UTC](https://discourse.julialang.org/t/using-revise-jl-to-sort-invalid-redefinition-of-constant/65752 "2021-08-03T15:42:04Z")

</div>

Hi, I want edit the parameters in a struct. However when I try to change I get an error ERROR: invalid redifinition of constant ... For example if I want to change from mutable struct CasAgent id::Int pos::Dim…

---

## [Pkg.jl telemetry should be opt-in](https://discourse.julialang.org/t/pkg-jl-telemetry-should-be-opt-in/42209)

<div class="topic-metadata">

**Author:** [@chrisvwx](https://discourse.julialang.org/u/chrisvwx)\
**Replies:** 396\
**Last updated:** [August 3, 2021, 3:39pm UTC](https://discourse.julialang.org/t/pkg-jl-telemetry-should-be-opt-in/42209 "2021-08-03T15:39:10Z")

</div>

New “Pkg & Storage protocols” and an accompanying centralized service to host packages have been merged and are present in Julia v1.5.0-rc1. The new Pkg sends telemetry consisting of a user-specific UUID and other inform…

---

## [What is the fastest way to turn a 3D array into a vector of 2D arrays?](https://discourse.julialang.org/t/what-is-the-fastest-way-to-turn-a-3d-array-into-a-vector-of-2d-arrays/65729)

<div class="topic-metadata">

**Author:** [@erwanlecarpentier](https://discourse.julialang.org/u/erwanlecarpentier)\
**Replies:** 13\
**Last updated:** [August 3, 2021, 2:56pm UTC](https://discourse.julialang.org/t/what-is-the-fastest-way-to-turn-a-3d-array-into-a-vector-of-2d-arrays/65729 "2021-08-03T14:56:36Z")

</div>

Hi, I wonder what would be the fastest way to turn a 3D array into a vector of 2D arrays. Specifically: the input is an array of size size(inp) = (a, b, c) and I want as output a vector (typeof(out) = Array{Array{UInt8,…

---

## [How to perform explicit array broadcasting like np.broadcast\_to/torch.expand in Julia?](https://discourse.julialang.org/t/how-to-perform-explicit-array-broadcasting-like-np-broadcast-to-torch-expand-in-julia/65559)

<div class="topic-metadata">

**Author:** [@oscarknagg](https://discourse.julialang.org/u/oscarknagg)\
**Replies:** 11\
**Last updated:** [August 3, 2021, 1:27pm UTC](https://discourse.julialang.org/t/how-to-perform-explicit-array-broadcasting-like-np-broadcast-to-torch-expand-in-julia/65559 "2021-08-03T13:27:22Z")

</div>

Hi all. In Pytorch/numpy you can perform broadcasting with fine-grained and explicit control. To see what I mean here is a numpy example of what I mean. import numpy as np a = np.array(\[\[0,0\], \[0,1\], \[0, 1\]\]) b = np.ar…

---

## [Deserialization error (StackOverflow) crashes Julia and can not be caught](https://discourse.julialang.org/t/deserialization-error-stackoverflow-crashes-julia-and-can-not-be-caught/65748)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 0\
**Last updated:** [August 3, 2021, 1:26pm UTC](https://discourse.julialang.org/t/deserialization-error-stackoverflow-crashes-julia-and-can-not-be-caught/65748 "2021-08-03T13:26:28Z")

</div>

I have the following function which retrieves the content of a cache stored as a serialized Julia object: """ fromcache(key::Any, expiration::Int; dir::String = "") :: Union{Nothing,Any} Retrieves from cache the ob…

---

## [Using Zygote with custom CUDA kernels](https://discourse.julialang.org/t/using-zygote-with-custom-cuda-kernels/65688)

<div class="topic-metadata">

**Author:** [@oscarknagg](https://discourse.julialang.org/u/oscarknagg)\
**Replies:** 3\
**Last updated:** [August 3, 2021, 1:11pm UTC](https://discourse.julialang.org/t/using-zygote-with-custom-cuda-kernels/65688 "2021-08-03T13:11:37Z")

</div>

Hi all. I’m wondering if it’s possible to use Zygote to automatically differentiate CUDA kernels that I’ve defined. A minimal (not-quite working) example is below. My actual use case is not as trivial but this is essenti…

---

## [Turning the target function for M-H into a distribution](https://discourse.julialang.org/t/turning-the-target-function-for-m-h-into-a-distribution/65747)

<div class="topic-metadata">

**Author:** [@marouane](https://discourse.julialang.org/u/marouane)\
**Replies:** 0\
**Last updated:** [August 3, 2021, 1:01pm UTC](https://discourse.julialang.org/t/turning-the-target-function-for-m-h-into-a-distribution/65747 "2021-08-03T13:01:35Z")

</div>

I have a target function that I want to transform into a distribution in order to use Turing, let’s suppose that the target function is written on this form: logtarget(x::Vector)= log(prod(x))^2 how can I turn it into …

---

## [Turing MethodError with reversediff but not with forwarddiff](https://discourse.julialang.org/t/turing-methoderror-with-reversediff-but-not-with-forwarddiff/65633)

<div class="topic-metadata">

**Author:** [@fkrauer](https://discourse.julialang.org/u/fkrauer)\
**Replies:** 2\
**Last updated:** [August 3, 2021, 12:31pm UTC](https://discourse.julialang.org/t/turing-methoderror-with-reversediff-but-not-with-forwarddiff/65633 "2021-08-03T12:31:41Z")

</div>

Hi everyone I have a small ODE model, which runs fine (albeit slow) with Turing forwarddiff AD. However, I cannot get it to run with reversediff (and neither with Zygote). It throws a MethodError (see below). Is this so…

---

## [Control number of threads](https://discourse.julialang.org/t/control-number-of-threads/62887)

<div class="topic-metadata">

**Author:** [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Replies:** 6\
**Last updated:** [August 3, 2021, 12:17pm UTC](https://discourse.julialang.org/t/control-number-of-threads/62887 "2021-08-03T12:17:42Z")

</div>

Hi, Let’s say i have started julia with JULIA\_NUM\_THREADS=4, however in one of my loop I only want to use 2 threads because it gives better performance. How do I do that so that Threads.@threads only use 2 threads? Tha…

---

## [Milliseconds and JSON3](https://discourse.julialang.org/t/milliseconds-and-json3/65743)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 1\
**Last updated:** [August 3, 2021, 12:12pm UTC](https://discourse.julialang.org/t/milliseconds-and-json3/65743 "2021-08-03T12:12:12Z")

</div>

Hi all :slight\_smile: I want to do a round trip. Converting Milliseconds to JSON and back. But I can’t get it to work. Only one way works. The code below is my example. julia\> using JSON3 julia\> using StructTypes jul…

---

## [Replacing one column with three (DataFrames.jl)](https://discourse.julialang.org/t/replacing-one-column-with-three-dataframes-jl/65565)

<div class="topic-metadata">

**Author:** [@Alex-ZA](https://discourse.julialang.org/u/Alex-ZA)\
**Replies:** 3\
**Last updated:** [August 3, 2021, 11:19am UTC](https://discourse.julialang.org/t/replacing-one-column-with-three-dataframes-jl/65565 "2021-08-03T11:19:07Z")

</div>

Hi everyone! My first post here. I have to say, loving the Julia language. It is quickly becoming my favourite. Also, fantastic work with Juno. It is awesome. I am trying to implement an “One Hot” transform on some…

---

## [Implementing the builder pattern for types with UnionAll fields, idiomatic or not](https://discourse.julialang.org/t/implementing-the-builder-pattern-for-types-with-unionall-fields-idiomatic-or-not/65735)

<div class="topic-metadata">

**Author:** [@SeSodesa](https://discourse.julialang.org/u/SeSodesa)\
**Replies:** 3\
**Last updated:** [August 3, 2021, 11:15am UTC](https://discourse.julialang.org/t/implementing-the-builder-pattern-for-types-with-unionall-fields-idiomatic-or-not/65735 "2021-08-03T11:15:27Z")

</div>

My issue is essentially this: I have a type I would like to instantiate at some point with a validity check in an inner constructor, but before that I need to collect the data needed to actually build the type. I figured…

---

## [Julia output without escape sequences?](https://discourse.julialang.org/t/julia-output-without-escape-sequences/65515)

<div class="topic-metadata">

**Author:** [@Bardo](https://discourse.julialang.org/u/Bardo)\
**Replies:** 10\
**Last updated:** [August 3, 2021, 11:09am UTC](https://discourse.julialang.org/t/julia-output-without-escape-sequences/65515 "2021-08-03T11:09:28Z")

</div>

I am trying to make Julia work with an expect-like program. I do not want to adapt that program but have access to its source code. The program assumes that (in this case) the julia REPL gives the answer plus a followin…

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

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