# Latest

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

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

**Page:** 1766

---

## [Walrus operator](https://discourse.julialang.org/t/walrus-operator/38208)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 11\
**Last updated:** [April 26, 2020, 2:31am UTC](https://discourse.julialang.org/t/walrus-operator/38208 "2020-04-26T02:31:33Z")

</div>

I came across the walrus/assignment operator in Python 3.8. The idea is that you can make an assignment in the if-expression and the variable is only visible in the if and elseif blocks. Just wondering if there’s any d…

---

## [How to create a @ntuple-like macro but can hundle arbitrary number of nested loops](https://discourse.julialang.org/t/how-to-create-a-ntuple-like-macro-but-can-hundle-arbitrary-number-of-nested-loops/38180)

<div class="topic-metadata">

**Author:** [@QUANG\_VU\_NGUY\_N\_PH\_M](https://discourse.julialang.org/u/QUANG_VU_NGUY_N_PH_M)\
**Replies:** 3\
**Last updated:** [April 25, 2020, 9:16pm UTC](https://discourse.julialang.org/t/how-to-create-a-ntuple-like-macro-but-can-hundle-arbitrary-number-of-nested-loops/38180 "2020-04-25T21:16:07Z")

</div>

I would like to create a macro that can hundle arbitrary number of nested loops: julia\> @ntuple 3 i -\> 2i (2, 4, 6) julia\> FEM.@ntuple 2 3 (i,j) -\> (2i,j) ((2, 1), (4, 1), (2, 2), (4, 2), (2, 3), (4, 3)) Is there any…

---

## [ERROR: LoadError: UndefVarError: A not defined](https://discourse.julialang.org/t/error-loaderror-undefvarerror-a-not-defined/38116)

<div class="topic-metadata">

**Author:** [@logankilpatrick](https://discourse.julialang.org/u/logankilpatrick)\
**Replies:** 6\
**Last updated:** [April 25, 2020, 9:03pm UTC](https://discourse.julialang.org/t/error-loaderror-undefvarerror-a-not-defined/38116 "2020-04-25T21:03:15Z")

</div>

Hey all, I have the following code: function POMDPs.action(pol::MyCustomType,s::S)::A where {S,A} # ignore end This code works on Julia 1.1.1 but errors on Julia 1.3 + and says “ERROR: LoadError: UndefVarError: A no…

---

## [\[RFC/ANN\] ComponentArrays.jl for building composable models without a modeling language](https://discourse.julialang.org/t/rfc-ann-componentarrays-jl-for-building-composable-models-without-a-modeling-language/38001)

<div class="topic-metadata">

**Author:** [@jonniedie](https://discourse.julialang.org/u/jonniedie)\
**Replies:** 22\
**Last updated:** [April 25, 2020, 8:59pm UTC](https://discourse.julialang.org/t/rfc-ann-componentarrays-jl-for-building-composable-models-without-a-modeling-language/38001 "2020-04-25T20:59:17Z")

</div>

Hey everyone. ComponentArrays.jl is my first package and I’m looking for some feedback and to gauge interest before I think about going down the path of registering it. I wrote this package mostly for myself for my work …

---

## [VS Code Environment](https://discourse.julialang.org/t/vs-code-environment/38203)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 1\
**Last updated:** [April 25, 2020, 8:23pm UTC](https://discourse.julialang.org/t/vs-code-environment/38203 "2020-04-25T20:23:06Z")

</div>

Since updating to 1.4.1, I get this when opening a project in VS Code: So I have to manually switch to the environment of the project I’m opening. In the bottom left, Julia env: is just blank but it used to automatica…

---

## [ArgumentError y = \[y;df\[:,Symbol(v)\]\]](https://discourse.julialang.org/t/argumenterror-y-y-df-symbol-v/38198)

<div class="topic-metadata">

**Author:** [@bujun\_mei](https://discourse.julialang.org/u/bujun_mei)\
**Replies:** 1\
**Last updated:** [April 25, 2020, 7:25pm UTC](https://discourse.julialang.org/t/argumenterror-y-y-df-symbol-v/38198 "2020-04-25T19:25:29Z")

</div>

y = Array{Float64,1}() print(mme.depVarVec) for v in mme.depVarVec y = \[y;df\[:,Symbol(v)\]\] end output: AbstractString\[“y1”, “y2”\] ArgumentError: column name :y1 not found in the data frame; existing most similar n…

---

## [Statistic errors for histograms with Plots recipes](https://discourse.julialang.org/t/statistic-errors-for-histograms-with-plots-recipes/37327)

<div class="topic-metadata">

**Author:** [@misha\_mikhasenko](https://discourse.julialang.org/u/misha_mikhasenko)\
**Replies:** 5\
**Last updated:** [April 25, 2020, 4:36pm UTC](https://discourse.julialang.org/t/statistic-errors-for-histograms-with-plots-recipes/37327 "2020-04-25T16:36:56Z")

</div>

I would love to have a recipe for Plots.jl that creates a histogram with xerror of the size of the bin, and yerror according to e.g. sqrt(h.weight). So, there are two problems: x-errors do not show up. The scatterhis…

---

## [Why julia is not using all my CPU?](https://discourse.julialang.org/t/why-julia-is-not-using-all-my-cpu/38106)

<div class="topic-metadata">

**Author:** [@Chong\_Wang](https://discourse.julialang.org/u/Chong_Wang)\
**Replies:** 18\
**Last updated:** [April 25, 2020, 4:29pm UTC](https://discourse.julialang.org/t/why-julia-is-not-using-all-my-cpu/38106 "2020-04-25T16:29:10Z")

</div>

I am running the following (test) code on a 24 core machine julia\> Threads.nthreads() 24 julia\> using LinearAlgebra julia\> function foo() Threads.@threads for i in 1:1000000 H = rand(100, 100…

---

## [LightGraphs users (and other interested parties): please opine below](https://discourse.julialang.org/t/lightgraphs-users-and-other-interested-parties-please-opine-below/37660)

<div class="topic-metadata">

**Author:** [@anon94023334](https://discourse.julialang.org/u/anon94023334)\
**Replies:** 25\
**Last updated:** [April 25, 2020, 4:21pm UTC](https://discourse.julialang.org/t/lightgraphs-users-and-other-interested-parties-please-opine-below/37660 "2020-04-25T16:21:23Z")

</div>

Not quite sure how to narrow down the audience to interested parties, so I’m placing this here. LightGraphs 2.0 is in active development. One of the big changes is the movement of functions into separate submodules. (In…

---

## [How to broadcast already defined function to all worker processes in jupyter？](https://discourse.julialang.org/t/how-to-broadcast-already-defined-function-to-all-worker-processes-in-jupyter/38194)

<div class="topic-metadata">

**Author:** [@Pingzi\_Kang](https://discourse.julialang.org/u/Pingzi_Kang)\
**Replies:** 1\
**Last updated:** [April 25, 2020, 2:18pm UTC](https://discourse.julialang.org/t/how-to-broadcast-already-defined-function-to-all-worker-processes-in-jupyter/38194 "2020-04-25T14:18:24Z")

</div>

Hello everyone, I am a beginner for Julia. When I use Distributed to speed up my program, I found such a problem: I have defined a large number of functions and constants in Jupyter, if I need to use Distributed, then I…

---

## [Savefig not searchable pdf in 1.4](https://discourse.julialang.org/t/savefig-not-searchable-pdf-in-1-4/38172)

<div class="topic-metadata">

**Author:** [@Varghese](https://discourse.julialang.org/u/Varghese)\
**Replies:** 2\
**Last updated:** [April 25, 2020, 2:08pm UTC](https://discourse.julialang.org/t/savefig-not-searchable-pdf-in-1-4/38172 "2020-04-25T14:08:50Z")

</div>

In Julia 1.2 savefig to pdf creates low file size with searchable text. With Julia 1.4, the file size is a lot bigger and the text is not searchable, (but the png images are prettier). How do I create searchable pdf in 1…

---

## [Submodules discouraged?](https://discourse.julialang.org/t/submodules-discouraged/38190)

<div class="topic-metadata">

**Author:** [@evanfields](https://discourse.julialang.org/u/evanfields)\
**Replies:** 3\
**Last updated:** [April 25, 2020, 1:06pm UTC](https://discourse.julialang.org/t/submodules-discouraged/38190 "2020-04-25T13:06:11Z")

</div>

I think I’ve heard on Discourse and Slack that using submodules as internal helper modules for code organization is discouraged, tends to cause more problems than it solves, etc. This seems quite surprising to me. Is it…

---

## [The structure of the registry](https://discourse.julialang.org/t/the-structure-of-the-registry/38188)

<div class="topic-metadata">

**Author:** [@alirezamecheng](https://discourse.julialang.org/u/alirezamecheng)\
**Replies:** 2\
**Last updated:** [April 25, 2020, 12:45pm UTC](https://discourse.julialang.org/t/the-structure-of-the-registry/38188 "2020-04-25T12:45:32Z")

</div>

Hello everyone, If I’m getting this right, the only thing that must be unique for every package is the UUID of that package. Meaning that it is possible to have packages with the same name, although it has been encourag…

---

## [Why Pmap() skipping a combination in the function arguments](https://discourse.julialang.org/t/why-pmap-skipping-a-combination-in-the-function-arguments/38152)

<div class="topic-metadata">

**Author:** [@Saptarshi\_Ghosh](https://discourse.julialang.org/u/Saptarshi_Ghosh)\
**Replies:** 1\
**Last updated:** [April 25, 2020, 12:12pm UTC](https://discourse.julialang.org/t/why-pmap-skipping-a-combination-in-the-function-arguments/38152 "2020-04-25T12:12:13Z")

</div>

Hi! I am new to Julia and wondering about a simple implementation of the julia pmap function. Here is the sample code using Distributed; addprocs(6) #adding workers io = open("myfile.txt", "w"); write(io, "This is a …

---

## [How to "delete" a key from NamedTuple](https://discourse.julialang.org/t/how-to-delete-a-key-from-namedtuple/38179)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 3\
**Last updated:** [April 25, 2020, 8:34am UTC](https://discourse.julialang.org/t/how-to-delete-a-key-from-namedtuple/38179 "2020-04-25T08:34:07Z")

</div>

I know tuples are meant to be immutable, but I am interested in a way to create a new named tuple B that is the same as A except that it has :key1 deleted. I was hoping something like this would work B = delete(A, :key…

---

## [How to parse a string as a Date where the year is a leap one, if the year is not specified in the string?](https://discourse.julialang.org/t/how-to-parse-a-string-as-a-date-where-the-year-is-a-leap-one-if-the-year-is-not-specified-in-the-string/38176)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 2\
**Last updated:** [April 25, 2020, 5:22am UTC](https://discourse.julialang.org/t/how-to-parse-a-string-as-a-date-where-the-year-is-a-leap-one-if-the-year-is-not-specified-in-the-string/38176 "2020-04-25T05:22:59Z")

</div>

I have a series of date strings of the form "01 Feb", "02 Feb". I am trying to parse these as Date objects, except it fails as it doesn’t recognize that there were 29 days in Feb this year. Since the year is not specifi…

---

## [Where is the path \`@v#.#\` and \`@stdlib\`?](https://discourse.julialang.org/t/where-is-the-path-v-and-stdlib/38175)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 1\
**Last updated:** [April 25, 2020, 3:59am UTC](https://discourse.julialang.org/t/where-is-the-path-v-and-stdlib/38175 "2020-04-25T03:59:33Z")

</div>

When I type LOAD\_PATH I get 3-element Array{String,1}: "@" "@v#.#" "@stdlib" I read in the environment variable documentation that If the variable is set to @. then Julia tries to find a project directory that con…

---

## [Dispatch on parametric type](https://discourse.julialang.org/t/dispatch-on-parametric-type/37978)

<div class="topic-metadata">

**Author:** [@mzilhao](https://discourse.julialang.org/u/mzilhao)\
**Replies:** 11\
**Last updated:** [April 24, 2020, 10:05pm UTC](https://discourse.julialang.org/t/dispatch-on-parametric-type/37978 "2020-04-24T22:05:31Z")

</div>

I’m writing an application where I’ve found it convenient to dispatch on the parameters of some structs. Something like the following: abstract type MyType end abstract type A \<: MyType end abstract type B \<: MyType end…

---

## [LoadError: UndefVarError: Penalty not defined](https://discourse.julialang.org/t/loaderror-undefvarerror-penalty-not-defined/38046)

<div class="topic-metadata">

**Author:** [@DKad](https://discourse.julialang.org/u/DKad)\
**Replies:** 16\
**Last updated:** [April 24, 2020, 9:58pm UTC](https://discourse.julialang.org/t/loaderror-undefvarerror-penalty-not-defined/38046 "2020-04-24T21:58:37Z")

</div>

Hello, I want to adapt parameters of a differential equation to available data on a computer with julia 1.4.1 on a linux system. julia 1.4.0 has the same problem. Running using DifferentialEquations using Plots is o.…

---

## [This made me smile](https://discourse.julialang.org/t/this-made-me-smile/38064)

<div class="topic-metadata">

**Author:** [@lewis](https://discourse.julialang.org/u/lewis)\
**Replies:** 5\
**Last updated:** [April 24, 2020, 9:12pm UTC](https://discourse.julialang.org/t/this-made-me-smile/38064 "2020-04-24T21:12:57Z")

</div>

Forgive me for patting myself on the back here, but I am so happy with the outcome. In an SEIR simulation of the COVID-19 outbreak (Susceptible, Exposed, Infected, Removed (Recovery or Death), I use a decision tree to t…

---

## [3D polygons in Plots.jl](https://discourse.julialang.org/t/3d-polygons-in-plots-jl/9761)

<div class="topic-metadata">

**Author:** [@rcnlee](https://discourse.julialang.org/u/rcnlee)\
**Replies:** 4\
**Last updated:** [April 24, 2020, 8:55pm UTC](https://discourse.julialang.org/t/3d-polygons-in-plots-jl/9761 "2020-04-24T20:55:01Z")

</div>

Is there an equivalent to Matlab’s fill3 in Plots.jl to create filled shapes in 3D? I see Plots.Shape, but it looks like it only supports 2D. Thanks!

---

## [Defining method for type before declaring that type](https://discourse.julialang.org/t/defining-method-for-type-before-declaring-that-type/38164)

<div class="topic-metadata">

**Author:** [@cojua8](https://discourse.julialang.org/u/cojua8)\
**Replies:** 3\
**Last updated:** [April 24, 2020, 8:50pm UTC](https://discourse.julialang.org/t/defining-method-for-type-before-declaring-that-type/38164 "2020-04-24T20:50:43Z")

</div>

Hi, For some reason (I know that it can be bad architecture), I need to write functions for a type that is not yet declared. Is there a way to do this?

---

## [Get power flow equations from PowerModels?](https://discourse.julialang.org/t/get-power-flow-equations-from-powermodels/33673)

<div class="topic-metadata">

**Author:** [@timueh](https://discourse.julialang.org/u/timueh)\
**Replies:** 5\
**Last updated:** [April 24, 2020, 7:27pm UTC](https://discourse.julialang.org/t/get-power-flow-equations-from-powermodels/33673 "2020-04-24T19:27:07Z")

</div>

Is it possible to obtain the power flow equations in the form of f(x) = 0 from PowerModels.jl? Follow-up question, is it possible to get the system of nonlinear equations h(x) = 0 that make up a power flow problem, i.e.…

---

## [High CPU Usage on Startup - VSCode OSX](https://discourse.julialang.org/t/high-cpu-usage-on-startup-vscode-osx/33280)

<div class="topic-metadata">

**Author:** [@loki](https://discourse.julialang.org/u/loki)\
**Replies:** 7\
**Last updated:** [April 24, 2020, 7:20pm UTC](https://discourse.julialang.org/t/high-cpu-usage-on-startup-vscode-osx/33280 "2020-04-24T19:20:57Z")

</div>

Hello, I was forced to switch over from Atom to VSCode and noticed some strange behavior when starting VSCode. Whenever I start up VSCode a Julia process is created that uses 100% CPU usage even before Julia/REPL is sta…

---

## [Avoid repeated memory allocation by defining an Array{Float64} outside of optimize() using Optim.jl, ForwardDiff.jl](https://discourse.julialang.org/t/avoid-repeated-memory-allocation-by-defining-an-array-float64-outside-of-optimize-using-optim-jl-forwarddiff-jl/37357)

<div class="topic-metadata">

**Author:** [@Maximilian](https://discourse.julialang.org/u/Maximilian)\
**Replies:** 7\
**Last updated:** [April 24, 2020, 6:58pm UTC](https://discourse.julialang.org/t/avoid-repeated-memory-allocation-by-defining-an-array-float64-outside-of-optimize-using-optim-jl-forwarddiff-jl/37357 "2020-04-24T18:58:01Z")

</div>

I am using Optim.jl with an objective that is computed by multipliying, transposing and inverting some matrices (maximum size of about 500x500). However, I have only a few parameters (maximum 200), each one having a fixe…

---

## [Automatic generation of parametric functions](https://discourse.julialang.org/t/automatic-generation-of-parametric-functions/38151)

<div class="topic-metadata">

**Author:** [@Isaia\_Nisoli](https://discourse.julialang.org/u/Isaia_Nisoli)\
**Replies:** 5\
**Last updated:** [April 24, 2020, 6:24pm UTC](https://discourse.julialang.org/t/automatic-generation-of-parametric-functions/38151 "2020-04-24T18:24:08Z")

</div>

Dear all, I have a parametric Type, for simplicity suppose something like struct Foo{T} x::T end a list of function symbols (i.e. :sin, :cos, etc) and I would like to generate a function for each element in my …

---

## [Date(year + quarter)?](https://discourse.julialang.org/t/date-year-quarter/37782)

<div class="topic-metadata">

**Author:** [@BMval](https://discourse.julialang.org/u/BMval)\
**Replies:** 3\
**Last updated:** [April 18, 2020, 12:00am UTC](https://discourse.julialang.org/t/date-year-quarter/37782 "2020-04-18T00:00:35Z")

</div>

Good day. I have a quarterly dataset. Would you suggest, How I can keep dates in format: year + quarter. For instance: 2010Y3Q. So Dates allow creating date by date(year, month). Is it some way to create date by date(y…

---

## [Better handling of pathnames](https://discourse.julialang.org/t/better-handling-of-pathnames/36792)

<div class="topic-metadata">

**Author:** [@jessymilare](https://discourse.julialang.org/u/jessymilare)\
**Replies:** 35\
**Last updated:** [April 24, 2020, 3:51pm UTC](https://discourse.julialang.org/t/better-handling-of-pathnames/36792 "2020-04-24T15:51:04Z")

</div>

I’m new to Julia, loving it. As I’m used to Common Lisp, I kinda miss a pathname structure. Of course I understand strings are easier to deal with, yet they lead to mistakes. The package FilePaths.jl is nice, yet it is w…

---

## [A couple of questions about Artifacts](https://discourse.julialang.org/t/a-couple-of-questions-about-artifacts/33367)

<div class="topic-metadata">

**Author:** [@dmbates](https://discourse.julialang.org/u/dmbates)\
**Replies:** 11\
**Last updated:** [April 24, 2020, 3:40pm UTC](https://discourse.julialang.org/t/a-couple-of-questions-about-artifacts/33367 "2020-04-24T15:40:25Z")

</div>

Coming from an R background where it is common to have data sets included with packages I have been thinking about similar capabilities for Julia packages. One approach would be to use Artifacts as described in Pkg + Bin…

---

## [How to test plot recipes?](https://discourse.julialang.org/t/how-to-test-plot-recipes/2648)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 5\
**Last updated:** [April 24, 2020, 3:29pm UTC](https://discourse.julialang.org/t/how-to-test-plot-recipes/2648 "2020-04-24T15:29:29Z")

</div>

Plot recipes can reduce the test coverage considerably. For example, my coverage is currently at 76% and a big part of the remaining 24% is due to a plot recipe: Codecov How should I go about testing plot recipes? Is th…

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

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