# Latest

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

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

**Page:** 1337

---

## [Union splitting vs C++](https://discourse.julialang.org/t/union-splitting-vs-c/61772)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 22\
**Last updated:** [July 9, 2021, 12:32am UTC](https://discourse.julialang.org/t/union-splitting-vs-c/61772 "2021-07-09T00:32:18Z")

</div>

This is a continuation from this thread: Performance drawback with subtyping - #31 by paulmelis Here we have two codes, which compute someting simple (the sum of the values of a field of a type in an array of mixed type…

---

## [\[ANN\] WebMSISE00.jl package](https://discourse.julialang.org/t/ann-webmsise00-jl-package/64308)

<div class="topic-metadata">

**Author:** [@fyzycyst](https://discourse.julialang.org/u/fyzycyst)\
**Replies:** 0\
**Last updated:** [July 8, 2021, 9:44pm UTC](https://discourse.julialang.org/t/ann-webmsise00-jl-package/64308 "2021-07-08T21:44:46Z")

</div>

This is a small package I did as my initial foray into Julia beyond the ‘learn by watching tutorials’ stage. Programmatically accesses the NASA ModelWeb site and uses their web interface to execute the MSISE00 earth atmo…

---

## [Row vs. column major for arrays of coordinate vectors](https://discourse.julialang.org/t/row-vs-column-major-for-arrays-of-coordinate-vectors/64297)

<div class="topic-metadata">

**Author:** [@pavanakumar](https://discourse.julialang.org/u/pavanakumar)\
**Replies:** 7\
**Last updated:** [July 8, 2021, 8:47pm UTC](https://discourse.julialang.org/t/row-vs-column-major-for-arrays-of-coordinate-vectors/64297 "2021-07-08T20:47:02Z")

</div>

There is one advantage that I can think of with column major storage for geometry (coordinate storage). 1D, 2D and 3D coordinates can be represented without hassle. A row-major format will require variable stride (1 in 1…

---

## [Quantum computing at AWS](https://discourse.julialang.org/t/quantum-computing-at-aws/64224)

<div class="topic-metadata">

**Author:** [@ajkeller34](https://discourse.julialang.org/u/ajkeller34)\
**Replies:** 2\
**Last updated:** [July 8, 2021, 8:45pm UTC](https://discourse.julialang.org/t/quantum-computing-at-aws/64224 "2021-07-08T20:45:24Z")

</div>

Interested to work on quantum computing at AWS? Please take a look at the role below and consider applying! Please kindly note for this role we have a preference for Julia and/or C++ experience. https://www.amazon.jobs/…

---

## [How do I find the shadow price of anonymous constraints?](https://discourse.julialang.org/t/how-do-i-find-the-shadow-price-of-anonymous-constraints/29349)

<div class="topic-metadata">

**Author:** [@Leonardo\_Rivera](https://discourse.julialang.org/u/Leonardo_Rivera)\
**Replies:** 2\
**Last updated:** [July 8, 2021, 7:59pm UTC](https://discourse.julialang.org/t/how-do-i-find-the-shadow-price-of-anonymous-constraints/29349 "2021-07-08T19:59:45Z")

</div>

Hello! I have a model in which I need to create constraints for the non-zero elements of a sparse matrix (a parameter). I create them as anonymous constraints, but I do not know how to find their dual values after the mo…

---

## [Building a cubic spline interpolator using points and specifying derivatives](https://discourse.julialang.org/t/building-a-cubic-spline-interpolator-using-points-and-specifying-derivatives/64238)

<div class="topic-metadata">

**Author:** [@donkeysaddle](https://discourse.julialang.org/u/donkeysaddle)\
**Replies:** 6\
**Last updated:** [July 8, 2021, 7:49pm UTC](https://discourse.julialang.org/t/building-a-cubic-spline-interpolator-using-points-and-specifying-derivatives/64238 "2021-07-08T19:49:01Z")

</div>

Is there a way to build a cubic spline in either Interpolations.jl or Dierckx.jl (or somewhere else) where you can set what the derivatives should be at specified points. Ideally, these derivatives would not have to be a…

---

## [Constrained parameters in Turing](https://discourse.julialang.org/t/constrained-parameters-in-turing/64086)

<div class="topic-metadata">

**Author:** [@Elmo](https://discourse.julialang.org/u/Elmo)\
**Replies:** 3\
**Last updated:** [July 8, 2021, 7:40pm UTC](https://discourse.julialang.org/t/constrained-parameters-in-turing/64086 "2021-07-08T19:40:55Z")

</div>

Hi all, Is it possible to set up a model in Turing so that the posterior distribution of some parameters satisfy a set of constraints? For example, suppose I want to do linear regression, but from physical principles I…

---

## [\[ANN\] SBMLToolkit importer of biomodels](https://discourse.julialang.org/t/ann-sbmltoolkit-importer-of-biomodels/64271)

<div class="topic-metadata">

**Author:** [@paulflang](https://discourse.julialang.org/u/paulflang)\
**Replies:** 5\
**Last updated:** [July 8, 2021, 7:35pm UTC](https://discourse.julialang.org/t/ann-sbmltoolkit-importer-of-biomodels/64271 "2021-07-08T19:35:09Z")

</div>

What is SBMLToolkit? We recently released SBMLToolkit.jl, an importer of dynamic biological models specified in the Systems Biology Markup Language (SBML) to the SciML ecosystem. For constraint-based modeling please ref…

---

## [Handling functions that have "constant" sub-expressions when looping over arguments](https://discourse.julialang.org/t/handling-functions-that-have-constant-sub-expressions-when-looping-over-arguments/64181)

<div class="topic-metadata">

**Author:** [@nchisholm](https://discourse.julialang.org/u/nchisholm)\
**Replies:** 3\
**Last updated:** [July 8, 2021, 7:26pm UTC](https://discourse.julialang.org/t/handling-functions-that-have-constant-sub-expressions-when-looping-over-arguments/64181 "2021-07-08T19:26:10Z")

</div>

Very commonly, I want to define some function mainfunc and then evaluate it many times in a loop where some of the arguments are constant during looping but others vary with each iteration. Here is an example of what I …

---

## [Structure type + in place modification of columns of arrays](https://discourse.julialang.org/t/structure-type-in-place-modification-of-columns-of-arrays/64275)

<div class="topic-metadata">

**Author:** [@dmetivie](https://discourse.julialang.org/u/dmetivie)\
**Replies:** 4\
**Last updated:** [July 8, 2021, 6:35pm UTC](https://discourse.julialang.org/t/structure-type-in-place-modification-of-columns-of-arrays/64275 "2021-07-08T18:35:24Z")

</div>

In this post, I have two questions I am not sure are completely separate or not, so I ask them both here. I define a structure and a substructure that has a field B which is an array of Distributions. It can be univ…

---

## [Multiplying by booleans faster than if/else](https://discourse.julialang.org/t/multiplying-by-booleans-faster-than-if-else/64117)

<div class="topic-metadata">

**Author:** [@PatrickMcFarlane](https://discourse.julialang.org/u/PatrickMcFarlane)\
**Replies:** 23\
**Last updated:** [July 8, 2021, 6:06pm UTC](https://discourse.julialang.org/t/multiplying-by-booleans-faster-than-if-else/64117 "2021-07-08T18:06:41Z")

</div>

I have been using @btime to check the speed of various little functions I’m working on that involve conditionals. I’ve found that multiplying by booleans instead of using if/else statements seems to be much faster. But…

---

## [No figures generated after deploying with Documenter](https://discourse.julialang.org/t/no-figures-generated-after-deploying-with-documenter/64242)

<div class="topic-metadata">

**Author:** [@RaulDurand](https://discourse.julialang.org/u/RaulDurand)\
**Replies:** 5\
**Last updated:** [July 8, 2021, 4:47pm UTC](https://discourse.julialang.org/t/no-figures-generated-after-deploying-with-documenter/64242 "2021-07-08T16:47:16Z")

</div>

I am working on the documentation of an unregistered package (GitHub - NumSoftware/Amaru.jl at gh-pages). I have several examples in the markdown that generate figures using PyPlot. Then I deploy using Actions. On the …

---

## [Combining @eval and @testset macros](https://discourse.julialang.org/t/combining-eval-and-testset-macros/64250)

<div class="topic-metadata">

**Author:** [@ajhynes7](https://discourse.julialang.org/u/ajhynes7)\
**Replies:** 2\
**Last updated:** [July 8, 2021, 4:40pm UTC](https://discourse.julialang.org/t/combining-eval-and-testset-macros/64250 "2021-07-08T16:40:14Z")

</div>

I’m trying to test two types that have similar properties. I want to perform the same set of tests on instances of the two types. If I was using Python, I would use the @pytest.mark.parametrize decorator to accomplish th…

---

## [SparseArray cannot store arbitrary type, but only types which support zero](https://discourse.julialang.org/t/sparsearray-cannot-store-arbitrary-type-but-only-types-which-support-zero/64283)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 6\
**Last updated:** [July 8, 2021, 4:10pm UTC](https://discourse.julialang.org/t/sparsearray-cannot-store-arbitrary-type-but-only-types-which-support-zero/64283 "2021-07-08T16:10:18Z")

</div>

I think this is a bug report to Julia, however I first would like to gather some thoughts. Concretely, I cannot map over a SparseVector of Functions. julia\> a = SparseVector(\[1, 2\]) 2-element SparseVector{Int64, Int64}…

---

## [Kernel density (w/ weights)](https://discourse.julialang.org/t/kernel-density-w-weights/64278)

<div class="topic-metadata">

**Author:** [@juliauser](https://discourse.julialang.org/u/juliauser)\
**Replies:** 1\
**Last updated:** [July 8, 2021, 3:00pm UTC](https://discourse.julialang.org/t/kernel-density-w-weights/64278 "2021-07-08T15:00:06Z")

</div>

Hello, I have a vector of variables x, and a vector of weights y (y sums to 1). How can plot the pdf of the vector x? Something like histogram(x,weights=y) but smoothed out.

---

## [PSA: floating-point arithmetic](https://discourse.julialang.org/t/psa-floating-point-arithmetic/8678)

<div class="topic-metadata">

**Author:** [@John\_Gibson](https://discourse.julialang.org/u/John_Gibson)\
**Replies:** 13\
**Last updated:** [July 8, 2021, 2:46pm UTC](https://discourse.julialang.org/t/psa-floating-point-arithmetic/8678 "2021-07-08T14:46:13Z")

</div>

Sometimes people are surprised by the results of floating-point calculations such as julia\> 5/6 0.8333333333333334 # shouldn't the last digit be 3? julia\> 2.6 - 0.7 - 1.9 2.220446049250313e-16 …

---

## [The Run button doesn't work](https://discourse.julialang.org/t/the-run-button-doesnt-work/64213)

<div class="topic-metadata">

**Author:** [@sajad\_ghassemi](https://discourse.julialang.org/u/sajad_ghassemi)\
**Replies:** 19\
**Last updated:** [July 8, 2021, 1:25pm UTC](https://discourse.julialang.org/t/the-run-button-doesnt-work/64213 "2021-07-08T13:25:42Z")

</div>

Hi dear friends, Thanks for reading my Message, I am a newbie.I don’t know why the Run button in Julia doesn’t work and I have to copy the code and paste it in REPL. Is there any option I can solve my problem or an opt…

---

## [How to pass/use \`julia\_args\` argument to \`Pkg.test()\`?](https://discourse.julialang.org/t/how-to-pass-use-julia-args-argument-to-pkg-test/64274)

<div class="topic-metadata">

**Author:** [@johnomotani](https://discourse.julialang.org/u/johnomotani)\
**Replies:** 3\
**Last updated:** [July 8, 2021, 1:24pm UTC](https://discourse.julialang.org/t/how-to-pass-use-julia-args-argument-to-pkg-test/64274 "2021-07-08T13:24:36Z")

</div>

I’d like to pass some option(s) to my tests, in particular a flag (or something) that I can pass to include extra (but slow) tests. I can see (12. API Reference · Pkg.jl) that Pkg.test() has keyword arguments julia\_args …

---

## [Converting Pandas DataFrame to Julia DataFrame?](https://discourse.julialang.org/t/converting-pandas-dataframe-to-julia-dataframe/15356)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 19\
**Last updated:** [July 8, 2021, 1:21pm UTC](https://discourse.julialang.org/t/converting-pandas-dataframe-to-julia-dataframe/15356 "2021-07-08T13:21:31Z")

</div>

Pandas.jl is pretty nice. Is there an easy way to convert from Pandas DataFrame to Julia DataFrame? e.g. julia\> df = read\_csv("iris.csv") Unnamed: 0 Sepal.Length Sepal.Width Petal.Length Petal.Width Spec…

---

## [Compat bounds for indirect dependencies](https://discourse.julialang.org/t/compat-bounds-for-indirect-dependencies/64268)

<div class="topic-metadata">

**Author:** [@ranocha](https://discourse.julialang.org/u/ranocha)\
**Replies:** 3\
**Last updated:** [July 8, 2021, 11:48am UTC](https://discourse.julialang.org/t/compat-bounds-for-indirect-dependencies/64268 "2021-07-08T11:48:04Z")

</div>

Sometimes, indirect dependencies of packages will introduce bugs such that they don’t work anymore with our packages. The \[compat\] section of Project.toml allows us to restrict the versions of direct dependencies. Is i…

---

## [Type instability with enumerate in comprehension](https://discourse.julialang.org/t/type-instability-with-enumerate-in-comprehension/63526)

<div class="topic-metadata">

**Author:** [@UselessAnsatz](https://discourse.julialang.org/u/UselessAnsatz)\
**Replies:** 1\
**Last updated:** [July 8, 2021, 10:42am UTC](https://discourse.julialang.org/t/type-instability-with-enumerate-in-comprehension/63526 "2021-07-08T10:42:28Z")

</div>

I stumbled upon a very confusing form of type instability recently involving enumerate in a comprehension. I’ve found a way around it, but I have no idea what’s causing it. According to @code\_warntype, the following cod…

---

## [Boxing of integer when looping vector over 512 index](https://discourse.julialang.org/t/boxing-of-integer-when-looping-vector-over-512-index/64259)

<div class="topic-metadata">

**Author:** [@dpinol](https://discourse.julialang.org/u/dpinol)\
**Replies:** 2\
**Last updated:** [July 8, 2021, 10:40am UTC](https://discourse.julialang.org/t/boxing-of-integer-when-looping-vector-over-512-index/64259 "2021-07-08T10:40:06Z")

</div>

Weird allocation that depends on array contents · Issue #36751 · JuliaLang/julia · GitHub & memory allocation increases unexpectedly in sparse getindex at a threshold · Issue #18051 · JuliaLang/julia · GitHub mention llv…

---

## [Handling events in DifferentialEquations.jl that take place over a time interval](https://discourse.julialang.org/t/handling-events-in-differentialequations-jl-that-take-place-over-a-time-interval/64262)

<div class="topic-metadata">

**Author:** [@yuvalw](https://discourse.julialang.org/u/yuvalw)\
**Replies:** 1\
**Last updated:** [July 8, 2021, 10:06am UTC](https://discourse.julialang.org/t/handling-events-in-differentialequations-jl-that-take-place-over-a-time-interval/64262 "2021-07-08T10:06:16Z")

</div>

Hello, I am wondering what is the best way to implement events that happen during a time interval that affect an element of the derivative. Currently my code is of the form: intervals = \[1.0 2.0; 5.0 6.0; 9.0 10.0\] # e…

---

## ["Literate" leaves behind extraneous #](https://discourse.julialang.org/t/literate-leaves-behind-extraneous/44777)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 8\
**Last updated:** [July 8, 2021, 9:49am UTC](https://discourse.julialang.org/t/literate-leaves-behind-extraneous/44777 "2021-07-08T09:49:12Z")

</div>

I use “cells” in a Julia script. VS code can execute these cells with a single keystroke. The problem is that when I generate the markdown from the script with Literate, the cell markers (##) are interpreted as markdown…

---

## [Problems fetching "Registry General" package from github](https://discourse.julialang.org/t/problems-fetching-registry-general-package-from-github/58639)

<div class="topic-metadata">

**Author:** [@Travelling\_Circus](https://discourse.julialang.org/u/Travelling_Circus)\
**Replies:** 7\
**Last updated:** [July 8, 2021, 8:42am UTC](https://discourse.julialang.org/t/problems-fetching-registry-general-package-from-github/58639 "2021-07-08T08:42:11Z")

</div>

Hello, I am totally new to the language, the Juno editor and the Atom environment. Good start, boy! :smile: The REPL in Atom/Juno fails to install packages from the first time it is started. In particular I get an err…

---

## [How to use @\_\_FILE\_\_ and @\_\_LINE\_\_ correctly in my own macro?](https://discourse.julialang.org/t/how-to-use-file-and-line-correctly-in-my-own-macro/64256)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 4\
**Last updated:** [July 8, 2021, 8:36am UTC](https://discourse.julialang.org/t/how-to-use-file-and-line-correctly-in-my-own-macro/64256 "2021-07-08T08:36:00Z")

</div>

Hey all :slight\_smile: I’m writing my own logging package. I want to send strings to two places. function log(s::String, file, line) to\_log = "$(Dates.now(Dates.UTC)) in $file:$line\\n$s\\n" TrinityApi.informatio…

---

## [Makie - Setting \`zlims!\` on an \`Axis3\` sets \`ylims!\` instead](https://discourse.julialang.org/t/makie-setting-zlims-on-an-axis3-sets-ylims-instead/64254)

<div class="topic-metadata">

**Author:** [@cryptic.ax](https://discourse.julialang.org/u/cryptic.ax)\
**Replies:** 1\
**Last updated:** [July 8, 2021, 8:04am UTC](https://discourse.julialang.org/t/makie-setting-zlims-on-an-axis3-sets-ylims-instead/64254 "2021-07-08T08:04:55Z")

</div>

Hi! I’m having some weird issues making 3D plots with Makie.jl. Consider the following mockup: fig = Figure(; resolution = (600, 600)) ax = fig\[1, 1\] = Axis3(fig) xlims!(ax, (0., 10.)) # works perfectly ylims!(ax, (0.,…

---

## [Makie - Long plotting times for 3D plots using CairoMakie](https://discourse.julialang.org/t/makie-long-plotting-times-for-3d-plots-using-cairomakie/64255)

<div class="topic-metadata">

**Author:** [@cryptic.ax](https://discourse.julialang.org/u/cryptic.ax)\
**Replies:** 1\
**Last updated:** [July 8, 2021, 8:03am UTC](https://discourse.julialang.org/t/makie-long-plotting-times-for-3d-plots-using-cairomakie/64255 "2021-07-08T08:03:13Z")

</div>

I’m trying to record a video of a 3D plot using CairoMakie. My plot consists of one surface! in a (205, 205, 40) size region, and approximately 300 spheres scattered around the same region. Each frame take around 17s to …

---

## [Do FFTW.jl and Quadmath.jl work together automatically?](https://discourse.julialang.org/t/do-fftw-jl-and-quadmath-jl-work-together-automatically/64237)

<div class="topic-metadata">

**Author:** [@johnomotani](https://discourse.julialang.org/u/johnomotani)\
**Replies:** 3\
**Last updated:** [July 8, 2021, 6:38am UTC](https://discourse.julialang.org/t/do-fftw-jl-and-quadmath-jl-work-together-automatically/64237 "2021-07-08T06:38:59Z")

</div>

If some Arrays (or whatever) are defined using the Float128 type from Quadmath.jl, will operations from FFTW.jl be done in quad precision? The FFTW library itself supports quad-precision (Precision (FFTW 3.3.10)), but I …

---

## [Suppress Stacktrace when a test fails](https://discourse.julialang.org/t/suppress-stacktrace-when-a-test-fails/19834)

<div class="topic-metadata">

**Author:** [@curious](https://discourse.julialang.org/u/curious)\
**Replies:** 6\
**Last updated:** [July 8, 2021, 4:36am UTC](https://discourse.julialang.org/t/suppress-stacktrace-when-a-test-fails/19834 "2021-07-08T04:36:31Z")

</div>

Is there a way to suppress Stacktrace output when a test fails when using @test macro? I just want to know which test failed and what the expected output was and what the actual output was. The @test macro provides this …

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

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