# Latest

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

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

**Page:** 379

---

## [Logical conditions](https://discourse.julialang.org/t/logical-conditions/115363)

<div class="topic-metadata">

**Author:** [@papar](https://discourse.julialang.org/u/papar)\
**Replies:** 14\
**Last updated:** [June 25, 2024, 12:40am UTC](https://discourse.julialang.org/t/logical-conditions/115363 "2024-06-25T00:40:18Z")

</div>

I’m working on an optimization problem in JuMP where I need to ensure that certain constraints are enforced based on a binary variable. Here are the variables and constraints I have defined in my model: Variable Definit…

---

## [Decomposing an EEG Signal from Scratch](https://discourse.julialang.org/t/decomposing-an-eeg-signal-from-scratch/115904)

<div class="topic-metadata">

**Author:** [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Replies:** 22\
**Last updated:** [June 24, 2024, 9:00pm UTC](https://discourse.julialang.org/t/decomposing-an-eeg-signal-from-scratch/115904 "2024-06-24T21:00:08Z")

</div>

Hey folks! :wave: I’ve been recently tinkering with decomposing some EEG data into various visualizations and want to make sure I am going about things the right way (the data using is openly available from here). Here …

---

## [How does the Testing pane work?](https://discourse.julialang.org/t/how-does-the-testing-pane-work/115301)

<div class="topic-metadata">

**Author:** [@Ken\_Williams](https://discourse.julialang.org/u/Ken_Williams)\
**Replies:** 13\
**Last updated:** [June 24, 2024, 8:10pm UTC](https://discourse.julialang.org/t/how-does-the-testing-pane-work/115301 "2024-06-24T20:10:13Z")

</div>

I haven’t been able to find a reference about how the Testing pane in VS Code works for a Julia project’s unit tests. I’ve fiddled around a bit and tried various of file layouts (test\_\*.jl vs. \*\_test.jl, putting in a M…

---

## [Julia Meetup Zurich: looking for a new organizer](https://discourse.julialang.org/t/julia-meetup-zurich-looking-for-a-new-organizer/115740)

<div class="topic-metadata">

**Author:** [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Replies:** 5\
**Last updated:** [June 24, 2024, 7:06pm UTC](https://discourse.julialang.org/t/julia-meetup-zurich-looking-for-a-new-organizer/115740 "2024-06-24T19:06:13Z")

</div>

I will step down as the organizer of the Julia Zurich Meetup. Apart from the revival a few month ago, I never got into gear again organizing gatherings post covid. Is there anyone wanting to take over organizing this s…

---

## [Distributed computing or Multi-threading on Optimization](https://discourse.julialang.org/t/distributed-computing-or-multi-threading-on-optimization/116147)

<div class="topic-metadata">

**Author:** [@benjamin.nunez](https://discourse.julialang.org/u/benjamin.nunez)\
**Replies:** 1\
**Last updated:** [June 24, 2024, 7:05pm UTC](https://discourse.julialang.org/t/distributed-computing-or-multi-threading-on-optimization/116147 "2024-06-24T19:05:21Z")

</div>

Hello! I am currently working on an algorithm to solve stochastic optimization problems by decomposing them into scenarios (very similar to Progressive Hedging). I am not very knowledgeable in the area of task parallel…

---

## [Define test error message programmatically](https://discourse.julialang.org/t/define-test-error-message-programmatically/116142)

<div class="topic-metadata">

**Author:** [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Replies:** 13\
**Last updated:** [June 24, 2024, 5:46pm UTC](https://discourse.julialang.org/t/define-test-error-message-programmatically/116142 "2024-06-24T17:46:21Z")

</div>

Is there a way for a test to display a custom error message, without giving up on the nice display of numerical values equality / comparison tests? The workaround in Custom error message from @test macro is only a parti…

---

## [Plotting with break in axis using Plot.jl](https://discourse.julialang.org/t/plotting-with-break-in-axis-using-plot-jl/116140)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 6\
**Last updated:** [June 24, 2024, 3:11pm UTC](https://discourse.julialang.org/t/plotting-with-break-in-axis-using-plot-jl/116140 "2024-06-24T15:11:44Z")

</div>

I have data with has same y-axis range but for x-axis it has two different set of datapoints at far locations. Now plan is to plot them together with a break in x-axis. I was trying initially with just directly using Pl…

---

## [Nice talk about Go PGO. What is the state in Julia?](https://discourse.julialang.org/t/nice-talk-about-go-pgo-what-is-the-state-in-julia/115715)

<div class="topic-metadata">

**Author:** [@Dan](https://discourse.julialang.org/u/Dan)\
**Replies:** 8\
**Last updated:** [June 24, 2024, 4:40pm UTC](https://discourse.julialang.org/t/nice-talk-about-go-pgo-what-is-the-state-in-julia/115715 "2024-06-24T16:40:48Z")

</div>

These devs get it! The first 10 minutes are about the Go ecosystem and are worth it for any language devs. The rest are a great introduction to optimization issues and PGO. P.S. What is the state of PGO in Julia? I wo…

---

## [Structural SImplify Unable to perform broadcast equation](https://discourse.julialang.org/t/structural-simplify-unable-to-perform-broadcast-equation/115967)

<div class="topic-metadata">

**Author:** [@HSnowden](https://discourse.julialang.org/u/HSnowden)\
**Replies:** 1\
**Last updated:** [June 24, 2024, 3:48pm UTC](https://discourse.julialang.org/t/structural-simplify-unable-to-perform-broadcast-equation/115967 "2024-06-24T15:48:06Z")

</div>

Hello, In a model I habe been building, I go to perform structural simplify upon it and it results in the following error MethodError: no method matching length(::SymbolicUtils.BasicSymbolic{Any}). The code to blame fo…

---

## [Update Vector with dot Operator - Different Behavior when using Vector and Other Types](https://discourse.julialang.org/t/update-vector-with-dot-operator-different-behavior-when-using-vector-and-other-types/116138)

<div class="topic-metadata">

**Author:** [@Andy\_Zhang](https://discourse.julialang.org/u/Andy_Zhang)\
**Replies:** 1\
**Last updated:** [June 24, 2024, 12:38pm UTC](https://discourse.julialang.org/t/update-vector-with-dot-operator-different-behavior-when-using-vector-and-other-types/116138 "2024-06-24T12:38:10Z")

</div>

Here is a piece of code: v1 = \[2, 3, 5, 7, 11, 13, 17\] @show v1 v1\[1:3\] = \[1, 2, 3\] @show v1 v1\[1:3\] .= 0 @show v1 v1\[1:3\] .= \[4, 5, 6\] @show v1 v1\[1:3\] .= "1" Output: v1 = \[2, 3, 5, 7, 11, 13, 17\] v1 = \[1, 2, 3, 7, 1…

---

## [How do I create an array with random unique numbers in a specific range?](https://discourse.julialang.org/t/how-do-i-create-an-array-with-random-unique-numbers-in-a-specific-range/115901)

<div class="topic-metadata">

**Author:** [@kwellstein](https://discourse.julialang.org/u/kwellstein)\
**Replies:** 20\
**Last updated:** [June 24, 2024, 11:53am UTC](https://discourse.julialang.org/t/how-do-i-create-an-array-with-random-unique-numbers-in-a-specific-range/115901 "2024-06-24T11:53:30Z")

</div>

Hi everyone! I have been googling and spending time in stackexchange but to no avail, I hope someone on here can help me out. What I need is an array with 30 UNIQUE random integers between 1 and 40. Somehow this seems …

---

## [Moving Horizon Estimation](https://discourse.julialang.org/t/moving-horizon-estimation/115921)

<div class="topic-metadata">

**Author:** [@MarcoDellOro](https://discourse.julialang.org/u/MarcoDellOro)\
**Replies:** 8\
**Last updated:** [June 24, 2024, 11:39am UTC](https://discourse.julialang.org/t/moving-horizon-estimation/115921 "2024-06-24T11:39:08Z")

</div>

Hello everybody, I am having some issues with the Moving Horizon Estimation (MHE) code I am writing. To me, the task and the code seem quite easy, but I cannot obtain the desired results for some reason. I attach here …

---

## [Is there any way to emulate MATLAB's Isqlin in Julia?](https://discourse.julialang.org/t/is-there-any-way-to-emulate-matlabs-isqlin-in-julia/93394)

<div class="topic-metadata">

**Author:** [@Itzi](https://discourse.julialang.org/u/Itzi)\
**Replies:** 20\
**Last updated:** [June 24, 2024, 11:31am UTC](https://discourse.julialang.org/t/is-there-any-way-to-emulate-matlabs-isqlin-in-julia/93394 "2024-06-24T11:31:16Z")

</div>

Hi, I am trying to solve a box constrained least squares problem. I have the classic Ax = b problem where x are the parameters I want to find, and A and b are full of experimental data. I have tried: using Convex, SC…

---

## [How to evaluate Python custom code in PythonCall?](https://discourse.julialang.org/t/how-to-evaluate-python-custom-code-in-pythoncall/116113)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 7\
**Last updated:** [June 24, 2024, 10:23am UTC](https://discourse.julialang.org/t/how-to-evaluate-python-custom-code-in-pythoncall/116113 "2024-06-24T10:23:27Z")

</div>

While I agree that most “call Python in Julia” refers to call existing libraries, I sometimes find it useful to be able to evaluate custom defined Python code from Julia. Which is the PythonCall equivalent to this PyCal…

---

## [A question about PSF deconvolution](https://discourse.julialang.org/t/a-question-about-psf-deconvolution/116108)

<div class="topic-metadata">

**Author:** [@Cyan](https://discourse.julialang.org/u/Cyan)\
**Replies:** 7\
**Last updated:** [June 24, 2024, 10:15am UTC](https://discourse.julialang.org/t/a-question-about-psf-deconvolution/116108 "2024-06-24T10:15:17Z")

</div>

Could I obtain the deconvolved image if I have an original image and its PSF? And if I have a deconvolved image and its PSF, how can I obtain the convolved image?

---

## [How to customize display of custom array type in VSCode workspace and table viewer?](https://discourse.julialang.org/t/how-to-customize-display-of-custom-array-type-in-vscode-workspace-and-table-viewer/115988)

<div class="topic-metadata">

**Author:** [@bbejanov](https://discourse.julialang.org/u/bbejanov)\
**Replies:** 1\
**Last updated:** [June 24, 2024, 10:08am UTC](https://discourse.julialang.org/t/how-to-customize-display-of-custom-array-type-in-vscode-workspace-and-table-viewer/115988 "2024-06-24T10:08:44Z")

</div>

I have two custom array types - TSeries \<: AbstractVector and MVTSeries \<: AbstractMatrix in package TimeSeriesEcon - that don’t display correctly in the Julia Workspace in VS Code. The table viewer is shows the numbers…

---

## [Media properties and component encapsulation in MTK](https://discourse.julialang.org/t/media-properties-and-component-encapsulation-in-mtk/83557)

<div class="topic-metadata">

**Author:** [@dodoplus](https://discourse.julialang.org/u/dodoplus)\
**Replies:** 6\
**Last updated:** [June 24, 2024, 9:36am UTC](https://discourse.julialang.org/t/media-properties-and-component-encapsulation-in-mtk/83557 "2024-06-24T09:36:29Z")

</div>

Hi, Modelica has a Media library that captures the properties of various materials. It implements the equations given in IF97 (a version of was apparently implemented in Julia). It provides e.g. calculation of the Cp, C…

---

## [Confusion about scope in try-catch blocks](https://discourse.julialang.org/t/confusion-about-scope-in-try-catch-blocks/115622)

<div class="topic-metadata">

**Author:** [@Tortar](https://discourse.julialang.org/u/Tortar)\
**Replies:** 22\
**Last updated:** [June 24, 2024, 9:07am UTC](https://discourse.julialang.org/t/confusion-about-scope-in-try-catch-blocks/115622 "2024-06-24T09:07:31Z")

</div>

Regarding scoping rules this used to trip me up a bit: Python: \>\>\> try: ... x = 2 ... except: ... pass ... \>\>\> x 2 Julia: julia\> try x = 2 catch end 2 julia\> x ERROR: UndefVarError:…

---

## [Flyers for JuliaCon 2024 and PyData Eindhoven 2024](https://discourse.julialang.org/t/flyers-for-juliacon-2024-and-pydata-eindhoven-2024/116131)

<div class="topic-metadata">

**Author:** [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Replies:** 0\
**Last updated:** [June 24, 2024, 4:57am UTC](https://discourse.julialang.org/t/flyers-for-juliacon-2024-and-pydata-eindhoven-2024/116131 "2024-06-24T04:57:55Z")

</div>

Please help us spread the word about JuliaCon Global 2024 and PyData Eindhoven 2024, by posting these flyers.

---

## [Julia and Programmable Calculators](https://discourse.julialang.org/t/julia-and-programmable-calculators/116117)

<div class="topic-metadata">

**Author:** [@Leviset](https://discourse.julialang.org/u/Leviset)\
**Replies:** 7\
**Last updated:** [June 24, 2024, 3:05am UTC](https://discourse.julialang.org/t/julia-and-programmable-calculators/116117 "2024-06-24T03:05:03Z")

</div>

2024-06-22T23:00:00Z (UTC) I’ve talked in earlier topics about ASM and Julia. Recently Texas Instruments have released the TI-84 Plus CE-T Programmable Calculator with Python installed. Is there a possibility that a v…

---

## [How to determine when to broadcast](https://discourse.julialang.org/t/how-to-determine-when-to-broadcast/116127)

<div class="topic-metadata">

**Author:** [@lrennels](https://discourse.julialang.org/u/lrennels)\
**Replies:** 10\
**Last updated:** [June 24, 2024, 2:55am UTC](https://discourse.julialang.org/t/how-to-determine-when-to-broadcast/116127 "2024-06-24T02:55:57Z")

</div>

I have some code that needs to perform a setindex!(A::Array, X::Float64, Indices) using A\[Indices...\] = X or broadcasting A\[Indices...\] .= X. Right now until that is called I don’t know if Indices will be a Vector of In…

---

## [\`sum\` syntax rule differs between Julia and \`JuMP\`](https://discourse.julialang.org/t/sum-syntax-rule-differs-between-julia-and-jump/116125)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 2\
**Last updated:** [June 23, 2024, 11:59pm UTC](https://discourse.julialang.org/t/sum-syntax-rule-differs-between-julia-and-jump/116125 "2024-06-23T23:59:51Z")

</div>

a = \[1, 2, 3, 4\] sum(a\[n\] for n in 1:0) # ERROR: MethodError: reducing over an empty collection is not allowed; consider supplying \`init\` to the reducer using JuMP m = Model() @constraint(m, sum(a\[n\] for n in 1:0) \>= 0)…

---

## [Scaling a sparse matrix row-wise and column-wise too slow](https://discourse.julialang.org/t/scaling-a-sparse-matrix-row-wise-and-column-wise-too-slow/115956)

<div class="topic-metadata">

**Author:** [@pitsianis](https://discourse.julialang.org/u/pitsianis)\
**Replies:** 20\
**Last updated:** [June 23, 2024, 9:17pm UTC](https://discourse.julialang.org/t/scaling-a-sparse-matrix-row-wise-and-column-wise-too-slow/115956 "2024-06-23T21:17:22Z")

</div>

I need to scale a sparse matrix row-wise and column-wise. That is S\[i,j\] = r\[i\] \* A\[i,j\] \* c\[j\] If I write it the way you’d see it in a math book, S = spdiagm(r) \* A \* spdiagm(c) the expression takes 8x times more th…

---

## [Understanding @report\_code output](https://discourse.julialang.org/t/understanding-report-code-output/116000)

<div class="topic-metadata">

**Author:** [@miguelborrero](https://discourse.julialang.org/u/miguelborrero)\
**Replies:** 3\
**Last updated:** [June 23, 2024, 6:56pm UTC](https://discourse.julialang.org/t/understanding-report-code-output/116000 "2024-06-23T18:56:25Z")

</div>

Hi there, This is my first time using JET.jl to fix the type-instability issues of my code. I am aware that maybe asking without a reproducible example might be a stretch but I will try anyways. My function takes as an…

---

## [Recommended reading: Does AI mean "All Inferior"?](https://discourse.julialang.org/t/recommended-reading-does-ai-mean-all-inferior/115977)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 7\
**Last updated:** [June 23, 2024, 7:01pm UTC](https://discourse.julialang.org/t/recommended-reading-does-ai-mean-all-inferior/115977 "2024-06-23T19:01:28Z")

</div>

The post “AI crap” is becoming more relevant every day.

---

## [ERROR: LoadError: type DataType has no field Let](https://discourse.julialang.org/t/error-loaderror-type-datatype-has-no-field-let/116116)

<div class="topic-metadata">

**Author:** [@JapaCZECH](https://discourse.julialang.org/u/JapaCZECH)\
**Replies:** 2\
**Last updated:** [June 23, 2024, 6:55pm UTC](https://discourse.julialang.org/t/error-loaderror-type-datatype-has-no-field-let/116116 "2024-06-23T18:55:21Z")

</div>

Hello! I have a problem which I don’t know how to solve. I am making a lexer for my programming language and there is this problem: ERROR: LoadError: type DataType has no field Let Stacktrace: \[1\] getproperty(x::Type, f…

---

## [How to ensure Makie's theme activation occurs when called in a module?](https://discourse.julialang.org/t/how-to-ensure-makies-theme-activation-occurs-when-called-in-a-module/116114)

<div class="topic-metadata">

**Author:** [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Replies:** 2\
**Last updated:** [June 23, 2024, 6:27pm UTC](https://discourse.julialang.org/t/how-to-ensure-makies-theme-activation-occurs-when-called-in-a-module/116114 "2024-06-23T18:27:05Z")

</div>

I had some script with lots of convenience plotting functions for Makie, as well as a bunch of themes I like to use in my work. For reproducibility I decided to make it a Julia package so that it can be added and its git…

---

## [Convergence of gmres from IterativeSolvers in minimal examples](https://discourse.julialang.org/t/convergence-of-gmres-from-iterativesolvers-in-minimal-examples/115852)

<div class="topic-metadata">

**Author:** [@Pablo\_Marchant](https://discourse.julialang.org/u/Pablo_Marchant)\
**Replies:** 7\
**Last updated:** [June 23, 2024, 2:55pm UTC](https://discourse.julialang.org/t/convergence-of-gmres-from-iterativesolvers-in-minimal-examples/115852 "2024-06-23T14:55:07Z")

</div>

Hi all, I’m trying to see if I can apply gmres in a domain specific problem I have, where I need to solve a system Ax=b where A is a non-symmetric square block tridiagonal matrix. I have not managed to get this to work,…

---

## [How to wrap a Python function in a Julia package using PythonCall.jl](https://discourse.julialang.org/t/how-to-wrap-a-python-function-in-a-julia-package-using-pythoncall-jl/95101)

<div class="topic-metadata">

**Author:** [@Dale\_James\_Black](https://discourse.julialang.org/u/Dale_James_Black)\
**Replies:** 16\
**Last updated:** [June 23, 2024, 12:25pm UTC](https://discourse.julialang.org/t/how-to-wrap-a-python-function-in-a-julia-package-using-pythoncall-jl/95101 "2024-06-23T12:25:37Z")

</div>

I am developing a package that wants to wrap and re-export a Python function. The relevant code is below, and it works well within the same file it was called in, but it breaks when trying to test it in the package I am …

---

## [How to switch between function definitions for using CUDA.jl](https://discourse.julialang.org/t/how-to-switch-between-function-definitions-for-using-cuda-jl/115986)

<div class="topic-metadata">

**Author:** [@Cibin\_Joseph](https://discourse.julialang.org/u/Cibin_Joseph)\
**Replies:** 3\
**Last updated:** [June 23, 2024, 12:18pm UTC](https://discourse.julialang.org/t/how-to-switch-between-function-definitions-for-using-cuda-jl/115986 "2024-06-23T12:18:26Z")

</div>

I have two variants of a function: One that utilizes the CPU and an other that utilizes the GPU through CUDA.jl. I’d like to offer the user the option of switching between the two. I’ve tried using environment variables…

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

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