# Latest

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

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

**Page:** 1070

---

## [Iterating on Tuple allocates memory if values don't have identical types](https://discourse.julialang.org/t/iterating-on-tuple-allocates-memory-if-values-dont-have-identical-types/79410)

<div class="topic-metadata">

**Author:** [@jdebecdelievre](https://discourse.julialang.org/u/jdebecdelievre)\
**Replies:** 4\
**Last updated:** [April 13, 2022, 6:56am UTC](https://discourse.julialang.org/t/iterating-on-tuple-allocates-memory-if-values-dont-have-identical-types/79410 "2022-04-13T06:56:39Z")

</div>

Hi, Could someone help me understand why iterating on a tuple seems much slower if the values have non-unique types? Here is a very simple example: a = 1. b = \[1.\] c = \[1.\] A = (a, b) B = (b, c) @btime for d=$A; d; en…

---

## [Enforcing dependencies in my own package](https://discourse.julialang.org/t/enforcing-dependencies-in-my-own-package/16967)

<div class="topic-metadata">

**Author:** [@macroscian](https://discourse.julialang.org/u/macroscian)\
**Replies:** 9\
**Last updated:** [April 13, 2022, 6:34am UTC](https://discourse.julialang.org/t/enforcing-dependencies-in-my-own-package/16967 "2022-04-13T06:34:23Z")

</div>

I’m trying to write a package (my first, so apologies for ignorance) using Julia 1.0.1 that depends on the master version of an existing package Pages.jl, but am struggling to enforce this. My current method is, in REP…

---

## [Lots of messages printed out when I evaluate the model using MLJ](https://discourse.julialang.org/t/lots-of-messages-printed-out-when-i-evaluate-the-model-using-mlj/79415)

<div class="topic-metadata">

**Author:** [@Sijun](https://discourse.julialang.org/u/Sijun)\
**Replies:** 5\
**Last updated:** [April 13, 2022, 5:23am UTC](https://discourse.julialang.org/t/lots-of-messages-printed-out-when-i-evaluate-the-model-using-mlj/79415 "2022-04-13T05:23:36Z")

</div>

I see lots of messages printed out when I evaluate the model: There are "error"s in the printed messeges. Are they really errors? how critical is it? or can I just ignore them? (The evaluation result looks fine thoug…

---

## [A problem with SOCP constraint](https://discourse.julialang.org/t/a-problem-with-socp-constraint/79414)

<div class="topic-metadata">

**Author:** [@mahon](https://discourse.julialang.org/u/mahon)\
**Replies:** 4\
**Last updated:** [April 13, 2022, 5:03am UTC](https://discourse.julialang.org/t/a-problem-with-socp-constraint/79414 "2022-04-13T05:03:41Z")

</div>

I want to formulate a SOCP constraint like this using Mosek and my code here all variables are 32 × 24 matrix，but it pulls a error and if i give the concrete row and columns ，it works

---

## [Error Handling in Quote Block using JuMP](https://discourse.julialang.org/t/error-handling-in-quote-block-using-jump/79362)

<div class="topic-metadata">

**Author:** [@hdavid16](https://discourse.julialang.org/u/hdavid16)\
**Replies:** 10\
**Last updated:** [April 13, 2022, 4:44am UTC](https://discourse.julialang.org/t/error-handling-in-quote-block-using-jump/79362 "2022-04-13T04:44:03Z")

</div>

I am puzzled by the following: using JuMP m = Model() @variable(m,x) code = quote try 1 catch e @NLconstraint($m, 0 .\<= exp($x)) end end eval(code) ERROR: At REPL\[240\]:5: \`@NLconstraint(Fe…

---

## [Best practice for array allocation in self-consistent calculations](https://discourse.julialang.org/t/best-practice-for-array-allocation-in-self-consistent-calculations/79371)

<div class="topic-metadata">

**Author:** [@jsjie](https://discourse.julialang.org/u/jsjie)\
**Replies:** 10\
**Last updated:** [April 13, 2022, 1:48am UTC](https://discourse.julialang.org/t/best-practice-for-array-allocation-in-self-consistent-calculations/79371 "2022-04-13T01:48:30Z")

</div>

In computational physics, self-consistent calculations are frequently met. In such calchlations, a function might be called repeatedly, and there might be some auxiliary arrays that are used in the function, which will k…

---

## [Indexing on Vectorized Constraints in JuMP](https://discourse.julialang.org/t/indexing-on-vectorized-constraints-in-jump/79382)

<div class="topic-metadata">

**Author:** [@hdavid16](https://discourse.julialang.org/u/hdavid16)\
**Replies:** 4\
**Last updated:** [April 12, 2022, 11:46pm UTC](https://discourse.julialang.org/t/indexing-on-vectorized-constraints-in-jump/79382 "2022-04-12T23:46:21Z")

</div>

I was looking at the example for vectorized constraints in the docs (Constraints · JuMP), which creates the constraint: @constraint(model, con, A \* x .== b) 2-element Vector{ConstraintRef{Model, MathOptInterface.Constr…

---

## [How to set Julia Default to iTerm2](https://discourse.julialang.org/t/how-to-set-julia-default-to-iterm2/57988)

<div class="topic-metadata">

**Author:** [@Scotsman](https://discourse.julialang.org/u/Scotsman)\
**Replies:** 2\
**Last updated:** [April 12, 2022, 11:37pm UTC](https://discourse.julialang.org/t/how-to-set-julia-default-to-iterm2/57988 "2022-04-12T23:37:22Z")

</div>

New user who would like to have Julia start in iTerm2 instead of Apple’s terminal. Can anyone point me how to change that? Thanks

---

## [Convexity-Preserving Rational Interpolation](https://discourse.julialang.org/t/convexity-preserving-rational-interpolation/79112)

<div class="topic-metadata">

**Author:** [@liamfdoherty](https://discourse.julialang.org/u/liamfdoherty)\
**Replies:** 11\
**Last updated:** [April 12, 2022, 10:08pm UTC](https://discourse.julialang.org/t/convexity-preserving-rational-interpolation/79112 "2022-04-12T22:08:54Z")

</div>

Hi all! First time poster here. I have a univariate convex function that I would like to optimize. However, it is very expensive to evaluate (due to large variances from Monte Carlo estimation) and I would like to inter…

---

## [Recursive call vs while loop](https://discourse.julialang.org/t/recursive-call-vs-while-loop/7723)

<div class="topic-metadata">

**Author:** [@anon61610682](https://discourse.julialang.org/u/anon61610682)\
**Replies:** 21\
**Last updated:** [April 12, 2022, 9:40pm UTC](https://discourse.julialang.org/t/recursive-call-vs-while-loop/7723 "2022-04-12T21:40:12Z")

</div>

I have been playing with parametric methods to imitate the template programming of, say, C++. I seem to have some performance overhead when I prefer using method recursion to using a loop. Compare, for instance, the bel…

---

## [\[Flux / Zygote\] Circumvent long compilation times](https://discourse.julialang.org/t/flux-zygote-circumvent-long-compilation-times/79385)

<div class="topic-metadata">

**Author:** [@Tengrath](https://discourse.julialang.org/u/Tengrath)\
**Replies:** 1\
**Last updated:** [April 12, 2022, 8:30pm UTC](https://discourse.julialang.org/t/flux-zygote-circumvent-long-compilation-times/79385 "2022-04-12T20:30:33Z")

</div>

I have implemented a custom physics in model Flux / Zygote to benefit from gradient-based optimization of these great packages. It contains custom layers, each shipping its own ChainRulesCore.rrule. A single model contai…

---

## [Scenarios defining](https://discourse.julialang.org/t/scenarios-defining/79401)

<div class="topic-metadata">

**Author:** [@HosseinF](https://discourse.julialang.org/u/HosseinF)\
**Replies:** 1\
**Last updated:** [April 12, 2022, 8:15pm UTC](https://discourse.julialang.org/t/scenarios-defining/79401 "2022-04-12T20:15:27Z")

</div>

Hello, I have near the same stochastic project as @elalaouifaris had in the Here . I tried the second way to create the scenarios, but I faced to this error: LoadError: UndefVarError: @container\_scenario not defined I…

---

## [Suppressing Info blocks from StructuralIdentifiability](https://discourse.julialang.org/t/suppressing-info-blocks-from-structuralidentifiability/79388)

<div class="topic-metadata">

**Author:** [@bendkok](https://discourse.julialang.org/u/bendkok)\
**Replies:** 6\
**Last updated:** [April 12, 2022, 8:04pm UTC](https://discourse.julialang.org/t/suppressing-info-blocks-from-structuralidentifiability/79388 "2022-04-12T20:04:13Z")

</div>

Hi. I’m using the Julia package StructuralIdentifiability. To use it we first define an ODE-model, and then check the identifiability of its parameters. When I do either of those it prints these “Info:” blocks that take…

---

## [Getting constraint matrix from gurobi](https://discourse.julialang.org/t/getting-constraint-matrix-from-gurobi/79107)

<div class="topic-metadata">

**Author:** [@shsh](https://discourse.julialang.org/u/shsh)\
**Replies:** 5\
**Last updated:** [April 12, 2022, 7:58pm UTC](https://discourse.julialang.org/t/getting-constraint-matrix-from-gurobi/79107 "2022-04-12T19:58:41Z")

</div>

Is there an easy way to obtain the current constraint matrix from gurobi (or the original constraint matrix and inverse of the basis matrix) using MathOptInterface. I have been searching google and only found how to do …

---

## [How to use string in @nlexpression](https://discourse.julialang.org/t/how-to-use-string-in-nlexpression/79374)

<div class="topic-metadata">

**Author:** [@manoj.centura](https://discourse.julialang.org/u/manoj.centura)\
**Replies:** 1\
**Last updated:** [April 12, 2022, 6:47pm UTC](https://discourse.julialang.org/t/how-to-use-string-in-nlexpression/79374 "2022-04-12T18:47:59Z")

</div>

Hi All, i want to create @NL expreesion on fly in JuMP. I am getting the below error. model = Model() @variable(model, x\[1:3\]) @constraint(model, c2, x\[1\] + 2 \* x\[3\] \>= 2) @constraint(model, c4, 4 \<= 2 \* x\[2\] \<= 5) …

---

## [Distinguish dictionary lookup from nothing and not found?](https://discourse.julialang.org/t/distinguish-dictionary-lookup-from-nothing-and-not-found/38654)

<div class="topic-metadata">

**Author:** [@thautwarm](https://discourse.julialang.org/u/thautwarm)\
**Replies:** 22\
**Last updated:** [April 12, 2022, 5:49pm UTC](https://discourse.julialang.org/t/distinguish-dictionary-lookup-from-nothing-and-not-found/38654 "2022-04-12T17:49:46Z")

</div>

get(dict, key, nothing) can be ambiguous as it can means dict\[key\] === nothing or key not found. Without a get function returning Union{Some{T}, Nothing}, I have to choose the following options, which turns out to troub…

---

## [Help me beat my pythonist friend's code. Speeding up data reading with simple reduction from NetCDF file](https://discourse.julialang.org/t/help-me-beat-my-pythonist-friends-code-speeding-up-data-reading-with-simple-reduction-from-netcdf-file/76457)

<div class="topic-metadata">

**Author:** [@aramirezreyes](https://discourse.julialang.org/u/aramirezreyes)\
**Replies:** 57\
**Last updated:** [April 12, 2022, 4:35pm UTC](https://discourse.julialang.org/t/help-me-beat-my-pythonist-friends-code-speeding-up-data-reading-with-simple-reduction-from-netcdf-file/76457 "2022-04-12T16:35:49Z")

</div>

I work with atmospheric simulations and I use NetCDF files of the order of 80GB to 1TB. I am always jelous at my friend from the office (@lsterzinger) that does everything super fast in his python with xarray, zarr, da…

---

## [Working around current MethodOfLines.jl known limitations](https://discourse.julialang.org/t/working-around-current-methodoflines-jl-known-limitations/79346)

<div class="topic-metadata">

**Author:** [@jenrei](https://discourse.julialang.org/u/jenrei)\
**Replies:** 4\
**Last updated:** [April 12, 2022, 4:25pm UTC](https://discourse.julialang.org/t/working-around-current-methodoflines-jl-known-limitations/79346 "2022-04-12T16:25:58Z")

</div>

Hi, I’m trying to solve the energy/heat equation with temperature dependent material properties (density, enthalpy and thermal conductivity). Therefore I’m running in the issues that are mentioned as (current) known limi…

---

## [Creating a Static Array with a loop](https://discourse.julialang.org/t/creating-a-static-array-with-a-loop/79350)

<div class="topic-metadata">

**Author:** [@lzxnl](https://discourse.julialang.org/u/lzxnl)\
**Replies:** 10\
**Last updated:** [April 12, 2022, 3:32pm UTC](https://discourse.julialang.org/t/creating-a-static-array-with-a-loop/79350 "2022-04-12T15:32:52Z")

</div>

I am solving an ODE with my own version of a Dormand Prince solver, and previously I have been using an in-place version, which has worked well for me, in that the allocations come from allocating for the array containin…

---

## [Mapping Hwloc logical index to OS index](https://discourse.julialang.org/t/mapping-hwloc-logical-index-to-os-index/79377)

<div class="topic-metadata">

**Author:** [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Replies:** 5\
**Last updated:** [April 12, 2022, 3:12pm UTC](https://discourse.julialang.org/t/mapping-hwloc-logical-index-to-os-index/79377 "2022-04-12T15:12:29Z")

</div>

The docs for Hwloc library state that the logical indices of Processor units used by Hwloc are not the same as the indices used by OS. How does one map Hwloc logical indices to OS indices? Is this functionality exposed…

---

## [Struggling to get scipy.newton performance using NonlinearSolve.jl](https://discourse.julialang.org/t/struggling-to-get-scipy-newton-performance-using-nonlinearsolve-jl/79369)

<div class="topic-metadata">

**Author:** [@deserted\_eagle](https://discourse.julialang.org/u/deserted_eagle)\
**Replies:** 4\
**Last updated:** [April 12, 2022, 3:06pm UTC](https://discourse.julialang.org/t/struggling-to-get-scipy-newton-performance-using-nonlinearsolve-jl/79369 "2022-04-12T15:06:38Z")

</div>

Hi everyone! I’m relatively new to Julia (1.7.2), coming from a Matlab and Python background. I really enjoy the language, but I also struggle sometimes in cases where in Matlab / numpy I would simply use vectorization a…

---

## [What to do about seemingly stranded package](https://discourse.julialang.org/t/what-to-do-about-seemingly-stranded-package/79384)

<div class="topic-metadata">

**Author:** [@markmbaum](https://discourse.julialang.org/u/markmbaum)\
**Replies:** 1\
**Last updated:** [April 12, 2022, 2:28pm UTC](https://discourse.julialang.org/t/what-to-do-about-seemingly-stranded-package/79384 "2022-04-12T14:28:08Z")

</div>

I’ve wanted to update the Julia wrapper of Seaborn for a while because it’s been out of date for years, mainly since v0.11.0 was released in 2020. I finally took the time to try the update myself and submitted a PR, but …

---

## ['for loop' and Nothing](https://discourse.julialang.org/t/for-loop-and-nothing/79367)

<div class="topic-metadata">

**Author:** [@anikaiful](https://discourse.julialang.org/u/anikaiful)\
**Replies:** 8\
**Last updated:** [April 12, 2022, 1:59pm UTC](https://discourse.julialang.org/t/for-loop-and-nothing/79367 "2022-04-12T13:59:06Z")

</div>

Nothing (pun intended) “surprised” me a little bit… foo = nothing for x in foo println("should not see this") end Instead of silently skipping the whole for x block, I got ERROR: MethodError: no method…

---

## [Using juniper with ipopt and cbc in julia.1.6](https://discourse.julialang.org/t/using-juniper-with-ipopt-and-cbc-in-julia-1-6/78394)

<div class="topic-metadata">

**Author:** [@manoj.centura](https://discourse.julialang.org/u/manoj.centura)\
**Replies:** 2\
**Last updated:** [April 12, 2022, 1:20pm UTC](https://discourse.julialang.org/t/using-juniper-with-ipopt-and-cbc-in-julia-1-6/78394 "2022-04-12T13:20:43Z")

</div>

Subject to maximumqty == 111371.4 x\[1,1,1,1,1\] + x\[2,1,1,1,1\] + x\[3,1,1,1,1\] + x\[4,1,1,1,1\] + x\[5,1,1,1,1\] + x\[1,1,1,1,2\] + x\[2,1,1,1,2\] + x\[3,1,1,1,2\] + x\[4,1,1,1,2\] + x\[5,1,1,1,2\] - MaxWt == 0.0 x\[1,1,1,1,1\] - 56014…

---

## [Modify a Expr to generate a new Expr](https://discourse.julialang.org/t/modify-a-expr-to-generate-a-new-expr/79368)

<div class="topic-metadata">

**Author:** [@Brian1](https://discourse.julialang.org/u/Brian1)\
**Replies:** 4\
**Last updated:** [April 12, 2022, 1:10pm UTC](https://discourse.julialang.org/t/modify-a-expr-to-generate-a-new-expr/79368 "2022-04-12T13:10:13Z")

</div>

Is there a way I can removing “(” and “)” in an Expr, like this: The orignal Expr: origin=:((10 |\> x-\>x+2) |\> x-\>x+3) New target Expr: target=:(10 |\> x-\>x+2 |\> x-\>x+3) It has following this rules: only the “( )” fr…

---

## [Row and column major order for arrays of different shape](https://discourse.julialang.org/t/row-and-column-major-order-for-arrays-of-different-shape/79297)

<div class="topic-metadata">

**Author:** [@fedoroff](https://discourse.julialang.org/u/fedoroff)\
**Replies:** 23\
**Last updated:** [April 12, 2022, 1:05pm UTC](https://discourse.julialang.org/t/row-and-column-major-order-for-arrays-of-different-shape/79297 "2022-04-12T13:05:12Z")

</div>

In the following code the functions r\_major and c\_major iterate over array a in the row and column major order: using BenchmarkTools function r\_major!(a) N1, N2 = size(a) for i=1:N1 for j=1:N2 a\[i,j…

---

## [Finding the percentile rank of a value in a dataset. Noob needs comments on approach](https://discourse.julialang.org/t/finding-the-percentile-rank-of-a-value-in-a-dataset-noob-needs-comments-on-approach/79352)

<div class="topic-metadata">

**Author:** [@anon69491625](https://discourse.julialang.org/u/anon69491625)\
**Replies:** 4\
**Last updated:** [April 12, 2022, 12:49pm UTC](https://discourse.julialang.org/t/finding-the-percentile-rank-of-a-value-in-a-dataset-noob-needs-comments-on-approach/79352 "2022-04-12T12:49:04Z")

</div>

trying to get percentile using a specific value in this case stock close. The data set is below I loaded it all into a dataframe called df\_symbol. The columns are time and close. time close 20210412 701.98 20210413 762…

---

## [Edited Ques: @printf not printing anythin in following](https://discourse.julialang.org/t/edited-ques-printf-not-printing-anythin-in-following/79142)

<div class="topic-metadata">

**Author:** [@\_SACHIN](https://discourse.julialang.org/u/_SACHIN)\
**Replies:** 18\
**Last updated:** [April 12, 2022, 11:10am UTC](https://discourse.julialang.org/t/edited-ques-printf-not-printing-anythin-in-following/79142 "2022-04-12T11:10:50Z")

</div>

Why @printf at the end is not printing anything for the following ? Note iTensors is a package. So you might ignore the code. using ITensors using Printf function ITensors.op(::OpName"expτSS", ::SiteType"S=1/2", s1::…

---

## [MethodError: no method matching lift(::typeof(tuple))](https://discourse.julialang.org/t/methoderror-no-method-matching-lift-typeof-tuple/79048)

<div class="topic-metadata">

**Author:** [@yashi](https://discourse.julialang.org/u/yashi)\
**Replies:** 8\
**Last updated:** [April 12, 2022, 11:10am UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-lift-typeof-tuple/79048 "2022-04-12T11:10:35Z")

</div>

I’m trying to use Plot Recipes in Makie. To do so, I’ve been trying to create a smallest example (which does nothing) by reading Plot Recipes. Because, although It works like a charm, the stock chart example is a bit t…

---

## [HTTP server with parallelism](https://discourse.julialang.org/t/http-server-with-parallelism/79370)

<div class="topic-metadata">

**Author:** [@xor0110](https://discourse.julialang.org/u/xor0110)\
**Replies:** 1\
**Last updated:** [April 12, 2022, 9:34am UTC](https://discourse.julialang.org/t/http-server-with-parallelism/79370 "2022-04-12T09:34:20Z")

</div>

This question relates a bit to HTTP.jl doesn't seem to be good at handling over 1k concurrent requests, in comparison to an alternative in Python?: I’m interested in creating a HTTP server that executes CPU-heavy tasks.…

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

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